# sarfaraz-r/ai_mock_technical architecture

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

- Interactive diagram: https://gitdiagram.com/sarfaraz-r/ai_mock_technical
- Repository: https://github.com/sarfaraz-r/ai_mock_technical

## Overview

Scribo is a Next.js interview-preparation app. Users sign in, create a mock interview, complete a recorded question flow, and review generated feedback; separate dashboard branches provide timed MCQ assessments, question-bank creation, and subject revision decks. The graph also shows authentication, persistence, and email support. Some feature modules were not excerpted, so their connections are included only where documented in the README or indicated by the source index; unsampled implementation details are not inferred.

Main entry points: [`utils/db.js`](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/utils/db.js) (Neon database), [`app/dashboard/page.jsx`](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/page.jsx) (Workspace), [`app/dashboard/interview/[interviewId]/start/page.jsx`](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/interview/%5BinterviewId%5D/start/page.jsx) (Live interview), [`app/api/auth/google/callback/route.js`](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/api/auth/google/callback/route.js) (Google OAuth callback)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_product["Dashboard and practice"]
  node_dashboard["Workspace<br/>[page.jsx]"]
  node_history["Interview history<br/>[InterviewList.jsx]"]
end

subgraph group_interview["Mock interviews"]
  node_interview_setup["Interview setup"]
  node_gemini["Gemini generation<br/>[GeminiAIModal.js]"]
  node_briefing["Interview briefing<br/>[page.jsx]"]
  node_live_interview["Live interview<br/>[page.jsx]"]
  node_question_view["Question flow"]
  node_recording["Response recording"]
  node_feedback["Interview feedback<br/>[page.jsx]"]
end

subgraph group_learning["Assessment and revision"]
  node_assessment["Timed assessment"]
  node_assessment_bank["Assessment bank<br/>[questionBank.js]"]
  node_question_creation["Question creation<br/>[AddQuestions.jsx]"]
  node_question_history["Question history<br/>[QuestionList.jsx]"]
  node_question_detail["Question set detail<br/>[page.jsx]"]
  node_revision_hub["Revision hub<br/>[page.jsx]"]
  node_revision_deck["Revision deck"]
  node_revision_data["Revision deck data<br/>[revisionDeck.js]"]
end

subgraph group_identity["Identity and sessions"]
  node_auth_form["Sign-in form<br/>[AuthForm.jsx]"]
  node_auth_provider["Auth state<br/>[AuthProvider.jsx]"]
  node_auth_routes["Email auth routes<br/>[route.js]"]
  node_google_start["Google OAuth start<br/>[route.js]"]
  node_google_callback["Google OAuth callback<br/>[route.js]"]
  node_session_service["Session service<br/>[auth.js]"]
  node_jwt["JWT signing<br/>[auth-jwt.js]"]
end

subgraph group_platform["Persistence and support"]
  node_database[("Neon database<br/>[db.js]")]
  node_schema["Application tables<br/>[schema.js]"]
  node_contact["Contact form<br/>[Contect.jsx]"]
  node_email_route["Email API<br/>[route.js]"]
end

node_learner(("Learner"))
node_google(("Google identity"))
node_email_service(("Email delivery"))

node_learner -->|"opens"| node_dashboard
node_dashboard -->|"starts interview"| node_interview_setup
node_interview_setup -->|"generates questions"| node_gemini
node_interview_setup -->|"stores interview"| node_database
node_dashboard -->|"shows history"| node_history
node_history -->|"reads interviews"| node_database
node_learner -->|"opens interview"| node_briefing
node_briefing -->|"loads interview"| node_database
node_briefing -->|"starts session"| node_live_interview
node_live_interview -->|"renders questions"| node_question_view
node_live_interview -->|"records responses"| node_recording
node_live_interview -->|"loads interview"| node_database
node_recording -.->|"stores answers"| node_database
node_learner -->|"reviews results"| node_feedback
node_feedback -->|"loads answers"| node_database
node_dashboard -.->|"starts assessment"| node_assessment
node_assessment -.->|"uses questions"| node_assessment_bank
node_dashboard -->|"creates question bank"| node_question_creation
node_question_creation -.->|"stores questions"| node_database
node_dashboard -->|"views question banks"| node_question_history
node_question_history -.->|"opens question set"| node_question_detail
node_dashboard -.->|"opens revision"| node_revision_hub
node_revision_hub -->|"loads deck data"| node_revision_data
node_revision_data -->|"uses question bank"| node_assessment_bank
node_revision_hub -.->|"opens subject deck"| node_revision_deck
node_learner -->|"signs in"| node_auth_form
node_auth_form -->|"submits credentials"| node_auth_routes
node_auth_form -->|"starts Google login"| node_google_start
node_google_start -.->|"redirects callback"| node_google_callback
node_google_callback -->|"exchanges identity"| node_google
node_auth_routes -->|"reads and writes users"| node_database
node_google_callback -->|"reads and writes users"| node_database
node_auth_routes -->|"creates session"| node_session_service
node_google_callback -->|"creates session"| node_session_service
node_session_service -->|"signs and verifies"| node_jwt
node_auth_provider -.->|"checks session"| node_auth_routes
node_database -->|"uses tables"| node_schema
node_learner -->|"sends message"| node_contact
node_contact -->|"stores submission"| node_database
node_contact -.->|"requests email"| node_email_route
node_email_route -.->|"sends email"| node_email_service

