# devrahulbanjara/convexhire architecture

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

- Interactive diagram: https://gitdiagram.com/devrahulbanjara/convexhire
- Repository: https://github.com/devrahulbanjara/convexhire

## Overview

1. This is a monorepo for a hiring/recruiting platform, split into a Python backend, a Next.js frontend, and a sizable set of AI/ML tooling, docs, and evaluation assets.

2. The frontend is a Next.js App Router application with clear product surfaces: public marketing pages, candidate portal, recruiter portal, auth flows, and legal pages. It uses a shared component library, Redux/RTK Query-style API services, and role-based route guarding to keep candidate and recruiter experiences separated.

3. The backend is a modular Python API organized by domain, with the usual service/router/schema/model layering. Each feature lives in its own module under `app/modules`, which makes the domain boundaries explicit and easy to map in a diagram.

4. Cross-cutting backend concerns live under `app/core`: configuration, database access, dependency wiring, security/auth, middleware, logging, caching, request context, response helpers, and background task/scheduler support. This is the shared platform layer that all domain modules depend on.

5. The main business domains are:
   - auth and identity
   - companies and recruiter settings/preferences
   - profiles, resumes, and resume import
   - jobs and job drafts
   - applications and application sharing/sync
   - interviews, including recordings and evaluations
   - notifications, activity, audit logs
   - outreach and dashboards
   These domains are the core transactional data model of the product.

6. AI-assisted workflows are a major architectural layer rather than a thin add-on. There are dedicated subsystems for job drafting/search, recruiter chat, shortlisting, resume-gap analysis, profile AI import, interview evaluation, and shortlisting ML filtering. Several of these use graph/node/prompt/tool structures, indicating agent-style orchestration rather than single-call LLM usage.

7. The backend’s infrastructure adapters are isolated under `app/infrastructures`. They wrap external capabilities such as AWS/Bedrock, Qdrant, Redis, email, storage, search, HuggingFace Whisper, resume extraction, and guardrails. This separation suggests the domain services talk to provider-specific adapters rather than calling vendors directly.

8. Data persistence appears centered on a relational database with Alembic migrations for schema evolution. The migration history shows evolving support for jobs, applications, interviews, shortlisting, notifications, audit logs, recruiter chat sessions, job sync events, and evaluation schemas. That implies the database is the system of record for workflow state.

9. Some workflows are explicitly asynchronous or eventually consistent:
   - sync modules and outbox-style tables for job/application events
   - job expiry scheduling
   - resume import tasks
   - interview webhooks
   - cache invalidation and SWR-style freshness handling
   - search/vector reconciliation
   This means not all updates are served synchronously from one request path.

10. A typical runtime flow is: user action in the frontend → API request to the backend domain router → service layer business logic → database/cache/AI adapter calls → response back to the UI. For AI-heavy features, the service layer may also invoke agent graphs, embeddings/vector search, or guardrails before returning results.

11. The frontend has at least one special boundary around recruiter chat: it includes its own API route handlers for session/message streaming and confirmation actions. That suggests the UI sometimes proxies or orchestrates backend chat interactions locally to support streaming and session state.

12. There is a strong evaluation and research footprint in the repo: golden resume datasets, benchmark runs, notebooks, training scripts, evaluation reports, and documentation diagrams. These are support artifacts for model quality and system validation, not part of the live product path.

13. Operationally, the repo includes Docker, environment examples, CI workflows, reset/seed scripts, and test suites. Integration tests cover auth, jobs, companies, applications, cache invalidation, recruiter chat memory, resume-gap grounding, and hybrid search behavior, which reinforces the main architectural seams.

14. If you draw the architecture, the clearest top-level boundaries are:
   - Next.js client/UI
   - Python domain API
   - AI/ML orchestration layer
   - external infrastructure/providers
   - persistence/search/cache stores
   - offline evaluation/training/tooling
   The interesting data flows are job/application lifecycle, recruiter chat, shortlisting, resume parsing/gap analysis, and interview evaluation.

