# shivamyash742/mockmentor architecture

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

- Interactive diagram: https://gitdiagram.com/shivamyash742/mockmentor
- Repository: https://github.com/shivamyash742/mockmentor

## Overview

MockMentor is a Next.js mock-interview product for signed-in candidates and guests. Candidates prepare a resume and job profile, choose a mentor, complete a timed voice interview with optional in-browser facial analysis, then receive a generated performance report. The graph preserves the documented preparation, interview, analysis, and reporting stages, plus persistence and AI services. Some links reflect README-documented behavior; unsampled implementation details are not inferred beyond those statements.

Main entry points: [`components/interview.tsx`](https://github.com/shivamyash742/mockmentor/blob/master/components/interview.tsx) (Interview Interface), [`app/api/generate-report/route.ts`](https://github.com/shivamyash742/mockmentor/blob/master/app/api/generate-report/route.ts) (Report Generation), [`app/interview/new/page.tsx`](https://github.com/shivamyash742/mockmentor/blob/master/app/interview/new/page.tsx) (Interview Setup), [`app/api/ai-chat/route.ts`](https://github.com/shivamyash742/mockmentor/blob/master/app/api/ai-chat/route.ts) (AI Interview Chat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Preparation"]
  node_setup["Interview Setup<br/>[page.tsx]"]
  node_resume_upload["Resume Upload<br/>[route.ts]"]
  node_resume_profile["Resume Profile<br/>[resumeProfile.ts]"]
  node_job_process["Job Summary<br/>[route.ts]"]
  node_interview_create["Interview Creation<br/>[route.ts]"]
end

subgraph group_interview["Interview"]
  node_interview_page["Interview Page<br/>[page.tsx]"]
  node_interview_ui["Interview Interface<br/>[interview.tsx]"]
  node_voice_hook["Voice Controller"]
  node_speech_input["Speech Recognition<br/>[useSpeechToText.ts]"]
  node_speech_output["Speech Synthesis<br/>[useTextToSpeech.ts]"]
  node_chat_route["AI Interview Chat<br/>[route.ts]"]
end

subgraph group_analysis["Live Analysis"]
  node_face_hook["Face Tracker<br/>[useFaceTracker.ts]"]
  node_face_analysis["Face Analysis<br/>[faceAnalysis.ts]"]
  node_emotion_model["Emotion Model<br/>[emotionModel.ts]"]
  node_stress_hud["Live Analysis HUD<br/>[StressHUD.tsx]"]
end

subgraph group_report["Reporting"]
  node_report_route["Report Generation<br/>[route.ts]"]
  node_report_view["Report View"]
end

subgraph group_platform["Platform Services"]
  node_appwrite[("Appwrite Storage")]
  node_interview_model[("Interview Record<br/>[Interview.ts]")]
  node_groq["Groq AI"]
  node_session_model[("Interview Session")]
  node_report_model[("Interview Report<br/>[InterviewReport.ts]")]
  node_mongodb[("MongoDB")]
end

node_candidate(("Candidate"))

node_candidate -->|"sets up"| node_setup
node_setup -->|"uploads resume"| node_resume_upload
node_resume_upload -->|"summarizes"| node_resume_profile
node_resume_upload -->|"stores file"| node_appwrite
node_setup -->|"submits job"| node_job_process
node_job_process -->|"summarizes role"| node_groq
node_setup -->|"creates interview"| node_interview_create
node_interview_create -->|"saves interview"| node_interview_model
node_interview_page -->|"renders"| node_interview_ui
node_interview_ui -.->|"controls voice"| node_voice_hook
node_voice_hook -->|"uses recognition"| node_speech_input
node_voice_hook -->|"uses synthesis"| node_speech_output
node_interview_ui -->|"sends answers"| node_chat_route
node_chat_route -->|"generates replies"| node_groq
node_chat_route -->|"stores transcript"| node_session_model
node_interview_ui -->|"tracks camera"| node_face_hook
node_face_hook -->|"analyzes signals"| node_face_analysis
node_face_hook -->|"loads model"| node_emotion_model
node_interview_ui -.->|"shows metrics"| node_stress_hud
node_interview_ui -->|"requests report"| node_report_route
node_report_route -->|"reads session"| node_session_model
node_report_route -->|"generates report"| node_groq
node_report_route -->|"saves report"| node_report_model
node_report_route -->|"updates status"| node_interview_model
node_report_view -.->|"displays report"| node_report_model
node_interview_create -->|"persists records"| node_mongodb
node_chat_route -->|"persists session"| node_mongodb
node_report_route -->|"persists report"| node_mongodb

click node_setup "https://github.com/shivamyash742/mockmentor/blob/master/app/interview/new/page.tsx"
click node_resume_upload "https://github.com/shivamyash742/mockmentor/blob/master/app/api/upload-resume/route.ts"
click node_resume_profile "https://github.com/shivamyash742/mockmentor/blob/master/lib/resumeProfile.ts"
click node_job_process "https://github.com/shivamyash742/mockmentor/blob/master/app/api/process-job/route.ts"
click node_interview_create "https://github.com/shivamyash742/mockmentor/blob/master/app/api/create-interview/route.ts"
click node_interview_model "https://github.com/shivamyash742/mockmentor/blob/master/lib/models/Interview.ts"
click node_interview_page "https://github.com/shivamyash742/mockmentor/blob/master/app/interview/%5Bid%5D/page.tsx"
click node_interview_ui "https://github.com/shivamyash742/mockmentor/blob/master/components/interview.tsx"
click node_voice_hook "https://github.com/shivamyash742/mockmentor/blob/master/components/logic/useVoiceInterview.ts"
click node_speech_input "https://github.com/shivamyash742/mockmentor/blob/master/hooks/useSpeechToText.ts"
click node_speech_output "https://github.com/shivamyash742/mockmentor/blob/master/hooks/useTextToSpeech.ts"
click node_chat_route "https://github.com/shivamyash742/mockmentor/blob/master/app/api/ai-chat/route.ts"
click node_session_model "https://github.com/shivamyash742/mockmentor/blob/master/lib/models/InterviewSession.ts"
click node_face_hook "https://github.com/shivamyash742/mockmentor/blob/master/hooks/useFaceTracker.ts"
click node_face_analysis "https://github.com/shivamyash742/mockmentor/blob/master/lib/faceAnalysis.ts"
click node_emotion_model "https://github.com/shivamyash742/mockmentor/blob/master/lib/emotionModel.ts"
click node_stress_hud "https://github.com/shivamyash742/mockmentor/blob/master/components/interview/StressHUD.tsx"
click node_report_route "https://github.com/shivamyash742/mockmentor/blob/master/app/api/generate-report/route.ts"
click node_report_model "https://github.com/shivamyash742/mockmentor/blob/master/lib/models/InterviewReport.ts"
click node_report_view "https://github.com/shivamyash742/mockmentor/blob/master/components/interview-report.tsx"

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_setup,node_resume_upload,node_resume_profile,node_job_process,node_interview_create toneBlue
class node_interview_page,node_interview_ui,node_voice_hook,node_speech_input,node_speech_output,node_chat_route toneAmber
class node_face_hook,node_face_analysis,node_emotion_model,node_stress_hud toneMint
class node_report_route,node_report_view toneRose
class node_appwrite,node_interview_model,node_groq,node_session_model,node_report_model,node_mongodb,node_candidate toneIndigo
```

## Components

### Preparation

- [Interview Setup](https://github.com/shivamyash742/mockmentor/blob/master/app/interview/new/page.tsx): `app/interview/new/page.tsx`
- [Resume Upload](https://github.com/shivamyash742/mockmentor/blob/master/app/api/upload-resume/route.ts): `app/api/upload-resume/route.ts`
- [Resume Profile](https://github.com/shivamyash742/mockmentor/blob/master/lib/resumeProfile.ts): `lib/resumeProfile.ts`
- [Job Summary](https://github.com/shivamyash742/mockmentor/blob/master/app/api/process-job/route.ts): `app/api/process-job/route.ts`
- [Interview Creation](https://github.com/shivamyash742/mockmentor/blob/master/app/api/create-interview/route.ts): `app/api/create-interview/route.ts`

### Interview

- [Interview Page](https://github.com/shivamyash742/mockmentor/blob/master/app/interview/%5Bid%5D/page.tsx): `app/interview/[id]/page.tsx`
- [Interview Interface](https://github.com/shivamyash742/mockmentor/blob/master/components/interview.tsx): `components/interview.tsx`
- [Voice Controller](https://github.com/shivamyash742/mockmentor/blob/master/components/logic/useVoiceInterview.ts): `components/logic/useVoiceInterview.ts`
- [Speech Recognition](https://github.com/shivamyash742/mockmentor/blob/master/hooks/useSpeechToText.ts): `hooks/useSpeechToText.ts`
- [Speech Synthesis](https://github.com/shivamyash742/mockmentor/blob/master/hooks/useTextToSpeech.ts): `hooks/useTextToSpeech.ts`
- [AI Interview Chat](https://github.com/shivamyash742/mockmentor/blob/master/app/api/ai-chat/route.ts): `app/api/ai-chat/route.ts`

### Live Analysis

- [Face Tracker](https://github.com/shivamyash742/mockmentor/blob/master/hooks/useFaceTracker.ts): `hooks/useFaceTracker.ts`
- [Face Analysis](https://github.com/shivamyash742/mockmentor/blob/master/lib/faceAnalysis.ts): `lib/faceAnalysis.ts`
- [Emotion Model](https://github.com/shivamyash742/mockmentor/blob/master/lib/emotionModel.ts): `lib/emotionModel.ts`
- [Live Analysis HUD](https://github.com/shivamyash742/mockmentor/blob/master/components/interview/StressHUD.tsx): `components/interview/StressHUD.tsx`

### Reporting

- [Report Generation](https://github.com/shivamyash742/mockmentor/blob/master/app/api/generate-report/route.ts): `app/api/generate-report/route.ts`
- [Report View](https://github.com/shivamyash742/mockmentor/blob/master/components/interview-report.tsx): `components/interview-report.tsx`

### Platform Services

- **Appwrite Storage**
- [Interview Record](https://github.com/shivamyash742/mockmentor/blob/master/lib/models/Interview.ts): `lib/models/Interview.ts`
- **Groq AI**
- [Interview Session](https://github.com/shivamyash742/mockmentor/blob/master/lib/models/InterviewSession.ts): `lib/models/InterviewSession.ts`
- [Interview Report](https://github.com/shivamyash742/mockmentor/blob/master/lib/models/InterviewReport.ts): `lib/models/InterviewReport.ts`
- **MongoDB**

### Other components

- **Candidate**

## Connections

- Candidate → Interview Setup: sets up
- Interview Setup → Resume Upload: uploads resume
- Resume Upload → Resume Profile: summarizes (evidence: `app/api/upload-resume/route.ts`)
- Resume Upload → Appwrite Storage: stores file (evidence: `app/api/upload-resume/route.ts`)
- Interview Setup → Job Summary: submits job
- Job Summary → Groq AI: summarizes role
- Interview Setup → Interview Creation: creates interview
- Interview Creation → Interview Record: saves interview (evidence: `app/api/create-interview/route.ts`)
- Interview Page → Interview Interface: renders (evidence: `app/interview/[id]/page.tsx`)
- Interview Interface → Voice Controller: controls voice
- Voice Controller → Speech Recognition: uses recognition (evidence: `components/logic/useVoiceInterview.ts`)
- Voice Controller → Speech Synthesis: uses synthesis (evidence: `components/logic/useVoiceInterview.ts`)
- Interview Interface → AI Interview Chat: sends answers
- AI Interview Chat → Groq AI: generates replies (evidence: `app/api/ai-chat/route.ts`)
- AI Interview Chat → Interview Session: stores transcript (evidence: `app/api/ai-chat/route.ts`)
- Interview Interface → Face Tracker: tracks camera
- Face Tracker → Face Analysis: analyzes signals (evidence: `hooks/useFaceTracker.ts`)
- Face Tracker → Emotion Model: loads model (evidence: `hooks/useFaceTracker.ts`)
- Interview Interface → Live Analysis HUD: shows metrics
- Interview Interface → Report Generation: requests report
- Report Generation → Interview Session: reads session (evidence: `app/api/generate-report/route.ts`)
- Report Generation → Groq AI: generates report (evidence: `app/api/generate-report/route.ts`)
- Report Generation → Interview Report: saves report (evidence: `app/api/generate-report/route.ts`)
- Report Generation → Interview Record: updates status (evidence: `app/api/generate-report/route.ts`)
- Report View → Interview Report: displays report
- Interview Creation → MongoDB: persists records
- AI Interview Chat → MongoDB: persists session
- Report Generation → MongoDB: persists report
