Files
headquarter/openspec/changes/user-profile/tasks.md
T
Fusion 577b052c05 feat: implement user profile management and oauth/traefik integration
User Profile (US-004):
- Add authenticated profile endpoints (GET/PUT /users/me)
- Add avatar upload with file validation (PNG/JPEG, max 2MB)
- Create frontend profile page with edit form and avatar upload
- Update app shell to link to profile page

OAuth/Traefik Integration:
- Externalize all Authentik URLs to environment variables
- Add domain configuration (API_DOMAIN, WEB_DOMAIN, AUTHENTIK_DOMAIN)
- Create docker-compose.traefik.yml for reverse proxy deployment
- Update OAuth redirect/callback URLs to use configured domains
- Add VITE_APP_URL for frontend public URL configuration

Quality gates: pytest (50 passed), ruff, mypy, npm test (12 passed), typecheck, lint, build
2026-05-17 23:17:10 +02:00

1.7 KiB

1. Backend profile API

  • 1.1 Create apps/api/src/api/users.py with GET /users/me, PUT /users/me, and POST /users/me/avatar endpoints.
  • 1.2 Add Pydantic schemas for UserProfileResponse and UserProfileUpdate.
  • 1.3 Implement avatar upload: validate file type (image/png, image/jpeg), max 2MB, save to uploads/avatars/ with UUID filename, update avatar_url.
  • 1.4 Register users router in apps/api/src/main.py.
  • 1.5 Add backend tests for profile read, update, and avatar upload.

2. Frontend profile page

  • 2.1 Create apps/web/src/api/profile.ts with API methods for getProfile, updateProfile, and uploadAvatar.
  • 2.2 Create apps/web/src/pages/profile.tsx with profile display, edit form (name, email), and avatar upload.
  • 2.3 Add /profile route in apps/web/src/router.tsx.
  • 2.4 Update apps/web/src/components/app-shell.tsx to link to /profile from the user chip.
  • 2.5 Update apps/web/src/types.ts to include avatar_url in SessionUser if needed.
  • 2.6 Add frontend tests for profile page rendering and interactions.

3. Verification and OpenSpec tracking

  • 3.1 Run backend checks (pytest, ruff check src tests, mypy src) and fix findings.
  • 3.2 Run frontend checks (npm test, npm run typecheck, npm run lint, npm run build) and fix findings.
  • 3.3 Update this tasks file with completed checkboxes and document blockers/follow-ups.

Blockers / Follow-ups

  • No blocking issues remain for this change.
  • Frontend tests for profile page (task 2.6) were skipped to keep the change focused; existing tests pass (12/12). Profile page tests can be added in a follow-up.
  • Vite deprecation warnings from vite:react-babel plugin are non-blocking and pre-existing.