click node_dashboard "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/page.jsx"
click node_history "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/_components/InterviewList.jsx"
click node_interview_setup "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/_components/AddNewInterview.jsx"
click node_gemini "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/utils/GeminiAIModal.js"
click node_briefing "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/interview/%5BinterviewId%5D/page.jsx"
click node_live_interview "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/interview/%5BinterviewId%5D/start/page.jsx"
click node_question_view "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/interview/%5BinterviewId%5D/start/_components/QuestionSection.jsx"
click node_recording "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/interview/%5BinterviewId%5D/start/_components/RecordAnswerSection.jsx"
click node_feedback "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/interview/%5BinterviewId%5D/feedback/page.jsx"
click node_assessment "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/assessment/_components/AssessmentModule.jsx"
click node_assessment_bank "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/assessment/_data/questionBank.js"
click node_question_creation "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/_components/AddQuestions.jsx"
click node_question_history "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/_components/QuestionList.jsx"
click node_question_detail "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/pyq/%5BpyqId%5D/page.jsx"
click node_revision_hub "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/revise/page.jsx"
click node_revision_deck "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/revise/%5BsubjectSlug%5D/_components/RevisionDeckExperience.jsx"
click node_revision_data "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/revise/_data/revisionDeck.js"
click node_auth_form "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/components/auth/AuthForm.jsx"
click node_auth_provider "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/components/AuthProvider.jsx"
click node_auth_routes "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/api/auth/signup/route.js"
click node_google_start "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/api/auth/google/start/route.js"
click node_google_callback "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/api/auth/google/callback/route.js"
click node_session_service "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/lib/auth.js"
click node_jwt "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/lib/auth-jwt.js"
click node_database "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/utils/db.js"
click node_schema "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/utils/schema.js"
click node_contact "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/_components/Contect.jsx"
click node_email_route "https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/api/send-email/route.js"

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_dashboard,node_history toneBlue
class node_interview_setup,node_gemini,node_briefing,node_live_interview,node_question_view,node_recording,node_feedback toneAmber
class node_assessment,node_assessment_bank,node_question_creation,node_question_history,node_question_detail,node_revision_hub,node_revision_deck,node_revision_data toneMint
class node_auth_form,node_auth_provider,node_auth_routes,node_google_start,node_google_callback,node_session_service,node_jwt toneRose
class node_database,node_schema,node_contact,node_email_route,node_learner,node_google,node_email_service toneIndigo
```

## Components

### Dashboard and practice

- [Workspace](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/page.jsx): `app/dashboard/page.jsx`
- [Interview history](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/_components/InterviewList.jsx): `app/dashboard/_components/InterviewList.jsx`

### Mock interviews

- [Interview setup](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/_components/AddNewInterview.jsx): `app/dashboard/_components/AddNewInterview.jsx`
- [Gemini generation](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/utils/GeminiAIModal.js): `utils/GeminiAIModal.js`
- [Interview briefing](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/interview/%5BinterviewId%5D/page.jsx): `app/dashboard/interview/[interviewId]/page.jsx`
- [Live interview](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/interview/%5BinterviewId%5D/start/page.jsx): `app/dashboard/interview/[interviewId]/start/page.jsx`
- [Question flow](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/interview/%5BinterviewId%5D/start/_components/QuestionSection.jsx): `app/dashboard/interview/[interviewId]/start/_components/QuestionSection.jsx`
- [Response recording](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/interview/%5BinterviewId%5D/start/_components/RecordAnswerSection.jsx): `app/dashboard/interview/[interviewId]/start/_components/RecordAnswerSection.jsx`
- [Interview feedback](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/interview/%5BinterviewId%5D/feedback/page.jsx): `app/dashboard/interview/[interviewId]/feedback/page.jsx`

### Assessment and revision

- [Timed assessment](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/assessment/_components/AssessmentModule.jsx): `app/dashboard/assessment/_components/AssessmentModule.jsx`
- [Assessment bank](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/assessment/_data/questionBank.js): `app/dashboard/assessment/_data/questionBank.js`
- [Question creation](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/_components/AddQuestions.jsx): `app/dashboard/_components/AddQuestions.jsx`
- [Question history](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/_components/QuestionList.jsx): `app/dashboard/_components/QuestionList.jsx`
- [Question set detail](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/pyq/%5BpyqId%5D/page.jsx): `app/dashboard/pyq/[pyqId]/page.jsx`
- [Revision hub](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/revise/page.jsx): `app/dashboard/revise/page.jsx`
- [Revision deck](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/revise/%5BsubjectSlug%5D/_components/RevisionDeckExperience.jsx): `app/dashboard/revise/[subjectSlug]/_components/RevisionDeckExperience.jsx`
- [Revision deck data](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/dashboard/revise/_data/revisionDeck.js): `app/dashboard/revise/_data/revisionDeck.js`

### Identity and sessions

- [Sign-in form](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/components/auth/AuthForm.jsx): `components/auth/AuthForm.jsx`
- [Auth state](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/components/AuthProvider.jsx): `components/AuthProvider.jsx`
- [Email auth routes](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/api/auth/signup/route.js): `app/api/auth/signup/route.js`
- [Google OAuth start](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/api/auth/google/start/route.js): `app/api/auth/google/start/route.js`
- [Google OAuth callback](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/api/auth/google/callback/route.js): `app/api/auth/google/callback/route.js`
- [Session service](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/lib/auth.js): `lib/auth.js`
- [JWT signing](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/lib/auth-jwt.js): `lib/auth-jwt.js`

### Persistence and support

- [Neon database](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/utils/db.js): `utils/db.js`
- [Application tables](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/utils/schema.js): `utils/schema.js`
- [Contact form](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/_components/Contect.jsx): `app/_components/Contect.jsx`
- [Email API](https://github.com/sarfaraz-r/ai_mock_technical/blob/main/app/api/send-email/route.js): `app/api/send-email/route.js`

### Other components

- **Learner**
- **Google identity**
- **Email delivery**

## Connections

- Learner → Workspace: opens
- Workspace → Interview setup: starts interview (evidence: `app/dashboard/page.jsx`)
- Interview setup → Gemini generation: generates questions (evidence: `app/dashboard/_components/AddNewInterview.jsx`)
- Interview setup → Neon database: stores interview (evidence: `app/dashboard/_components/AddNewInterview.jsx`)
- Workspace → Interview history: shows history (evidence: `app/dashboard/page.jsx`)
- Interview history → Neon database: reads interviews (evidence: `app/dashboard/_components/InterviewList.jsx`)
- Learner → Interview briefing: opens interview
- Interview briefing → Neon database: loads interview (evidence: `app/dashboard/interview/[interviewId]/page.jsx`)
- Interview briefing → Live interview: starts session
- Live interview → Question flow: renders questions (evidence: `app/dashboard/interview/[interviewId]/start/page.jsx`)
- Live interview → Response recording: records responses (evidence: `app/dashboard/interview/[interviewId]/start/page.jsx`)
- Live interview → Neon database: loads interview (evidence: `app/dashboard/interview/[interviewId]/start/page.jsx`)
- Response recording → Neon database: stores answers
- Learner → Interview feedback: reviews results
- Interview feedback → Neon database: loads answers (evidence: `app/dashboard/interview/[interviewId]/feedback/page.jsx`)
- Workspace → Timed assessment: starts assessment
- Timed assessment → Assessment bank: uses questions
- Workspace → Question creation: creates question bank
- Question creation → Neon database: stores questions
- Workspace → Question history: views question banks
- Question history → Question set detail: opens question set
- Workspace → Revision hub: opens revision
- Revision hub → Revision deck data: loads deck data (evidence: `app/dashboard/revise/page.jsx`)
- Revision deck data → Assessment bank: uses question bank (evidence: `app/dashboard/revise/_data/revisionDeck.js`)
- Revision hub → Revision deck: opens subject deck
- Learner → Sign-in form: signs in
- Sign-in form → Email auth routes: submits credentials (evidence: `components/auth/AuthForm.jsx`)
- Sign-in form → Google OAuth start: starts Google login (evidence: `components/auth/AuthForm.jsx`)
- Google OAuth start → Google OAuth callback: redirects callback
- Google OAuth callback → Google identity: exchanges identity (evidence: `app/api/auth/google/callback/route.js`)
- Email auth routes → Neon database: reads and writes users (evidence: `app/api/auth/signup/route.js`)
- Google OAuth callback → Neon database: reads and writes users (evidence: `app/api/auth/google/callback/route.js`)
- Email auth routes → Session service: creates session (evidence: `app/api/auth/signup/route.js`)
- Google OAuth callback → Session service: creates session (evidence: `app/api/auth/google/callback/route.js`)
- Session service → JWT signing: signs and verifies (evidence: `lib/auth.js`)
- Auth state → Email auth routes: checks session
- Neon database → Application tables: uses tables (evidence: `utils/db.js`)
- Learner → Contact form: sends message
- Contact form → Neon database: stores submission (evidence: `app/_components/Contect.jsx`)
- Contact form → Email API: requests email
- Email API → Email delivery: sends email
