# sakith-work/ragv3.0 architecture

> Architecture diagram of the GitHub repository sakith-work/ragv3.0, 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/sakith-work/ragv3.0
- Repository: https://github.com/sakith-work/ragv3.0

## Overview

Interview RAG serves admins building role-specific question banks and candidates progressing from resume analysis through a personalized mock interview and study planning. The UI routes users by role, calls authenticated API endpoints for AI workflows, and uses Firebase for identity and application records. The README documents ATS extraction, vector-based question planning, live interview inference with provider fallback, and report cards. Some server implementation details were not excerpted, so documented capabilities are shown without speculative internal call chains.

Main entry points: [`src/App.tsx`](https://github.com/sakith-work/ragv3.0/blob/main/src/App.tsx) (Role-based routing), [`src/pages/CandidateDashboard.tsx`](https://github.com/sakith-work/ragv3.0/blob/main/src/pages/CandidateDashboard.tsx) (Candidate workspace), [`server.ts`](https://github.com/sakith-work/ragv3.0/blob/main/server.ts) (API runtime), [`src/lib/api.ts`](https://github.com/sakith-work/ragv3.0/blob/main/src/lib/api.ts) (Authenticated API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["Role-based routing<br/>[App.tsx]"]
  node_auth_ui["Sign-in and verification<br/>[AuthPage.tsx]"]
  node_auth_context["Identity and profile<br/>[AuthContext.tsx]"]
  node_role_setup["Role setup<br/>[RoleSetupModal.tsx]"]
end

subgraph group_admin["Role and RAG setup"]
  node_admin_dashboard["Role and bank manager<br/>[AdminDashboard.tsx]"]
  node_role_seeding["Default roles<br/>[seedRoles.ts]"]
end

subgraph group_candidate["Candidate workflows"]
  node_candidate_dashboard["Candidate workspace"]
  node_resume_uploader["Resume upload<br/>[ResumeUploader.tsx]"]
  node_ats["Resume ATS analysis<br/>[ai.ts]"]
  node_plan["Interview question plan<br/>[ai.ts]"]
  node_session["Live interview session"]
  node_report["Interview evaluation<br/>[ai.ts]"]
  node_study["Gap study plan<br/>[StudyPlanPage.tsx]"]
end

subgraph group_platform["Services and persistence"]
  node_api["Authenticated API client<br/>[api.ts]"]
  node_server["API runtime<br/>[server.ts]"]
  node_server_auth["Request authentication<br/>[auth.ts]"]
  node_firebase_client["Firebase client<br/>[firebase.ts]"]
  node_firestore[("Cloud Firestore")]
  node_firebase_auth[("Firebase Authentication")]
end

node_candidate_actor(("Candidate"))
node_admin_actor(("Administrator"))
node_gemini{{"Gemini API"}}
node_groq{{"Groq API"}}

node_candidate_actor -->|"signs in"| node_auth_ui
node_admin_actor -->|"signs in"| node_auth_ui
node_auth_ui -->|"uses auth"| node_auth_context
node_app -->|"checks identity"| node_auth_context
node_app -->|"routes admins"| node_admin_dashboard
node_app -->|"routes candidates"| node_candidate_dashboard
node_app -->|"routes sessions"| node_session
node_app -->|"routes study plans"| node_study
node_app -->|"renders setup"| node_role_setup
node_auth_context -->|"uses identity services"| node_firebase_client
node_firebase_client -->|"initializes"| node_firebase_auth
node_firebase_client -->|"initializes"| node_firestore
node_auth_context -->|"reads profile"| node_firestore
node_admin_dashboard -->|"manages roles and questions"| node_firestore
node_admin_dashboard -->|"uses defaults"| node_role_seeding
node_role_seeding -->|"seeds roles"| node_firestore
node_candidate_actor -->|"selects role"| node_candidate_dashboard
node_candidate_dashboard -->|"uploads resume"| node_resume_uploader
node_resume_uploader -->|"requests analysis"| node_api
node_api -->|"sends API requests"| node_server
node_server -->|"authenticates requests"| node_server_auth
node_server -.->|"handles AI workflows"| node_ats
node_ats -.->|"parses and scores"| node_gemini
node_candidate_dashboard -->|"stores resume record"| node_firestore
node_candidate_dashboard -.->|"requests interview plan"| node_api
node_server -.->|"assembles questions"| node_plan
node_plan -.->|"retrieves question vectors"| node_firestore
node_session -->|"requests interview turns"| node_api
node_session -->|"updates session"| node_firestore
node_server -.->|"evaluates interview"| node_report
node_report -.->|"generates evaluation"| node_groq
node_report -.->|"falls back"| node_gemini
node_candidate_dashboard -.->|"opens study planning"| node_study
node_study -.->|"requests plan"| node_api

click node_app "https://github.com/sakith-work/ragv3.0/blob/main/src/App.tsx"
click node_auth_ui "https://github.com/sakith-work/ragv3.0/blob/main/src/pages/AuthPage.tsx"
click node_auth_context "https://github.com/sakith-work/ragv3.0/blob/main/src/contexts/AuthContext.tsx"
click node_role_setup "https://github.com/sakith-work/ragv3.0/blob/main/src/components/RoleSetupModal.tsx"
click node_admin_dashboard "https://github.com/sakith-work/ragv3.0/blob/main/src/pages/AdminDashboard.tsx"
click node_role_seeding "https://github.com/sakith-work/ragv3.0/blob/main/src/lib/seedRoles.ts"
click node_candidate_dashboard "https://github.com/sakith-work/ragv3.0/blob/main/src/pages/CandidateDashboard.tsx"
click node_resume_uploader "https://github.com/sakith-work/ragv3.0/blob/main/src/components/ResumeUploader.tsx"
click node_ats "https://github.com/sakith-work/ragv3.0/blob/main/server/ai.ts"
click node_plan "https://github.com/sakith-work/ragv3.0/blob/main/server/ai.ts"
click node_session "https://github.com/sakith-work/ragv3.0/blob/main/src/pages/InterviewSessionPage.tsx"
click node_report "https://github.com/sakith-work/ragv3.0/blob/main/server/ai.ts"
click node_study "https://github.com/sakith-work/ragv3.0/blob/main/src/pages/StudyPlanPage.tsx"
click node_api "https://github.com/sakith-work/ragv3.0/blob/main/src/lib/api.ts"
click node_server "https://github.com/sakith-work/ragv3.0/blob/main/server.ts"
click node_server_auth "https://github.com/sakith-work/ragv3.0/blob/main/server/auth.ts"
click node_firebase_client "https://github.com/sakith-work/ragv3.0/blob/main/src/lib/firebase.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_auth_ui,node_auth_context,node_role_setup toneBlue
class node_admin_dashboard,node_role_seeding toneAmber
class node_candidate_dashboard,node_resume_uploader,node_ats,node_plan,node_session,node_report,node_study,node_gemini,node_groq toneMint
class node_api,node_server,node_server_auth,node_firebase_client,node_firestore,node_firebase_auth toneRose
class node_candidate_actor,node_admin_actor toneIndigo
```

## Components

### Web experience

- [Role-based routing](https://github.com/sakith-work/ragv3.0/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in and verification](https://github.com/sakith-work/ragv3.0/blob/main/src/pages/AuthPage.tsx): `src/pages/AuthPage.tsx`
- [Identity and profile](https://github.com/sakith-work/ragv3.0/blob/main/src/contexts/AuthContext.tsx): `src/contexts/AuthContext.tsx`
- [Role setup](https://github.com/sakith-work/ragv3.0/blob/main/src/components/RoleSetupModal.tsx): `src/components/RoleSetupModal.tsx`

### Role and RAG setup

- [Role and bank manager](https://github.com/sakith-work/ragv3.0/blob/main/src/pages/AdminDashboard.tsx): `src/pages/AdminDashboard.tsx`
- [Default roles](https://github.com/sakith-work/ragv3.0/blob/main/src/lib/seedRoles.ts): `src/lib/seedRoles.ts`

### Candidate workflows

- [Candidate workspace](https://github.com/sakith-work/ragv3.0/blob/main/src/pages/CandidateDashboard.tsx): `src/pages/CandidateDashboard.tsx`
- [Resume upload](https://github.com/sakith-work/ragv3.0/blob/main/src/components/ResumeUploader.tsx): `src/components/ResumeUploader.tsx`
- [Resume ATS analysis](https://github.com/sakith-work/ragv3.0/blob/main/server/ai.ts): `server/ai.ts`
- [Interview question plan](https://github.com/sakith-work/ragv3.0/blob/main/server/ai.ts): `server/ai.ts`
- [Live interview session](https://github.com/sakith-work/ragv3.0/blob/main/src/pages/InterviewSessionPage.tsx): `src/pages/InterviewSessionPage.tsx`
- [Interview evaluation](https://github.com/sakith-work/ragv3.0/blob/main/server/ai.ts): `server/ai.ts`
- [Gap study plan](https://github.com/sakith-work/ragv3.0/blob/main/src/pages/StudyPlanPage.tsx): `src/pages/StudyPlanPage.tsx`

### Services and persistence

- [Authenticated API client](https://github.com/sakith-work/ragv3.0/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [API runtime](https://github.com/sakith-work/ragv3.0/blob/main/server.ts): `server.ts`
- [Request authentication](https://github.com/sakith-work/ragv3.0/blob/main/server/auth.ts): `server/auth.ts`
- [Firebase client](https://github.com/sakith-work/ragv3.0/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- **Cloud Firestore**
- **Firebase Authentication**

### Other components

- **Candidate**
- **Administrator**
- **Gemini API**
- **Groq API**

## Connections

- Candidate → Sign-in and verification: signs in
- Administrator → Sign-in and verification: signs in
- Sign-in and verification → Identity and profile: uses auth (evidence: `src/pages/AuthPage.tsx`)
- Role-based routing → Identity and profile: checks identity (evidence: `src/App.tsx`)
- Role-based routing → Role and bank manager: routes admins (evidence: `src/App.tsx`)
- Role-based routing → Candidate workspace: routes candidates (evidence: `src/App.tsx`)
- Role-based routing → Live interview session: routes sessions (evidence: `src/App.tsx`)
- Role-based routing → Gap study plan: routes study plans (evidence: `src/App.tsx`)
- Role-based routing → Role setup: renders setup (evidence: `src/App.tsx`)
- Identity and profile → Firebase client: uses identity services (evidence: `src/contexts/AuthContext.tsx`)
- Firebase client → Firebase Authentication: initializes (evidence: `src/lib/firebase.ts`)
- Firebase client → Cloud Firestore: initializes (evidence: `src/lib/firebase.ts`)
- Identity and profile → Cloud Firestore: reads profile (evidence: `src/contexts/AuthContext.tsx`)
- Role and bank manager → Cloud Firestore: manages roles and questions (evidence: `src/pages/AdminDashboard.tsx`)
- Role and bank manager → Default roles: uses defaults (evidence: `src/pages/AdminDashboard.tsx`)
- Default roles → Cloud Firestore: seeds roles (evidence: `src/lib/seedRoles.ts`)
- Candidate → Candidate workspace: selects role (evidence: `README.md`)
- Candidate workspace → Resume upload: uploads resume (evidence: `src/pages/CandidateDashboard.tsx`)
- Resume upload → Authenticated API client: requests analysis (evidence: `src/components/ResumeUploader.tsx`)
- Authenticated API client → API runtime: sends API requests (evidence: `src/lib/api.ts`)
- API runtime → Request authentication: authenticates requests (evidence: `server.ts`)
- API runtime → Resume ATS analysis: handles AI workflows (evidence: `server.ts`)
- Resume ATS analysis → Gemini API: parses and scores (evidence: `README.md`)
- Candidate workspace → Cloud Firestore: stores resume record (evidence: `src/pages/CandidateDashboard.tsx`)
- Candidate workspace → Authenticated API client: requests interview plan (evidence: `src/pages/CandidateDashboard.tsx`)
- API runtime → Interview question plan: assembles questions (evidence: `server.ts`)
- Interview question plan → Cloud Firestore: retrieves question vectors (evidence: `README.md`)
- Live interview session → Authenticated API client: requests interview turns (evidence: `src/pages/InterviewSessionPage.tsx`)
- Live interview session → Cloud Firestore: updates session (evidence: `src/pages/InterviewSessionPage.tsx`)
- API runtime → Interview evaluation: evaluates interview (evidence: `server.ts`)
- Interview evaluation → Groq API: generates evaluation (evidence: `README.md`)
- Interview evaluation → Gemini API: falls back (evidence: `README.md`)
- Candidate workspace → Gap study plan: opens study planning (evidence: `README.md`)
- Gap study plan → Authenticated API client: requests plan (evidence: `src/pages/StudyPlanPage.tsx`)
