# owais265/janmarg architecture

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

- Interactive diagram: https://gitdiagram.com/owais265/janmarg
- Repository: https://github.com/owais265/janmarg

## Overview

JANMARG is a mobile-first scholarship guidance and readiness app, not an application-submission or government-decision system. The main student journey is sign-in, optional guide and consent, a unified view across five schemes, document preparation and verify-once reuse, then payment-status and deficiency tracking; JAGO provides conversational guidance. The README documents the practice-data boundary and locker-first retrieval. Source excerpts and index support selected component relationships; unsampled details are represented conservatively, and documented but unverified flows are marked dashed.

Main entry points: [`src/components/beta/pages.tsx`](https://github.com/owais265/janmarg/blob/main/src/components/beta/pages.tsx) (Journey pages), [`src/components/beta/shell.tsx`](https://github.com/owais265/janmarg/blob/main/src/components/beta/shell.tsx) (Student shell), [`src/components/beta/module-pages.tsx`](https://github.com/owais265/janmarg/blob/main/src/components/beta/module-pages.tsx) (Scholarship dashboard), [`src/lib/janmarg/jago-pipeline.ts`](https://github.com/owais265/janmarg/blob/main/src/lib/janmarg/jago-pipeline.ts) (Hybrid retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_journey["Student journey"]
  node_student_shell["Student shell<br/>[shell.tsx]"]
  node_student_pages["Journey pages<br/>[pages.tsx]"]
  node_dashboard["Scholarship dashboard<br/>[module-pages.tsx]"]
  node_wallet["Practice document locker<br/>[locker.ts]"]
  node_journey_state[("Journey and chat state<br/>[store.ts]")]
  node_scheme_modules["Scheme and journey modules<br/>[module.ts]"]
  node_connector_data["Connector readiness"]
end

subgraph group_guidance["Guidance and JAGO"]
  node_scheme_content["Five-scheme content<br/>[content.ts]"]
  node_readiness["Readiness assessment<br/>[engine.ts]"]
  node_jago_ui["JAGO chat interface<br/>[jago-panel.tsx]"]
  node_jago_retrieval["Hybrid retrieval<br/>[jago-pipeline.ts]"]
  node_jago_knowledge["Reviewed knowledge<br/>[knowledge.ts]"]
  node_jago_service["JAGO server service<br/>[jago-server.ts]"]
  node_external_model{{"Optional xAI model"}}
end

subgraph group_identity["Identity and data"]
  node_auth["Sign-in and gates"]
  node_practice_store[("Practice data store<br/>[repository.ts]")]
  node_auth_service["Better Auth service<br/>[server.ts]"]
end

subgraph group_platform["App platform"]
  node_auth_route["Auth API route<br/>[$.ts]"]
  node_router["Route registry<br/>[routeTree.gen.ts]"]
  node_preview_bridge["Preview host bridge"]
end

node_student(("Student"))

node_student -.->|"signs in"| node_auth
node_auth -->|"gates access"| node_student_pages
node_student_pages -->|"renders"| node_student_shell
node_student_pages -->|"renders"| node_dashboard
node_student_shell -->|"reads state"| node_journey_state
node_student_shell -->|"counts alerts"| node_scheme_modules
node_dashboard -->|"shows tracks"| node_journey_state
node_dashboard -.->|"presents schemes"| node_scheme_content
node_student_pages -->|"assesses readiness"| node_readiness
node_readiness -->|"uses scheme rules"| node_scheme_content
node_student_pages -.->|"offers document flows"| node_wallet
node_wallet -->|"stores locker state"| node_journey_state
node_student -.->|"asks questions"| node_jago_ui
node_jago_ui -.->|"requests answers"| node_jago_service
node_jago_service -.->|"retrieves context"| node_jago_retrieval
node_jago_retrieval -->|"retrieves notes"| node_jago_knowledge
node_jago_retrieval -.->|"uses practice data"| node_practice_store
node_jago_service -.->|"optionally composes"| node_external_model
node_auth -.->|"uses session client"| node_auth_service
node_auth_route -->|"routes requests"| node_auth_service
node_router -->|"registers route"| node_auth_route
node_router -->|"provides route tree"| node_preview_bridge

click node_auth "https://github.com/owais265/janmarg/tree/main/src/lib/auth"
click node_student_shell "https://github.com/owais265/janmarg/blob/main/src/components/beta/shell.tsx"
click node_student_pages "https://github.com/owais265/janmarg/blob/main/src/components/beta/pages.tsx"
click node_dashboard "https://github.com/owais265/janmarg/blob/main/src/components/beta/module-pages.tsx"
click node_scheme_content "https://github.com/owais265/janmarg/blob/main/src/lib/beta/content.ts"
click node_readiness "https://github.com/owais265/janmarg/blob/main/src/lib/beta/engine.ts"
click node_wallet "https://github.com/owais265/janmarg/blob/main/src/lib/beta/locker.ts"
click node_journey_state "https://github.com/owais265/janmarg/blob/main/src/lib/beta/store.ts"
click node_scheme_modules "https://github.com/owais265/janmarg/blob/main/src/lib/beta/module.ts"
click node_connector_data "https://github.com/owais265/janmarg/tree/main/src/lib/app-data"
click node_jago_ui "https://github.com/owais265/janmarg/blob/main/src/components/beta/jago-panel.tsx"
click node_jago_retrieval "https://github.com/owais265/janmarg/blob/main/src/lib/janmarg/jago-pipeline.ts"
click node_jago_knowledge "https://github.com/owais265/janmarg/blob/main/src/lib/janmarg/knowledge.ts"
click node_jago_service "https://github.com/owais265/janmarg/blob/main/src/lib/janmarg/jago-server.ts"
click node_practice_store "https://github.com/owais265/janmarg/blob/main/src/lib/janmarg/repository.ts"
click node_auth_service "https://github.com/owais265/janmarg/blob/main/src/lib/auth/server.ts"
click node_auth_route "https://github.com/owais265/janmarg/blob/main/src/routes/api/auth/%24.ts"
click node_router "https://github.com/owais265/janmarg/blob/main/src/routeTree.gen.ts"
click node_preview_bridge "https://github.com/owais265/janmarg/blob/main/src/lib/preview-host-bridge.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_student_shell,node_student_pages,node_dashboard,node_wallet,node_journey_state,node_scheme_modules,node_connector_data toneBlue
class node_scheme_content,node_readiness,node_jago_ui,node_jago_retrieval,node_jago_knowledge,node_jago_service,node_external_model toneAmber
class node_auth,node_practice_store,node_auth_service toneMint
class node_auth_route,node_router,node_preview_bridge toneRose
class node_student toneIndigo
```

## Components

### Student journey

- [Student shell](https://github.com/owais265/janmarg/blob/main/src/components/beta/shell.tsx): `src/components/beta/shell.tsx`
- [Journey pages](https://github.com/owais265/janmarg/blob/main/src/components/beta/pages.tsx): `src/components/beta/pages.tsx`
- [Scholarship dashboard](https://github.com/owais265/janmarg/blob/main/src/components/beta/module-pages.tsx): `src/components/beta/module-pages.tsx`
- [Practice document locker](https://github.com/owais265/janmarg/blob/main/src/lib/beta/locker.ts): `src/lib/beta/locker.ts`
- [Journey and chat state](https://github.com/owais265/janmarg/blob/main/src/lib/beta/store.ts): `src/lib/beta/store.ts`
- [Scheme and journey modules](https://github.com/owais265/janmarg/blob/main/src/lib/beta/module.ts): `src/lib/beta/module.ts`
- [Connector readiness](https://github.com/owais265/janmarg/tree/main/src/lib/app-data): `src/lib/app-data`

### Guidance and JAGO

- [Five-scheme content](https://github.com/owais265/janmarg/blob/main/src/lib/beta/content.ts): `src/lib/beta/content.ts`
- [Readiness assessment](https://github.com/owais265/janmarg/blob/main/src/lib/beta/engine.ts): `src/lib/beta/engine.ts`
- [JAGO chat interface](https://github.com/owais265/janmarg/blob/main/src/components/beta/jago-panel.tsx): `src/components/beta/jago-panel.tsx`
- [Hybrid retrieval](https://github.com/owais265/janmarg/blob/main/src/lib/janmarg/jago-pipeline.ts): `src/lib/janmarg/jago-pipeline.ts`
- [Reviewed knowledge](https://github.com/owais265/janmarg/blob/main/src/lib/janmarg/knowledge.ts): `src/lib/janmarg/knowledge.ts`
- [JAGO server service](https://github.com/owais265/janmarg/blob/main/src/lib/janmarg/jago-server.ts): `src/lib/janmarg/jago-server.ts`
- **Optional xAI model**

### Identity and data

- [Sign-in and gates](https://github.com/owais265/janmarg/tree/main/src/lib/auth): `src/lib/auth`
- [Practice data store](https://github.com/owais265/janmarg/blob/main/src/lib/janmarg/repository.ts): `src/lib/janmarg/repository.ts`
- [Better Auth service](https://github.com/owais265/janmarg/blob/main/src/lib/auth/server.ts): `src/lib/auth/server.ts`

### App platform

- [Auth API route](https://github.com/owais265/janmarg/blob/main/src/routes/api/auth/%24.ts): `src/routes/api/auth/$.ts`
- [Route registry](https://github.com/owais265/janmarg/blob/main/src/routeTree.gen.ts): `src/routeTree.gen.ts`
- [Preview host bridge](https://github.com/owais265/janmarg/blob/main/src/lib/preview-host-bridge.ts): `src/lib/preview-host-bridge.ts`

### Other components

- **Student**

## Connections

- Student → Sign-in and gates: signs in
- Sign-in and gates → Journey pages: gates access (evidence: `src/components/beta/pages.tsx`)
- Journey pages → Student shell: renders (evidence: `src/components/beta/pages.tsx`)
- Journey pages → Scholarship dashboard: renders (evidence: `src/components/beta/pages.tsx`)
- Student shell → Journey and chat state: reads state (evidence: `src/components/beta/shell.tsx`)
- Student shell → Scheme and journey modules: counts alerts (evidence: `src/components/beta/shell.tsx`)
- Scholarship dashboard → Journey and chat state: shows tracks (evidence: `src/components/beta/module-pages.tsx`)
- Scholarship dashboard → Five-scheme content: presents schemes (evidence: `src/components/beta/module-pages.tsx`)
- Journey pages → Readiness assessment: assesses readiness (evidence: `src/components/beta/pages.tsx`)
- Readiness assessment → Five-scheme content: uses scheme rules (evidence: `src/lib/beta/engine.ts`)
- Journey pages → Practice document locker: offers document flows
- Practice document locker → Journey and chat state: stores locker state (evidence: `src/lib/beta/store.ts`)
- Student → JAGO chat interface: asks questions
- JAGO chat interface → JAGO server service: requests answers
- JAGO server service → Hybrid retrieval: retrieves context
- Hybrid retrieval → Reviewed knowledge: retrieves notes (evidence: `src/lib/janmarg/jago-pipeline.ts`)
- Hybrid retrieval → Practice data store: uses practice data
- JAGO server service → Optional xAI model: optionally composes
- Sign-in and gates → Better Auth service: uses session client (evidence: `src/lib/auth/server.ts`)
- Auth API route → Better Auth service: routes requests (evidence: `src/routes/api/auth/$.ts`)
- Route registry → Auth API route: registers route (evidence: `src/routeTree.gen.ts`)
- Route registry → Preview host bridge: provides route tree
