# ernestezy/interview_coach_prep architecture

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

- Interactive diagram: https://gitdiagram.com/ernestezy/interview_coach_prep
- Repository: https://github.com/ernestezy/interview_coach_prep

## Overview

#### Purpose and Entry Points
ICP is a career-preparation platform: AI resume analysis/building, mock interviews, job discovery, and administration. The primary server entry point is `backend/main.py`; it exposes FastAPI APIs and likely serves the static browser client rooted at `frontend/index.html`. Native clients package the same product for Flutter (`mobile_app/lib/main.dart`) and Tauri (`src-tauri/src/main.rs`).

#### API and Application Boundary
HTTP controllers divide the backend by business capability: authentication/OAuth, resume processing, interview sessions, AI assistance, jobs, and administration. Request/response contracts are centralized in `backend/models/schemas.py`; shared persistence and security infrastructure sits behind `backend/core/db.py` and `backend/core/security.py`.
- `backend/controllers/auth_routes.py`
- `backend/controllers/resume_routes.py`
- `backend/controllers/interview_routes.py`

#### Identity, Authorization, and Operational Controls
JWT-based user identity is enforced at the API boundary, with OAuth handled as a distinct flow. Admin operations are isolated from regular user workflows. Rate limits, per-day usage restrictions, caching, and audit functionality protect costly AI-backed endpoints and support operational oversight.
- `backend/controllers/oauth_routes.py`
- `backend/controllers/admin_routes.py`
- `backend/services/rate_limit.py`

#### Resume Intelligence Pipeline
Resume requests flow from upload/builder UI through semantic parsing and AI/RAG analysis, producing scores, extracted skills, structured recommendations, and downloadable PDF reports. The parser and validation stage is the trust boundary for user-provided document content; PDF rendering uses a server-side template.
- `backend/services/resume_parser.py`
- `backend/services/rag_engine.py`
- `backend/services/pdf_generator.py`

#### Interview and AI Assistance Pipeline
The interview subsystem generates role- and difficulty-specific questions, accepts session interactions, and returns readiness feedback. Shared AI-assistance endpoints use the same Mistral-backed service layer; retry logic isolates transient LLM failures. AI feedback is separated from route handling, keeping controllers as orchestration adapters.
- `backend/services/interview_engine.py`
- `backend/services/ai_feedback.py`
- `backend/services/mistral_retry.py`

#### Clients and User Flows
The web client is a static HTML/CSS/JavaScript application with page-specific scripts for dashboard, interview, resume builder, account recovery, and jobs. It calls the FastAPI API rather than containing server business logic. The Flutter application is cross-platform; the Tauri wrapper provides a desktop distribution path.
- `frontend/static/js/app.js`
- `frontend/static/js/interview.js`
- `frontend/static/js/resume_builder.js`

#### Runtime, Data, and Deployment
The runtime is Python/FastAPI with MongoDB accessed through Motor, Mistral AI for generation/analysis, LlamaIndex for RAG, and Careerjet for job listings. Docker, Nginx, and Render deployment definitions support hosted operation; GitHub Actions builds distributable applications.
- `Dockerfile`
- `nginx.conf`
- `render.yaml`