Main entry points: [`backend/app/core`](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/core) (Core Platform), [`backend/alembic`](https://github.com/devrahulbanjara/convexhire/tree/main/backend/alembic) (DB & Migrations), [`backend/app/infrastructures/ai`](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/infrastructures/ai) (AI Providers), [`frontend/src/app`](https://github.com/devrahulbanjara/convexhire/tree/main/frontend/src/app) (UI Shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Next.js Frontend"]
  node_frontend_app["UI Shell<br/>Next.js App Router"]
  node_frontend_chat_api["Chat API<br/>route handlers"]
  node_frontend_shared["Shared UI<br/>components"]
  node_frontend_state["Client State<br/>RTK data"]
end

subgraph group_backend["Python API"]
  node_backend_core["Core Platform<br/>shared backend"]
  node_backend_auth["Auth & Identity<br/>domain module"]
  node_backend_profiles["Profiles & Resumes<br/>domain module"]
  node_backend_jobs["Jobs & Drafts<br/>domain module"]
  node_backend_apps["Applications<br/>domain module"]
  node_backend_interviews["Interviews<br/>domain module"]
  node_backend_org["Companies & Recruiter<br/>domain module"]
  node_backend_ops["Activity & Audit<br/>domain module"]
end

subgraph group_ai["AI Orchestration"]
  node_backend_ai_job{{"Job AI<br/>AI workflow"}}
  node_backend_ai_chat{{"Recruiter Chat<br/>AI workflow"}}
  node_backend_ai_shortlist{{"Shortlisting AI<br/>agent graph"}}
  node_backend_ai_gap{{"Resume Gap AI<br/>LLM workflow"}}
end

subgraph group_infra["External Adapters"]
  node_backend_infra_ai["AI Providers<br/>provider adapters"]
  node_backend_infra_data["Data Adapters<br/>provider adapters"]
end

subgraph group_data["Persistence"]
  node_backend_store[("DB & Migrations<br/>Postgres/Alembic")]
  node_backend_cache[("Cache & Vector<br/>redis/qdrant")]
end

subgraph group_offline["Offline Tooling"]
  node_offline_eval["Eval & Research<br/>offline tooling"]
end

node_frontend_app -->|"renders"| node_frontend_shared
node_frontend_app -->|"uses"| node_frontend_state
node_frontend_app -->|"proxies chat"| node_frontend_chat_api
node_frontend_state -->|"calls API"| node_backend_core
node_frontend_chat_api -->|"streams to"| node_backend_ai_chat
node_frontend_chat_api -->|"auth/context"| node_backend_core
node_backend_jobs -->|"depends on"| node_backend_core
node_backend_apps -->|"depends on"| node_backend_core
node_backend_profiles -->|"depends on"| node_backend_core
node_backend_interviews -->|"depends on"| node_backend_core
node_backend_org -->|"depends on"| node_backend_core
node_backend_ops -->|"depends on"| node_backend_core
node_backend_jobs -->|"persists"| node_backend_store
node_backend_apps -->|"persists"| node_backend_store
node_backend_interviews -->|"persists"| node_backend_store
node_backend_ops -->|"persists"| node_backend_store
node_backend_jobs -->|"syncs"| node_backend_cache
node_backend_ai_job -->|"invokes"| node_backend_infra_ai
node_backend_ai_chat -->|"invokes"| node_backend_infra_ai
node_backend_ai_shortlist -->|"invokes"| node_backend_infra_ai
node_backend_ai_gap -->|"invokes"| node_backend_infra_ai
node_backend_ai_job -->|"uses"| node_backend_cache
node_backend_ai_shortlist -->|"retrieves"| node_backend_cache
node_backend_ai_gap -->|"retrieves"| node_backend_cache
node_backend_infra_data -->|"wraps"| node_backend_cache
node_backend_infra_data -->|"integrates"| node_backend_store
node_offline_eval -->|"validates"| node_backend_ai_gap
node_offline_eval -->|"benchmarks"| node_backend_ai_shortlist

click node_frontend_app "https://github.com/devrahulbanjara/convexhire/tree/main/frontend/src/app"
click node_frontend_chat_api "https://github.com/devrahulbanjara/convexhire/tree/main/frontend/src/app/api/recruiter-chat"
click node_frontend_shared "https://github.com/devrahulbanjara/convexhire/tree/main/frontend/src/components"
click node_frontend_state "https://github.com/devrahulbanjara/convexhire/tree/main/frontend/src/store"
click node_backend_core "https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/core"
click node_backend_auth "https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/auth"
click node_backend_profiles "https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/profiles"
click node_backend_jobs "https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/jobs"
click node_backend_apps "https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/applications"
click node_backend_interviews "https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/interviews"
click node_backend_org "https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/companies"
click node_backend_ops "https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/activity"
click node_backend_ai_job "https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/job_ai"
click node_backend_ai_chat "https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/recruiter_chat"
click node_backend_ai_shortlist "https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/agents/shortlisting"
click node_backend_ai_gap "https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/resume_gap"
click node_backend_infra_ai "https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/infrastructures/ai"
click node_backend_infra_data "https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/infrastructures"
click node_backend_store "https://github.com/devrahulbanjara/convexhire/tree/main/backend/alembic"
click node_offline_eval "https://github.com/devrahulbanjara/convexhire/tree/main/backend/evaluation"

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_frontend_app,node_frontend_chat_api,node_frontend_shared,node_frontend_state toneBlue
class node_backend_core,node_backend_auth,node_backend_profiles,node_backend_jobs,node_backend_apps,node_backend_interviews,node_backend_org,node_backend_ops toneAmber
class node_backend_ai_job,node_backend_ai_chat,node_backend_ai_shortlist,node_backend_ai_gap toneMint
class node_backend_infra_ai,node_backend_infra_data toneRose
class node_backend_store,node_backend_cache toneIndigo
class node_offline_eval toneTeal
```

## Components

### Next.js Frontend

App Router UI, role-separated experiences, and client-side orchestration.

- [UI Shell](https://github.com/devrahulbanjara/convexhire/tree/main/frontend/src/app): Next.js App Router · Public pages, auth flows, candidate and recruiter portals, legal pages, and layout guards. · `frontend/src/app`
- [Chat API](https://github.com/devrahulbanjara/convexhire/tree/main/frontend/src/app/api/recruiter-chat): route handlers · Recruiter chat session, message streaming, history, interrupt, and confirm actions. · `frontend/src/app/api/recruiter-chat`
- [Shared UI](https://github.com/devrahulbanjara/convexhire/tree/main/frontend/src/components): components · Common components, layout pieces, recruiter chat widgets, and job/candidate surfaces. · `frontend/src/components`
- [Client State](https://github.com/devrahulbanjara/convexhire/tree/main/frontend/src/store): RTK data · API services, slices, hooks, role routes, and app-side state management. · `frontend/src/store`

### Python API

Domain API, shared platform code, and service-layer business logic.

- [Core Platform](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/core): shared backend · Configuration, DB wiring, security, middleware, logging, cache, scheduler, and request context. · `backend/app/core`
- [Auth & Identity](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/auth): domain module · Login, OAuth, account state, dependencies, and identity models and schemas. · `backend/app/modules/auth`
- [Profiles & Resumes](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/profiles): domain module · Candidate profiles, resumes, and AI-assisted profile import workflows. · `backend/app/modules/profiles`
- [Jobs & Drafts](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/jobs): domain module · Jobs, job drafts, sync hooks, lifecycle state, and job-facing APIs. · `backend/app/modules/jobs`
- [Applications](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/applications): domain module · Applications, sharing, synchronization, and application state transitions. · `backend/app/modules/applications`
- [Interviews](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/interviews): domain module · Interview scheduling, recordings, evaluations, and webhook handling. · `backend/app/modules/interviews`
- [Companies & Recruiter](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/companies): domain module · Company settings, recruiter preferences, company-scoped configuration, and team data. · `backend/app/modules/companies`
- [Activity & Audit](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/activity): domain module · Activity feeds, notifications, audit logs, and operational history. · `backend/app/modules/activity`

### AI Orchestration

Agentic and LLM-assisted workflows for drafting, ranking, parsing, and evaluation.

- [Job AI](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/job_ai): AI workflow · Job drafting, search, prompt/tool orchestration, runtime, and validation. · `backend/app/modules/job_ai`
- [Recruiter Chat](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/recruiter_chat): AI workflow · Conversational recruiter assistant with prompts, tools, sessions, and stateful flows. · `backend/app/modules/recruiter_chat`
- [Shortlisting AI](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/agents/shortlisting): agent graph · Graph-based shortlisting with router, critique, role-specific nodes, prompts, and tools. · `backend/app/agents/shortlisting`
- [Resume Gap AI](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/modules/resume_gap): LLM workflow · Gap analysis, grounding, provider abstraction, and safety helpers for resume review. · `backend/app/modules/resume_gap`

### External Adapters

Provider integrations for storage, search, embeddings, email, and guardrails.

- [AI Providers](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/infrastructures/ai): provider adapters · Bedrock, AI service wrapper, guardrails, HuggingFace Whisper, embeddings, and model access. · `backend/app/infrastructures/ai`
- [Data Adapters](https://github.com/devrahulbanjara/convexhire/tree/main/backend/app/infrastructures): provider adapters · Qdrant, Redis, search, storage, email, resume extraction, and AWS integration. · `backend/app/infrastructures`

### Persistence

Relational system of record plus cache/vector/search stores.

- [DB & Migrations](https://github.com/devrahulbanjara/convexhire/tree/main/backend/alembic): Postgres/Alembic · Relational system of record and schema evolution for product workflows and events. · `backend/alembic`
- **Cache & Vector**: redis/qdrant · Freshness cache, SWR behavior, vector search, and reconciliation stores.

### Offline Tooling

Evaluation, training, and dataset generation artifacts.

- [Eval & Research](https://github.com/devrahulbanjara/convexhire/tree/main/backend/evaluation): offline tooling · Golden datasets, evaluation runs, notebooks, benchmarks, reports, and training scripts. · `backend/evaluation`

## Connections

- UI Shell → Shared UI: renders · The app routes compose shared UI and page-level components.
- UI Shell → Client State: uses · Pages and features fetch data through client state services and slices.
- UI Shell → Chat API: proxies chat · Recruiter chat routes are partly handled locally for streaming and session state.
- Client State → Core Platform: calls API · RTK-style services call the backend via the shared HTTP boundary.
- Chat API → Recruiter Chat: streams to · Chat route handlers coordinate with the recruiter chat backend workflow.
- Chat API → Core Platform: auth/context · Route handlers rely on shared auth and request context conventions.
- Jobs & Drafts → Core Platform: depends on · Domain services rely on core config, database, security, and helpers.
- Applications → Core Platform: depends on · Application orchestration uses the shared backend platform layer.
- Profiles & Resumes → Core Platform: depends on · Profile and import services use core dependencies and helpers.
- Interviews → Core Platform: depends on · Interview flows use shared platform services and webhook helpers.
- Companies & Recruiter → Core Platform: depends on · Company and recruiter settings are built on the core platform layer.
- Activity & Audit → Core Platform: depends on · Activity, notifications, and audit services use core wiring and logging.
- Jobs & Drafts → DB & Migrations: persists · Jobs, drafts, sync events, and expiry state live in the relational database.
- Applications → DB & Migrations: persists · Applications and sharing state are stored as source-of-truth records.
- Interviews → DB & Migrations: persists · Interview records, recordings, evaluations, and webhook state are stored centrally.
- Activity & Audit → DB & Migrations: persists · Notifications, activity logs, and audit trails are database-backed.
- Jobs & Drafts → Cache & Vector: syncs · Job state uses cache invalidation and freshness controls.
- Job AI → AI Providers: invokes · Job AI uses model and provider adapters for generation and validation.
- Recruiter Chat → AI Providers: invokes · Recruiter chat uses LLM and guardrail services through adapters.
- Shortlisting AI → AI Providers: invokes · Shortlisting agents rely on model/provider access and guardrails.
- Resume Gap AI → AI Providers: invokes · Resume gap analysis uses provider-backed LLM and safety services.
- Job AI → Cache & Vector: uses · AI workflows use embeddings, cached results, or vector-backed retrieval.
- Shortlisting AI → Cache & Vector: retrieves · Shortlisting uses vector/search stores for candidate ranking signals.
- Resume Gap AI → Cache & Vector: retrieves · Gap analysis and grounding rely on vector/search state.
- Data Adapters → Cache & Vector: wraps · Adapters isolate Redis, Qdrant, search, and storage implementations.
- Data Adapters → DB & Migrations: integrates · Adapters bridge the domain code to durable storage and external services.
- Eval & Research → Resume Gap AI: validates · Golden datasets and eval runs measure resume-gap workflow quality.
- Eval & Research → Shortlisting AI: benchmarks · Offline evaluation supports shortlisting and model-quality comparisons.
