Skip to content

feat: implement activity likes, comments, embedded migrations & developer guide - #2

Open
Linux-oiD wants to merge 13 commits into
mainfrom
gemini
Open

feat: implement activity likes, comments, embedded migrations & developer guide#2
Linux-oiD wants to merge 13 commits into
mainfrom
gemini

Conversation

@Linux-oiD

Copy link
Copy Markdown
Owner

Summary

This pull request implements the social interaction features (Activity Likes & Comments) along with developer guidance and architectural governance.

Key Changes:

  • Embedded Database Migrations ():
    • Replaced Go-based migration files with standard Goose SQL migrations embedded directly via embed.FS.
    • Added migration 00003_add_activities_likes_and_comments.sql defining activities, activity_likes, and activity_comments tables.
  • Backend API Service (services/api):
    • Adhered strictly to Clean Architecture layering (entity $\rightarrow$ usecase $\rightarrow$ repo $\rightarrow$ controller).
    • Implemented database access using GORM's modern generic API (gorm.G[T](db)).
    • Added REST controllers and routes for liking/unliking activities (POST/DELETE /api/v1/activities/:id/like) and comments CRUD (GET/POST /api/v1/activities/:id/comments, DELETE /api/v1/comments/:id).
  • Frontend Client Application (services/web):
    • Implemented ActivityLikeButton with instant optimistic UI response (<200ms).
    • Implemented ActivityCommentSection with comment form, whitespace validation, chronological thread rendering, and author-based deletion.
    • Implemented ActivityFeedCard and updated the Home feed with interactive activity posting and summary badges.
  • Documentation & Governance:
    • Created AGENTS.md codifying Clean Architecture, SAGA & RabbitMQ patterns, GORM Generic ORM, and Trunk-Based Development.
    • Updated FitFeed Constitution (.specify/memory/constitution.md) to v1.1.0.

Linux-oiD added 13 commits April 4, 2026 23:52
- Preload associations (Passkeys, Profile) in UserDB repositories for auth and api services
- Fix 'Found no credentials for user' error during WebAuthn BeginLogin
- Add credentials: 'include' to frontend passkey login fetch calls
- Ensure session cookies are correctly sent during login flow
- Update Preload calls in auth and api repositories to match gorm.G signature
- Use 127.0.0.1 consistently in config and .env to avoid localhost resolution issues
- Make API config controller dynamic based on loaded configuration
- Mount auth service under /auth and api service under /api
- Configure Vite proxy to route /auth and /api to backend services
- Switch frontend to use relative paths for service communication
- Remove manual 'credentials: include' from fetch calls (now handled by same-origin proxy)
- Update API config controller to return relative service paths
- Fix Preload calls with explicit builder functions to prevent panics
- Confirm /auth and /api prefixes are working correctly in both services
- Finalize relative paths in frontend for seamless Vite proxying
- Verified entire flow with curl
- Add BackupEligible and BackupState to Passkey models and entities
- Create migration to add backup flag columns to passkeys table
- Update WebAuthn mapping to include persisted backup flags
- Fix validation error 'Backup Eligible flag inconsistency detected during login validation'
GORM's CreateTable in migration 00002 already includes these columns because the Passkey model was updated before the table was created in the reset flow.
- Correct WebAuthn Credential mapping to use CredentialFlags
- Fix BackupEligible and BackupState access in PasskeyManager
- Update UserManager tests to match new pointer-based Create signature
- Successfully verified with go build, go test and bun run build
…ment

- Add DateOfBirth to Profile model and entities
- Implement profileService.updateProfile in web service
- Create Profile page with Ant Design form and validation
- Add automatic redirection to /profile if user email is missing
- Implement UpdateProfile usecase and handler in api service
- Add unit tests for api UserManager.UpdateProfile
- Fix all TypeScript and ESLint issues in web service
- Delegate user/profile management to api service
- Implement AMQP Client (auth) and Server (api) for RPC and Events
- Implement SAGA pattern for user creation with compensation logic
- Update architecture documentation with Mermaid diagrams
- Add RabbitMQ to Docker Compose and project config
- Update unit tests and perform E2E verification
- Create Settings page with General and Auth Methods tabs
- Add support for listing and unlinking OAuth providers in auth service
- Add support for listing and deleting Passkeys in auth service
- Implement account linking logic in OAuth callback
- Update API config to return enabled providers
- Protect management routes with JWTMiddleware in auth service
- Fix various TypeScript and ESLint issues
…dded SQL migrations and AntD UI

- Add Goose SQL migration for activities, activity_likes, and activity_comments tables
- Implement GORM generic repository layer for social entities in api service
- Implement usecase and HTTP controllers for liking/unliking activities and comment CRUD
- Build React components (ActivityLikeButton, ActivityCommentSection, ActivityFeedCard)
- Create AGENTS.md developer guide and update project constitution to v1.1.0
- Update Go module paths across auth, api, and dbm services to github.com/Linux-oiD/fitfeed/services/*
- Replace relative fitfeed/* imports with full GitHub module URLs
- Fix TypeScript any types in web components and pages to satisfy ESLint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant