3.1 KiB
3.1 KiB
Project State Audit - Fiddy
Snapshot date: 2026-02-16
1) Confirmed stack and structure
- Backend: Express API in
backend/withroutes/,controllers/,models/,middleware/,utils/. - Frontend: React + Vite in
frontend/with API wrappers infrontend/src/api, auth/state infrontend/src/context, pages infrontend/src/pages. - DB migrations: canonical folder is
packages/db/migrations.
2) Governance and agentic setup status
- Present and aligned:
PROJECT_INSTRUCTIONS.mdAGENTS.mdDEBUGGING_INSTRUCTIONS.mddocs/DB_MIGRATION_WORKFLOW.mddocs/AGENTIC_CONTRACT_MAP.md
- Commit discipline added in
PROJECT_INSTRUCTIONS.mdsection 12 and being followed with small conventional commits.
3) Current implementation status vs vertical-slice goals
- DB migrate command + schema:
- Implemented: root scripts
db:migrate,db:migrate:status,db:migrate:verify. - Implemented: migration tracking + runbook.
- Implemented: root scripts
- Register/Login/Logout (custom sessions):
- Implemented: DB sessions table migration (
create_sessions_table.sql). - Implemented: session model, HttpOnly cookie set/clear,
/auth/logout, auth middleware fallback to DB session cookie. - Implemented: frontend credentialed API (
withCredentials), logout route call.
- Implemented: DB sessions table migration (
- Protected dashboard page:
- Partially implemented via existing
PrivateRoutetoken gate.
- Partially implemented via existing
- Group create/join + switcher:
- Existing household create/join/switch flow exists but does not yet match all group-policy requirements.
- Entries CRUD:
- Existing list CRUD exists in legacy and multi-household paths.
- Receipt upload/download endpoints:
- Not implemented as dedicated receipt domain/endpoints.
- Settings + Reports:
- Settings page exists; reporting is not fully formalized.
4) Contract gaps and risks
DATABASE_URLis now supported in runtime pool config, but local operator environment still needs this variable configured.- No automated test suite currently exercises the new auth/session behavior; API behavior is mostly validated by static/lint checks.
- Group policy requirements (owner role, join policy states, invite lifecycle constraints, revive semantics) are not fully implemented.
- No explicit audit log persistence layer verified for invite events/request IDs.
- Encoding cleanliness needs ongoing watch; historical mojibake appears in some UI text/log strings.
5) Recommended next implementation order
- Finalize auth session contract:
- Add authenticated session introspection endpoint (
/users/mealready exists) to support cookie-only bootstrapping if token absent. - Update frontend auth bootstrap so protected routes work with DB session cookie as canonical auth.
- Add authenticated session introspection endpoint (
- Add explicit API tests (auth + households/list negative cases):
- unauthorized
- not-a-member
- invalid input
- Implement group-policy requirements incrementally:
- owner role migration + policy enums
- invite policy and immutable settings
- approval-required flow + revive/single-use semantics
- Add dedicated receipt domain endpoints (metadata list vs byte retrieval split) if the product scope requires the receipt contract verbatim.