Main entry points: [`backend/controllers/auth_routes.py`](https://github.com/ernestezy/interview_coach_prep/blob/main/backend/controllers/auth_routes.py) (User workflows), [`backend/main.py`](https://github.com/ernestezy/interview_coach_prep/blob/main/backend/main.py) (API server), [`frontend/index.html`](https://github.com/ernestezy/interview_coach_prep/blob/main/frontend/index.html) (Static web client), [`backend/services/interview_engine.py`](https://github.com/ernestezy/interview_coach_prep/blob/main/backend/services/interview_engine.py) (Interview & feedback)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Clients"]
  node_web["Static web client<br/>HTML/CSS/JS<br/>[index.html]"]
  node_web_app["Client API layer<br/>browser JS<br/>[app.js]"]
  node_web_interview["Interview UI<br/>browser JS<br/>[interview.js]"]
  node_web_resume["Resume builder UI<br/>browser JS<br/>[resume_builder.js]"]
  node_flutter["Flutter client<br/>Flutter app<br/>[main.dart]"]
  node_tauri["Desktop wrapper<br/>Tauri<br/>[main.rs]"]
end

subgraph group_api["FastAPI Backend"]
  node_server{{"API server<br/>FastAPI<br/>[main.py]"}}
  node_controllers["User workflows<br/>route controllers<br/>[auth_routes.py]"]
  node_oauth_admin["OAuth &amp; admin<br/>route controllers<br/>[oauth_routes.py]"]
  node_contracts["API contracts<br/>Pydantic schemas<br/>[schemas.py]"]
  node_security["Auth &amp; persistence core<br/>security / database<br/>[security.py]"]
  node_rate_limits["Usage controls<br/>rate limiting<br/>[rate_limit.py]"]
end

subgraph group_intelligence["AI Pipelines"]
  node_resume_pipeline["Resume intelligence<br/>[resume_parser.py]"]
  node_interview_pipeline["Interview &amp; feedback<br/>AI service layer"]
  node_llm_retry["LLM retry<br/>resilience service<br/>[mistral_retry.py]"]
end

subgraph group_platform["Data &amp; Integrations"]
  node_mongodb[("MongoDB<br/>database")]
  node_ai_integrations["Mistral &amp; LlamaIndex<br/>LLM / RAG"]
  node_careerjet["Careerjet<br/>job listings API"]
end

subgraph group_operations["Deployment"]
  node_deployment["Hosted runtime"]
end

node_web -->|"loads"| node_web_app
node_web -->|"loads"| node_web_interview
node_web -->|"loads"| node_web_resume
node_web_app -->|"API calls"| node_server
node_web_interview -->|"API calls"| node_server
node_web_resume -->|"API calls"| node_server
node_flutter -->|"API calls"| node_server
node_tauri -->|"packages"| node_web
node_server -->|"routes requests"| node_controllers
node_server -->|"routes privileged flows"| node_oauth_admin
node_controllers -->|"validates payloads"| node_contracts
node_controllers -->|"authenticates users"| node_security
node_oauth_admin -->|"OAuth and JWT"| node_security
node_controllers -->|"resume requests"| node_resume_pipeline
node_controllers -->|"interview and AI requests"| node_interview_pipeline
node_controllers -->|"enforces usage"| node_rate_limits
node_security -->|"persists data"| node_mongodb
node_resume_pipeline -->|"RAG analysis"| node_ai_integrations
node_interview_pipeline -->|"generation and feedback"| node_ai_integrations
node_interview_pipeline -->|"retries failures"| node_llm_retry
node_controllers -->|"job discovery"| node_careerjet
node_deployment -->|"runs"| node_server

click node_web "https://github.com/ernestezy/interview_coach_prep/blob/main/frontend/index.html"
click node_web_app "https://github.com/ernestezy/interview_coach_prep/blob/main/frontend/static/js/app.js"
click node_web_interview "https://github.com/ernestezy/interview_coach_prep/blob/main/frontend/static/js/interview.js"
click node_web_resume "https://github.com/ernestezy/interview_coach_prep/blob/main/frontend/static/js/resume_builder.js"
click node_flutter "https://github.com/ernestezy/interview_coach_prep/blob/main/mobile_app/lib/main.dart"
click node_tauri "https://github.com/ernestezy/interview_coach_prep/blob/main/src-tauri/src/main.rs"
click node_server "https://github.com/ernestezy/interview_coach_prep/blob/main/backend/main.py"
click node_controllers "https://github.com/ernestezy/interview_coach_prep/blob/main/backend/controllers/auth_routes.py"
click node_oauth_admin "https://github.com/ernestezy/interview_coach_prep/blob/main/backend/controllers/oauth_routes.py"
click node_contracts "https://github.com/ernestezy/interview_coach_prep/blob/main/backend/models/schemas.py"
click node_security "https://github.com/ernestezy/interview_coach_prep/blob/main/backend/core/security.py"
click node_resume_pipeline "https://github.com/ernestezy/interview_coach_prep/blob/main/backend/services/resume_parser.py"
click node_interview_pipeline "https://github.com/ernestezy/interview_coach_prep/blob/main/backend/services/interview_engine.py"
click node_llm_retry "https://github.com/ernestezy/interview_coach_prep/blob/main/backend/services/mistral_retry.py"
click node_rate_limits "https://github.com/ernestezy/interview_coach_prep/blob/main/backend/services/rate_limit.py"
click node_deployment "https://github.com/ernestezy/interview_coach_prep/blob/main/Dockerfile"

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_web,node_web_app,node_web_interview,node_web_resume,node_flutter,node_tauri toneBlue
class node_server,node_controllers,node_oauth_admin,node_contracts,node_security,node_rate_limits toneAmber
class node_resume_pipeline,node_interview_pipeline,node_llm_retry toneMint
class node_mongodb,node_ai_integrations,node_careerjet toneRose
class node_deployment toneIndigo
```

## Components

### Clients

- [Static web client](https://github.com/ernestezy/interview_coach_prep/blob/main/frontend/index.html): HTML/CSS/JS · Browser UI for dashboard, jobs, interviews, and resume building. · `frontend/index.html`
- [Client API layer](https://github.com/ernestezy/interview_coach_prep/blob/main/frontend/static/js/app.js): browser JS · `frontend/static/js/app.js`
- [Interview UI](https://github.com/ernestezy/interview_coach_prep/blob/main/frontend/static/js/interview.js): browser JS · `frontend/static/js/interview.js`
- [Resume builder UI](https://github.com/ernestezy/interview_coach_prep/blob/main/frontend/static/js/resume_builder.js): browser JS · `frontend/static/js/resume_builder.js`
- [Flutter client](https://github.com/ernestezy/interview_coach_prep/blob/main/mobile_app/lib/main.dart): Flutter app · `mobile_app/lib/main.dart`
- [Desktop wrapper](https://github.com/ernestezy/interview_coach_prep/blob/main/src-tauri/src/main.rs): Tauri · `src-tauri/src/main.rs`

### FastAPI Backend

- [API server](https://github.com/ernestezy/interview_coach_prep/blob/main/backend/main.py): FastAPI · HTTP entry point and static-client host. · `backend/main.py`
- [User workflows](https://github.com/ernestezy/interview_coach_prep/blob/main/backend/controllers/auth_routes.py): route controllers · Auth, resume, interview, jobs, and AI request adapters. · `backend/controllers/auth_routes.py`
- [OAuth & admin](https://github.com/ernestezy/interview_coach_prep/blob/main/backend/controllers/oauth_routes.py): route controllers · Separate identity-provider and privileged operations. · `backend/controllers/oauth_routes.py`
- [API contracts](https://github.com/ernestezy/interview_coach_prep/blob/main/backend/models/schemas.py): Pydantic schemas · `backend/models/schemas.py`
- [Auth & persistence core](https://github.com/ernestezy/interview_coach_prep/blob/main/backend/core/security.py): security / database · JWT enforcement and MongoDB access infrastructure. · `backend/core/security.py`
- [Usage controls](https://github.com/ernestezy/interview_coach_prep/blob/main/backend/services/rate_limit.py): rate limiting · Protects costly AI endpoints with limits and quotas. · `backend/services/rate_limit.py`

### AI Pipelines

- [Resume intelligence](https://github.com/ernestezy/interview_coach_prep/blob/main/backend/services/resume_parser.py): parse / RAG / report · Validates documents, extracts content, analyzes resumes, and renders PDF reports. · `backend/services/resume_parser.py`
- [Interview & feedback](https://github.com/ernestezy/interview_coach_prep/blob/main/backend/services/interview_engine.py): AI service layer · Generates interview questions and readiness feedback. · `backend/services/interview_engine.py`
- [LLM retry](https://github.com/ernestezy/interview_coach_prep/blob/main/backend/services/mistral_retry.py): resilience service · Isolates transient Mistral failures. · `backend/services/mistral_retry.py`

### Data & Integrations

- **MongoDB**: database
- **Mistral & LlamaIndex**: LLM / RAG
- **Careerjet**: job listings API

### Deployment

- [Hosted runtime](https://github.com/ernestezy/interview_coach_prep/blob/main/Dockerfile): Docker / Nginx / Render · Containerized, proxied deployment configuration. · `Dockerfile`

## Connections

- Static web client → Client API layer: loads
- Static web client → Interview UI: loads
- Static web client → Resume builder UI: loads
- Client API layer → API server: API calls
- Interview UI → API server: API calls
- Resume builder UI → API server: API calls
- Flutter client → API server: API calls
- Desktop wrapper → Static web client: packages
- API server → User workflows: routes requests
- API server → OAuth & admin: routes privileged flows
- User workflows → API contracts: validates payloads
- User workflows → Auth & persistence core: authenticates users
- OAuth & admin → Auth & persistence core: OAuth and JWT
- User workflows → Resume intelligence: resume requests
- User workflows → Interview & feedback: interview and AI requests
- User workflows → Usage controls: enforces usage
- Auth & persistence core → MongoDB: persists data
- Resume intelligence → Mistral & LlamaIndex: RAG analysis
- Interview & feedback → Mistral & LlamaIndex: generation and feedback
- Interview & feedback → LLM retry: retries failures
- User workflows → Careerjet: job discovery
- Hosted runtime → API server: runs
