# ridhigolchha/inner-circle architecture

> Architecture diagram of the GitHub repository ridhigolchha/inner-circle, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ridhigolchha/inner-circle
- Repository: https://github.com/ridhigolchha/inner-circle

## Overview

Inner Circle is a mental-wellbeing app for personal check-ins, self-guided support, assessments, and connections to professional or community resources. A user enters through registration, then the client routes them into wellbeing features; browser state supports personal data, while API-backed features are handled by the server. The server also provides authentication, chat, check-in and risk analysis, forums, appointments, and resources. The excerpts support several key calls, but many feature pages and server routes were not sampled, so their internal links are omitted rather than inferred.

Main entry points: [`inner-circle/client/src/App.jsx`](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/App.jsx) (Route shell), [`inner-circle/server/src/app.ts`](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/app.ts) (API application), [`inner-circle/server/src/modules/store.ts`](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/modules/store.ts) (Domain store), [`inner-circle/server/src/routes/checkins.routes.ts`](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/routes/checkins.routes.ts) (Check-in route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app["Route shell<br/>[App.jsx]"]
  node_context["App state<br/>[AppContext.jsx]"]
  node_storage[("Browser storage<br/>[storage.js]")]
  node_register["Registration<br/>[Register.jsx]"]
  node_home["Home<br/>[Home.jsx]"]
  node_settings["Settings<br/>[Settings.jsx]"]
end

subgraph group_wellbeing["Self-guided wellbeing"]
  node_mood["Mood journey<br/>[MoodJourney.jsx]"]
  node_assessments["Assessments<br/>[Assessments.jsx]"]
  node_assessmentrun["Assessment runner"]
  node_assessmentresult["Assessment results"]
  node_companion["Companion chat<br/>[Companion.jsx]"]
  node_breathe["Breathing exercises<br/>[Breathe.jsx]"]
  node_play["Relaxation games<br/>[PlayRelax.jsx]"]
  node_puzzles["Puzzles<br/>[Puzzles.jsx]"]
  node_professional["Professional support<br/>[Professional.jsx]"]
  node_insights["Support insights"]
end

subgraph group_server["API and safety"]
  node_api["API application<br/>[app.ts]"]
  node_chatroute["Chat route<br/>[chat.routes.ts]"]
  node_pipeline["Chat pipeline<br/>[chatPipeline.ts]"]
  node_llm["LLM provider<br/>[llm.ts]"]
  node_checkins["Check-in route<br/>[checkins.routes.ts]"]
  node_risk["Risk route<br/>[risk.routes.ts]"]
  node_fuzzy["Fuzzy assessment<br/>[engine.ts]"]
  node_sentiment["Sentiment analysis<br/>[sentiment.ts]"]
  node_forum["Community forum<br/>[forum.routes.ts]"]
  node_appointments["Appointments"]
  node_resources["Support resources"]
end

subgraph group_domain["Accounts and domain data"]
  node_authroutes["Authentication routes<br/>[routes.ts]"]
  node_auth["Token middleware<br/>[auth.ts]"]
  node_authstore[("Account store<br/>[store.ts]")]
  node_domainstore[("Domain store<br/>[store.ts]")]
  node_persistence["Persistence sync"]
  node_seed["Demo data seed<br/>[demo.ts]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"routes"| node_register
node_app -->|"routes"| node_home
node_app -->|"routes"| node_mood
node_app -->|"routes"| node_assessments
node_app -->|"routes"| node_assessmentrun
node_app -->|"routes"| node_assessmentresult
node_app -->|"routes"| node_companion
node_app -->|"routes"| node_breathe
node_app -->|"routes"| node_play
node_app -->|"routes"| node_puzzles
node_app -->|"routes"| node_professional
node_app -->|"routes"| node_insights
node_app -->|"routes"| node_settings
node_context -->|"reads/writes"| node_storage
node_app -->|"checks profile"| node_context
node_user -.->|"API requests"| node_api
node_api -->|"mounts"| node_authroutes
node_api -->|"mounts"| node_chatroute
node_api -->|"mounts"| node_checkins
node_api -->|"mounts"| node_risk
node_api -->|"mounts"| node_forum
node_api -->|"mounts"| node_appointments
node_api -->|"mounts"| node_resources
node_authroutes -->|"uses"| node_auth
node_authroutes -->|"reads/writes"| node_authstore
node_auth -->|"looks up user"| node_authstore
node_chatroute -->|"calls"| node_pipeline
node_pipeline -->|"tries provider"| node_llm
node_checkins -->|"evaluates"| node_fuzzy
node_checkins -->|"analyzes"| node_sentiment
node_risk -->|"evaluates"| node_fuzzy
node_forum -->|"checks crisis"| node_pipeline
node_chatroute -->|"reads/writes"| node_domainstore
node_checkins -->|"reads/writes"| node_domainstore
node_risk -->|"reads/writes"| node_domainstore
node_forum -->|"reads/writes"| node_domainstore
node_appointments -->|"reads/writes"| node_domainstore
node_api -->|"hydrates/persists"| node_persistence
node_api -->|"exports state"| node_domainstore
node_api -->|"seeds data"| node_seed

click node_app "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/App.jsx"
click node_context "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/context/AppContext.jsx"
click node_storage "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/lib/storage.js"
click node_register "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Register.jsx"
click node_home "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Home.jsx"
click node_mood "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/MoodJourney.jsx"
click node_assessments "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Assessments.jsx"
click node_assessmentrun "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/AssessmentRunner.jsx"
click node_assessmentresult "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/AssessmentResult.jsx"
click node_companion "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Companion.jsx"
click node_breathe "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Breathe.jsx"
click node_play "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/PlayRelax.jsx"
click node_puzzles "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Puzzles.jsx"
click node_professional "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Professional.jsx"
click node_insights "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/SupportInsights.jsx"
click node_settings "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Settings.jsx"
click node_api "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/app.ts"
click node_authroutes "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/modules/auth/routes.ts"
click node_auth "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/middleware/auth.ts"
click node_authstore "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/modules/auth/store.ts"
click node_chatroute "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/routes/chat.routes.ts"
click node_pipeline "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/ai/chatPipeline.ts"
click node_llm "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/ai/providers/llm.ts"
click node_checkins "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/routes/checkins.routes.ts"
click node_risk "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/routes/risk.routes.ts"
click node_fuzzy "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/fuzzy/engine.ts"
click node_sentiment "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/nlp/sentiment.ts"
click node_forum "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/routes/forum.routes.ts"
click node_appointments "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/routes/appointments.routes.ts"
click node_resources "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/routes/resources.routes.ts"
click node_domainstore "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/modules/store.ts"
click node_persistence "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/modules/domainPersistence.ts"
click node_seed "https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/seed/demo.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_context,node_storage,node_register,node_home,node_settings,node_user toneBlue
class node_mood,node_assessments,node_assessmentrun,node_assessmentresult,node_companion,node_breathe,node_play,node_puzzles,node_professional,node_insights toneAmber
class node_api,node_chatroute,node_pipeline,node_llm,node_checkins,node_risk,node_fuzzy,node_sentiment,node_forum,node_appointments,node_resources toneMint
class node_authroutes,node_auth,node_authstore,node_domainstore,node_persistence,node_seed toneRose
```

## Components

### Client experience

- [Route shell](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/App.jsx): `inner-circle/client/src/App.jsx`
- [App state](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/context/AppContext.jsx): `inner-circle/client/src/context/AppContext.jsx`
- [Browser storage](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/lib/storage.js): `inner-circle/client/src/lib/storage.js`
- [Registration](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Register.jsx): `inner-circle/client/src/pages/Register.jsx`
- [Home](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Home.jsx): `inner-circle/client/src/pages/Home.jsx`
- [Settings](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Settings.jsx): `inner-circle/client/src/pages/Settings.jsx`

### Self-guided wellbeing

- [Mood journey](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/MoodJourney.jsx): `inner-circle/client/src/pages/MoodJourney.jsx`
- [Assessments](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Assessments.jsx): `inner-circle/client/src/pages/Assessments.jsx`
- [Assessment runner](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/AssessmentRunner.jsx): `inner-circle/client/src/pages/AssessmentRunner.jsx`
- [Assessment results](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/AssessmentResult.jsx): `inner-circle/client/src/pages/AssessmentResult.jsx`
- [Companion chat](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Companion.jsx): `inner-circle/client/src/pages/Companion.jsx`
- [Breathing exercises](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Breathe.jsx): `inner-circle/client/src/pages/Breathe.jsx`
- [Relaxation games](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/PlayRelax.jsx): `inner-circle/client/src/pages/PlayRelax.jsx`
- [Puzzles](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Puzzles.jsx): `inner-circle/client/src/pages/Puzzles.jsx`
- [Professional support](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/Professional.jsx): `inner-circle/client/src/pages/Professional.jsx`
- [Support insights](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/client/src/pages/SupportInsights.jsx): `inner-circle/client/src/pages/SupportInsights.jsx`

### API and safety

- [API application](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/app.ts): `inner-circle/server/src/app.ts`
- [Chat route](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/routes/chat.routes.ts): `inner-circle/server/src/routes/chat.routes.ts`
- [Chat pipeline](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/ai/chatPipeline.ts): `inner-circle/server/src/ai/chatPipeline.ts`
- [LLM provider](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/ai/providers/llm.ts): `inner-circle/server/src/ai/providers/llm.ts`
- [Check-in route](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/routes/checkins.routes.ts): `inner-circle/server/src/routes/checkins.routes.ts`
- [Risk route](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/routes/risk.routes.ts): `inner-circle/server/src/routes/risk.routes.ts`
- [Fuzzy assessment](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/fuzzy/engine.ts): `inner-circle/server/src/fuzzy/engine.ts`
- [Sentiment analysis](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/nlp/sentiment.ts): `inner-circle/server/src/nlp/sentiment.ts`
- [Community forum](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/routes/forum.routes.ts): `inner-circle/server/src/routes/forum.routes.ts`
- [Appointments](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/routes/appointments.routes.ts): `inner-circle/server/src/routes/appointments.routes.ts`
- [Support resources](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/routes/resources.routes.ts): `inner-circle/server/src/routes/resources.routes.ts`

### Accounts and domain data

- [Authentication routes](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/modules/auth/routes.ts): `inner-circle/server/src/modules/auth/routes.ts`
- [Token middleware](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/middleware/auth.ts): `inner-circle/server/src/middleware/auth.ts`
- [Account store](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/modules/auth/store.ts): `inner-circle/server/src/modules/auth/store.ts`
- [Domain store](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/modules/store.ts): `inner-circle/server/src/modules/store.ts`
- [Persistence sync](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/modules/domainPersistence.ts): `inner-circle/server/src/modules/domainPersistence.ts`
- [Demo data seed](https://github.com/ridhigolchha/inner-circle/blob/main/inner-circle/server/src/seed/demo.ts): `inner-circle/server/src/seed/demo.ts`

### Other components

- **User**

## Connections

- User → Route shell: uses (evidence: `inner-circle/client/src/App.jsx`)
- Route shell → Registration: routes (evidence: `inner-circle/client/src/App.jsx`)
- Route shell → Home: routes (evidence: `inner-circle/client/src/App.jsx`)
- Route shell → Mood journey: routes (evidence: `inner-circle/client/src/App.jsx`)
- Route shell → Assessments: routes (evidence: `inner-circle/client/src/App.jsx`)
- Route shell → Assessment runner: routes (evidence: `inner-circle/client/src/App.jsx`)
- Route shell → Assessment results: routes (evidence: `inner-circle/client/src/App.jsx`)
- Route shell → Companion chat: routes (evidence: `inner-circle/client/src/App.jsx`)
- Route shell → Breathing exercises: routes (evidence: `inner-circle/client/src/App.jsx`)
- Route shell → Relaxation games: routes (evidence: `inner-circle/client/src/App.jsx`)
- Route shell → Puzzles: routes (evidence: `inner-circle/client/src/App.jsx`)
- Route shell → Professional support: routes (evidence: `inner-circle/client/src/App.jsx`)
- Route shell → Support insights: routes (evidence: `inner-circle/client/src/App.jsx`)
- Route shell → Settings: routes (evidence: `inner-circle/client/src/App.jsx`)
- App state → Browser storage: reads/writes (evidence: `inner-circle/client/src/context/AppContext.jsx`)
- Route shell → App state: checks profile (evidence: `inner-circle/client/src/App.jsx`)
- User → API application: API requests
- API application → Authentication routes: mounts (evidence: `inner-circle/server/src/app.ts`)
- API application → Chat route: mounts (evidence: `inner-circle/server/src/app.ts`)
- API application → Check-in route: mounts (evidence: `inner-circle/server/src/app.ts`)
- API application → Risk route: mounts (evidence: `inner-circle/server/src/app.ts`)
- API application → Community forum: mounts (evidence: `inner-circle/server/src/app.ts`)
- API application → Appointments: mounts (evidence: `inner-circle/server/src/app.ts`)
- API application → Support resources: mounts (evidence: `inner-circle/server/src/app.ts`)
- Authentication routes → Token middleware: uses (evidence: `inner-circle/server/src/modules/auth/routes.ts`)
- Authentication routes → Account store: reads/writes (evidence: `inner-circle/server/src/modules/auth/routes.ts`)
- Token middleware → Account store: looks up user (evidence: `inner-circle/server/src/middleware/auth.ts`)
- Chat route → Chat pipeline: calls (evidence: `inner-circle/server/src/routes/chat.routes.ts`)
- Chat pipeline → LLM provider: tries provider (evidence: `inner-circle/server/src/ai/chatPipeline.ts`)
- Check-in route → Fuzzy assessment: evaluates (evidence: `inner-circle/server/src/routes/checkins.routes.ts`)
- Check-in route → Sentiment analysis: analyzes (evidence: `inner-circle/server/src/routes/checkins.routes.ts`)
- Risk route → Fuzzy assessment: evaluates (evidence: `inner-circle/server/src/routes/risk.routes.ts`)
- Community forum → Chat pipeline: checks crisis (evidence: `inner-circle/server/src/routes/forum.routes.ts`)
- Chat route → Domain store: reads/writes (evidence: `inner-circle/server/src/routes/chat.routes.ts`)
- Check-in route → Domain store: reads/writes (evidence: `inner-circle/server/src/routes/checkins.routes.ts`)
- Risk route → Domain store: reads/writes (evidence: `inner-circle/server/src/routes/risk.routes.ts`)
- Community forum → Domain store: reads/writes (evidence: `inner-circle/server/src/routes/forum.routes.ts`)
- Appointments → Domain store: reads/writes (evidence: `inner-circle/server/src/routes/appointments.routes.ts`)
- API application → Persistence sync: hydrates/persists (evidence: `inner-circle/server/src/app.ts`)
- API application → Domain store: exports state (evidence: `inner-circle/server/src/app.ts`)
- API application → Demo data seed: seeds data (evidence: `inner-circle/server/src/app.ts`)
