# jaidev-web/doomsday-parity architecture

> Architecture diagram of the GitHub repository jaidev-web/doomsday-parity, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jaidev-web/doomsday-parity
- Repository: https://github.com/jaidev-web/doomsday-parity

## Overview

TrustHire is a hiring-integrity platform: candidates submit applications and documents, while recruiters review verification findings, interview integrity, and composite trust scores. The Next.js app serves candidate and recruiter workflows; its REST client talks to FastAPI, which coordinates domain services and persistence. Email/OTP authentication is a separate Next.js API flow. The README documents the major capabilities and deployment relationships; some frontend and backend modules were not sampled, so only documented or indexed connections are shown.

Main entry points: [`backend/app/main.py`](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/main.py) (FastAPI Application), [`backend/app/routers/documents.py`](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/routers/documents.py) (Document Intake), [`backend/app/db/manager.py`](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/db/manager.py) (Database Selector), [`frontend/lib/api.js`](https://github.com/jaidev-web/doomsday-parity/blob/main/frontend/lib/api.js) (REST Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Candidate and Recruiter Experience"]
  node_candidate_ui["Candidate Portal"]
  node_recruiter_ui["Recruiter Dashboard"]
  node_interview_ui["Interview Views<br/>[page.jsx]"]
  node_api_client["REST Client<br/>[api.js]"]
  node_interview_client["Interview API<br/>[api.js]"]
end

subgraph group_auth["Email Authentication"]
  node_auth_routes["Auth API Routes"]
  node_auth_store["Auth Persistence<br/>[mongo-auth.js]"]
end

subgraph group_verification["Candidate Verification"]
  node_candidate["Candidate Records<br/>[candidates.py]"]
  node_documents["Document Intake<br/>[documents.py]"]
  node_document_parser["Document Extraction"]
  node_credential_checks["Credential Verification"]
  node_identity["Identity Checks"]
  node_trust["Trust Scoring<br/>[trust_service.py]"]
end

subgraph group_interviews["Interview and AI"]
  node_interview_api["Interview Routes<br/>[interviews.py]"]
  node_interview_service["Interview Integrity"]
  node_ai_assistant["AI Assistant API<br/>[ai_assistant.py]"]
  node_ai_service["AI Analysis<br/>[ai_service.py]"]
end

subgraph group_data["Persistence and Integrations"]
  node_backend["FastAPI Application<br/>[main.py]"]
  node_database_manager["Database Selector<br/>[manager.py]"]
  node_mock_db[("Demo Database<br/>[mock_db.py]")]
  node_mongodb[("MongoDB Store<br/>[mongodb.py]")]
  node_gemma{{"Gemma Service"}}
end

node_candidate_actor(("Candidate"))
node_recruiter_actor(("Recruiter"))
node_email_service{{"Email Provider"}}

node_candidate_actor -->|"uses"| node_candidate_ui
node_recruiter_actor -->|"uses"| node_recruiter_ui
node_candidate_ui -->|"requests data"| node_api_client
node_recruiter_ui -->|"requests data"| node_api_client
node_interview_ui -.->|"uses"| node_interview_client
node_api_client -->|"REST calls"| node_backend
node_interview_client -.->|"REST calls"| node_backend
node_backend -->|"routes to"| node_candidate
node_backend -->|"routes to"| node_documents
node_backend -->|"routes to"| node_interview_api
node_backend -->|"routes to"| node_ai_assistant
node_documents -->|"extracts text"| node_document_parser
node_documents -->|"verifies documents"| node_credential_checks
node_documents -->|"updates score"| node_trust
node_backend -->|"routes to"| node_identity
node_interview_api -->|"delegates to"| node_interview_service
node_ai_assistant -->|"requests analysis"| node_ai_service
node_interview_service -->|"generates questions"| node_ai_service
node_ai_service -.->|"calls model"| node_gemma
node_auth_routes -.->|"uses auth data"| node_auth_store
node_auth_routes -.->|"sends sign-in email"| node_email_service
node_backend -.->|"selects storage"| node_database_manager
node_database_manager -->|"uses in demo"| node_mock_db
node_database_manager -->|"initializes"| node_mongodb
node_auth_store -.->|"persists auth records"| node_mongodb

click node_candidate_ui "https://github.com/jaidev-web/doomsday-parity/tree/main/frontend/app/candidate"
click node_recruiter_ui "https://github.com/jaidev-web/doomsday-parity/tree/main/frontend/app/dashboard"
click node_interview_ui "https://github.com/jaidev-web/doomsday-parity/blob/main/frontend/app/candidate/interview/page.jsx"
click node_api_client "https://github.com/jaidev-web/doomsday-parity/blob/main/frontend/lib/api.js"
click node_interview_client "https://github.com/jaidev-web/doomsday-parity/blob/main/frontend/lib/interview/api.js"
click node_candidate "https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/routers/candidates.py"
click node_documents "https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/routers/documents.py"
click node_document_parser "https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/services/document_service.py"
click node_credential_checks "https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/services/document_verification_service.py"
click node_identity "https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/services/identity_service.py"
click node_trust "https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/services/trust_service.py"
click node_interview_api "https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/routers/interviews.py"
click node_interview_service "https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/services/interview_service.py"
click node_ai_assistant "https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/routers/ai_assistant.py"
click node_ai_service "https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/services/ai_service.py"
click node_auth_routes "https://github.com/jaidev-web/doomsday-parity/tree/main/frontend/app/api/auth"
click node_auth_store "https://github.com/jaidev-web/doomsday-parity/blob/main/frontend/lib/server/mongo-auth.js"
click node_backend "https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/main.py"
click node_database_manager "https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/db/manager.py"
click node_mock_db "https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/db/mock_db.py"
click node_mongodb "https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/db/mongodb.py"

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_candidate_ui,node_recruiter_ui,node_interview_ui,node_api_client,node_interview_client toneBlue
class node_auth_routes,node_auth_store toneAmber
class node_candidate,node_documents,node_document_parser,node_credential_checks,node_identity,node_trust toneMint
class node_interview_api,node_interview_service,node_ai_assistant,node_ai_service toneRose
class node_backend,node_database_manager,node_mock_db,node_mongodb,node_gemma,node_candidate_actor,node_recruiter_actor,node_email_service toneIndigo
```

## Components

### Candidate and Recruiter Experience

- [Candidate Portal](https://github.com/jaidev-web/doomsday-parity/tree/main/frontend/app/candidate): `frontend/app/candidate`
- [Recruiter Dashboard](https://github.com/jaidev-web/doomsday-parity/tree/main/frontend/app/dashboard): `frontend/app/dashboard`
- [Interview Views](https://github.com/jaidev-web/doomsday-parity/blob/main/frontend/app/candidate/interview/page.jsx): `frontend/app/candidate/interview/page.jsx`
- [REST Client](https://github.com/jaidev-web/doomsday-parity/blob/main/frontend/lib/api.js): `frontend/lib/api.js`
- [Interview API](https://github.com/jaidev-web/doomsday-parity/blob/main/frontend/lib/interview/api.js): `frontend/lib/interview/api.js`

### Email Authentication

- [Auth API Routes](https://github.com/jaidev-web/doomsday-parity/tree/main/frontend/app/api/auth): `frontend/app/api/auth`
- [Auth Persistence](https://github.com/jaidev-web/doomsday-parity/blob/main/frontend/lib/server/mongo-auth.js): `frontend/lib/server/mongo-auth.js`

### Candidate Verification

- [Candidate Records](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/routers/candidates.py): `backend/app/routers/candidates.py`
- [Document Intake](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/routers/documents.py): `backend/app/routers/documents.py`
- [Document Extraction](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/services/document_service.py): `backend/app/services/document_service.py`
- [Credential Verification](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/services/document_verification_service.py): `backend/app/services/document_verification_service.py`
- [Identity Checks](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/services/identity_service.py): `backend/app/services/identity_service.py`
- [Trust Scoring](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/services/trust_service.py): `backend/app/services/trust_service.py`

### Interview and AI

- [Interview Routes](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/routers/interviews.py): `backend/app/routers/interviews.py`
- [Interview Integrity](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/services/interview_service.py): `backend/app/services/interview_service.py`
- [AI Assistant API](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/routers/ai_assistant.py): `backend/app/routers/ai_assistant.py`
- [AI Analysis](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/services/ai_service.py): `backend/app/services/ai_service.py`

### Persistence and Integrations

- [FastAPI Application](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/main.py): `backend/app/main.py`
- [Database Selector](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/db/manager.py): `backend/app/db/manager.py`
- [Demo Database](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/db/mock_db.py): `backend/app/db/mock_db.py`
- [MongoDB Store](https://github.com/jaidev-web/doomsday-parity/blob/main/backend/app/db/mongodb.py): `backend/app/db/mongodb.py`
- **Gemma Service**

### Other components

- **Candidate**
- **Recruiter**
- **Email Provider**

## Connections

- Candidate → Candidate Portal: uses (evidence: `README.md`)
- Recruiter → Recruiter Dashboard: uses (evidence: `README.md`)
- Candidate Portal → REST Client: requests data (evidence: `README.md`)
- Recruiter Dashboard → REST Client: requests data (evidence: `README.md`)
- Interview Views → Interview API: uses
- REST Client → FastAPI Application: REST calls (evidence: `README.md`)
- Interview API → FastAPI Application: REST calls
- FastAPI Application → Candidate Records: routes to (evidence: `backend/app/main.py`)
- FastAPI Application → Document Intake: routes to (evidence: `backend/app/main.py`)
- FastAPI Application → Interview Routes: routes to (evidence: `backend/app/main.py`)
- FastAPI Application → AI Assistant API: routes to (evidence: `backend/app/main.py`)
- Document Intake → Document Extraction: extracts text (evidence: `backend/app/routers/documents.py`)
- Document Intake → Credential Verification: verifies documents (evidence: `backend/app/routers/documents.py`)
- Document Intake → Trust Scoring: updates score (evidence: `backend/app/routers/documents.py`)
- FastAPI Application → Identity Checks: routes to (evidence: `backend/app/main.py`)
- Interview Routes → Interview Integrity: delegates to (evidence: `backend/app/routers/interviews.py`)
- AI Assistant API → AI Analysis: requests analysis (evidence: `backend/app/routers/ai_assistant.py`)
- Interview Integrity → AI Analysis: generates questions (evidence: `backend/app/services/interview_service.py`)
- AI Analysis → Gemma Service: calls model (evidence: `README.md`)
- Auth API Routes → Auth Persistence: uses auth data
- Auth API Routes → Email Provider: sends sign-in email (evidence: `README.md`)
- FastAPI Application → Database Selector: selects storage
- Database Selector → Demo Database: uses in demo (evidence: `backend/app/db/manager.py`)
- Database Selector → MongoDB Store: initializes (evidence: `backend/app/db/manager.py`)
- Auth Persistence → MongoDB Store: persists auth records (evidence: `README.md`)
