How parkavi111/nextstep-wellbeing-compass works
NextStep is a small wellbeing-guidance web app. A visitor answers four one-tap questions and may enter optional, in-memory text; the app checks safety first, then selects a suggested step, requests a short explanation, and presents alternatives and helpfulness feedback. A support screen bypasses recommendations when crisis text or specified severe answers are detected. The README documents Claude-generated explanations; sampled code shows the page calling the server function, but its implementation was not excerpted, so that integration is shown as documented rather than verified in source.
Main entry points: index.tsx Questionnaire and results · routeTree.gen.ts Route registry · __root.tsx Root shell · server.ts SSR error handling
Components 18
Guidance experience
- Questionnaire and results
src/routes/index.tsx - Human support screen
src/routes/index.tsx - Alternatives and feedback
src/routes/index.tsx
Recommendation logic
- Safety screening
src/lib/nextstep.ts - Step selection
src/lib/nextstep.ts - Why explanation
src/lib/why.functions.ts
App platform
- Router setup
src/router.tsx - Route registry
src/routeTree.gen.ts - Root shell
src/routes/__root.tsx - SSR error handling
src/server.ts - Error capture
src/lib/error-capture.ts - Error page renderer
src/lib/error-page.ts - Lovable error reporting
src/lib/lovable-error-reporting.ts
UI components
- UI primitives
src/components/ui - Responsive sidebar
src/components/ui/sidebar.tsx - Mobile breakpoint hook
src/hooks/use-mobile.tsx
Other components
- Visitor
- Claude API
Connections 17
- Visitor → Router setup: opens app
- Router setup → Route registry: uses registry
src/router.tsx - Route registry → Root shell: registers root
src/routeTree.gen.ts - Route registry → Questionnaire and results: registers page
src/routeTree.gen.ts - Root shell → Questionnaire and results: renders route
src/routes/__root.tsx - Visitor → Questionnaire and results: answers questions
src/routes/index.tsx - Questionnaire and results → Safety screening: checks support need
src/routes/index.tsx - Questionnaire and results → Human support screen: shows support screen
src/routes/index.tsx - Questionnaire and results → Step selection: selects suggestion
src/routes/index.tsx - Questionnaire and results → Why explanation: requests explanation
src/routes/index.tsx - Why explanation → Claude API: generates explanation
README.md - Questionnaire and results → Alternatives and feedback: shows results
src/routes/index.tsx - Responsive sidebar → Mobile breakpoint hook: checks breakpoint
src/components/ui/sidebar.tsx - Responsive sidebar → UI primitives: renders primitives
src/components/ui/sidebar.tsx - SSR error handling → Error capture: consumes captured error
src/server.ts - SSR error handling → Error page renderer: renders failure page
src/server.ts - Root shell → Lovable error reporting: reports boundary errors
src/routes/__root.tsx