Clear primary action and an optional example
Implementation handoff
Frontend boundaries that are ready for a Node.js backend.
The UI never calls fetch directly. Typed services isolate transport, while the assessment provider owns only client journey state.
01 · Architecture
Responsibility by layer
| Layer | Responsibility | Location |
|---|---|---|
| Routes | Page metadata and composition | frontend/src/app |
| Components | Accessible presentation and interaction | frontend/src/components |
| Provider | Journey state persisted to session storage | components/providers |
| Services | API / mock switching and endpoint calls | frontend/src/lib/services |
| Types | Shared request and response contracts | frontend/src/types |
02 · API contract
Expected REST integration points
| Method | Path | Responsibility |
|---|---|---|
| POST | /api/v1/opportunities/analyze | Problem input → workflow inference |
| POST | /api/v1/opportunities/:id | Evidence + inference → opportunity result |
| POST | /api/v1/leads | Purpose-limited lead submission |
| POST | /api/v1/opportunities/decision-brief | Queue the requested management brief |
NEXT_PUBLIC_API_BASE_URL=https://api.example.com
# Empty = use isolated, labelled local mocks03 · UI states
Production behavior is designed in
Inline error with the user’s text preserved
Disabled submission and explicit progress copy
Retryable message without clearing assessment state
Clearly labelled illustrative output
Confirmation, architect contact and close action
04 · Node.js integration
Swap transport, keep the product UI.
- 01
Implement DTOs that match the interfaces in
frontend/src/types. - 02
Return the same response shapes from the four documented endpoints.
- 03
Set
NEXT_PUBLIC_API_BASE_URL; the service layer automatically stops using mocks. - 04
Add authentication, retention and rate-limiting policies at the API boundary when required.