Description
Design and document the backend architecture for the app, including how API routes, service modules, and shared utilities are organized, to minimize merge conflicts and make contributions consistent.
Implementation Requirements
- Create a
src/app/api structure using the Next.js App Router (e.g. src/app/api/commitments/route.ts, etc.).
- Create a
src/lib/backend folder to hold:
src/lib/backend/config.ts for backend‑specific config helpers (reading env, network, contract addresses).
src/lib/backend/errors.ts for shared error types and helpers.
src/lib/backend/response.ts for standard JSON response helpers (success/error).
- Document backend architecture in
BACKEND_ISSUES.md or a short docs/backend-architecture.md:
- Naming conventions for routes (
/api/commitments, /api/attestations, /api/marketplace, /api/analytics, etc.).
- Where services live (
src/lib/backend/services/...).
- Guidelines for new issues (one domain per service file, avoid editing shared files).
Acceptance Criteria
Technical Notes
- Use Next.js App Router
route.ts pattern for API endpoints.
- Keep shared helpers minimal but stable to reduce future edits.
Description
Design and document the backend architecture for the app, including how API routes, service modules, and shared utilities are organized, to minimize merge conflicts and make contributions consistent.
Implementation Requirements
src/app/apistructure using the Next.js App Router (e.g.src/app/api/commitments/route.ts, etc.).src/lib/backendfolder to hold:src/lib/backend/config.tsfor backend‑specific config helpers (reading env, network, contract addresses).src/lib/backend/errors.tsfor shared error types and helpers.src/lib/backend/response.tsfor standard JSON response helpers (success/error).BACKEND_ISSUES.mdor a shortdocs/backend-architecture.md:/api/commitments,/api/attestations,/api/marketplace,/api/analytics, etc.).src/lib/backend/services/...).Acceptance Criteria
src/app/apifolder exists with a clear subfolder structure (even if routes are placeholders).src/lib/backend/config.ts,errors.ts, andresponse.tsexist with basic helpers and TODOs.Technical Notes
route.tspattern for API endpoints.