3.7 KiB
3.7 KiB
NEXT STEPS
This file is the implementation order from the current scaffold state.
1. Start Here: Lock API contracts first
Create a short API contract document before writing more feature code.
- Define request/response payloads for:
POST /v1/auth/registerPOST /v1/auth/loginPOST /v1/auth/refreshPOST /v1/auth/logoutGET/POST/PATCH/DELETEfor groups, characters, rulesets
- Define shared error schema and status code rules.
- Decide role model now:
- global roles (from
cm_users) - campaign/group roles (service/domain-level)
- global roles (from
Done when:
- All endpoints have stable JSON schema examples.
- Web + symbiote can be implemented against the same contract.
2. Implement Auth Core in campaign-service
Use cm_users as the auth source of truth (no extra auth service needed now).
- Implement registration with
argon2password hashing. - Implement login with password verification.
- Persist refresh sessions in
refresh_sessionstable. - Return JWT access token + refresh token flow.
- Add middleware/helper for auth context extraction.
Done when:
- Register/login/refresh/logout are fully working against Postgres.
content-serviceaccepts tokens issued bycampaign-service.
3. Add migration runner + startup checks
- Add migration execution command/process for both services.
- Ensure services fail fast on invalid DB config.
- Add health/readiness checks that include DB connectivity.
Done when:
- Fresh database can be initialized and migrated with one command path.
- Service startup gives clear errors if DB/env is wrong.
4. Implement content-service ruleset management
- Replace stubbed ruleset list with DB-backed queries.
- Add create/update/deactivate ruleset endpoints.
- Enforce auth + authorization checks.
Done when:
- Rulesets are fully CRUD-capable with audit fields.
- API behaves correctly for authorized vs unauthorized users.
5. Implement campaign-service domain features
- Build group endpoints (create/list/update membership).
- Build character endpoints and ownership rules.
- Add campaign/group role enforcement.
Done when:
- Core campaign management flow works end-to-end.
- Permissions are enforced at API level.
6. Wire web app flows to real APIs
- Replace placeholder UI interactions with real API calls.
- Implement login/logout/session refresh UX.
- Add basic error handling and loading states for all core pages.
Done when:
- User can sign in, manage rulesets, groups, and characters through the web app.
7. Integrate symbiote MVP
- Implement token/bootstrap handoff strategy from campaign backend.
- Add minimal read/use flow needed inside TaleSpire.
- Validate it with real campaign and ruleset data.
Done when:
- Symbiote performs one complete gameplay-relevant flow against live backend data.
8. Testing and CI hardening
- Add integration tests for auth flows and permission checks.
- Add API-level tests for rulesets/groups/characters.
- Keep
pnpm ci:localgreen and mirror same checks in Woodpecker.
Done when:
- Critical flows are covered by automated tests.
- CI failures are actionable and reproducible locally.
9. Kubernetes readiness pass
- Add production env var matrix and secret mapping.
- Add image/tag strategy for first release pinning.
- Add readiness/liveness probes and resource requests/limits.
Done when:
- Services can be deployed to your cluster with the same topology as local dev.
Suggested first implementation chunk (next PR)
- Contract doc for auth + rulesets.
- Full register/login/refresh/logout in
campaign-service. content-servicetoken validation test against real JWT secret.
If you do only one thing first, do auth end-to-end; everything else depends on it.