# vaibhavpandey-1221/next-hire architecture

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

- Interactive diagram: https://gitdiagram.com/vaibhavpandey-1221/next-hire
- Repository: https://github.com/vaibhavpandey-1221/next-hire

## Overview

This repository implements a job marketplace: jobseekers and recruiters use a Next.js frontend, while separate services handle accounts, job and company listings, user profiles, and subscriptions. The visible workflow includes account access, job discovery and applications, recruiter listing management, and profile management; auth also supports password recovery. The sampled source establishes several API and service-internal relationships, but the README is empty and frontend-to-API wiring was not shown, so those links are omitted or marked unverified.

Main entry points: [`frontend/src/app/layout.tsx`](https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/app/layout.tsx) (Next.js application), [`services/auth/src/controllers/auth.ts`](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/auth/src/controllers/auth.ts) (Registration and recovery), [`services/job/src/controllers/job.ts`](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/job/src/controllers/job.ts) (Listings and applications), [`services/job/src/routes/job.ts`](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/job/src/routes/job.ts) (Job routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web experience"]
  node_web["Next.js application<br/>[layout.tsx]"]
  node_auth_pages["Account access<br/>[page.tsx]"]
  node_job_browse["Job discovery<br/>[page.tsx]"]
  node_job_details["Job applications<br/>[page.tsx]"]
  node_company_pages["Company profiles<br/>[page.tsx]"]
  node_account_pages["User profiles<br/>[page.tsx]"]
  node_career_tools["Career tools"]
end

subgraph group_accounts["Accounts and profiles"]
  node_auth_api["Auth API<br/>[app.ts]"]
  node_auth_routes["Auth routes<br/>[auth.ts]"]
  node_auth_logic["Registration and recovery<br/>[auth.ts]"]
  node_auth_db[("Account database access<br/>[db.ts]")]
  node_user_api["User profile API<br/>[user.ts]"]
  node_user_logic["Profile management<br/>[user.ts]"]
  node_user_db[("User database access<br/>[db.ts]")]
end

subgraph group_marketplace["Jobs and companies"]
  node_job_api["Job API<br/>[app.ts]"]
  node_job_routes["Job routes<br/>[job.ts]"]
  node_job_logic["Listings and applications<br/>[job.ts]"]
  node_job_db[("Marketplace database access<br/>[db.ts]")]
  node_job_auth["Job authorization<br/>[auth.ts]"]
end

subgraph group_billing["Subscriptions and messaging"]
  node_mail_events["Mail event publisher<br/>[producer.ts]"]
  node_payment_routes["Payment routes<br/>[payment.ts]"]
  node_payment_logic["Subscription payments<br/>[payment.ts]"]
  node_payment_db[("Payment database access<br/>[db.ts]")]
  node_payment_auth["Payment authorization<br/>[auth.ts]"]
end

node_visitor(("Jobseeker or recruiter"))
node_kafka["Kafka"]
node_upload_service["Upload service"]

node_visitor -.->|"uses"| node_web
node_web -.->|"presents"| node_auth_pages
node_web -.->|"presents"| node_job_browse
node_web -.->|"presents"| node_job_details
node_web -.->|"presents"| node_company_pages
node_web -.->|"presents"| node_account_pages
node_web -.->|"presents"| node_career_tools
node_auth_api -->|"mounts"| node_auth_routes
node_auth_routes -->|"dispatches"| node_auth_logic
node_auth_logic -->|"queries"| node_auth_db
node_auth_logic -->|"publishes mail"| node_mail_events
node_auth_api -->|"connects"| node_mail_events
node_auth_logic -->|"uploads resume"| node_upload_service
node_auth_logic -.->|"publishes events"| node_kafka
node_user_api -.->|"dispatches"| node_user_logic
node_user_logic -->|"queries"| node_user_db
node_job_api -->|"mounts"| node_job_routes
node_job_routes -->|"dispatches"| node_job_logic
node_job_routes -->|"checks access"| node_job_auth
node_job_logic -->|"queries"| node_job_db
node_job_logic -->|"uploads logo"| node_upload_service
node_job_logic -->|"publishes mail"| node_kafka
node_payment_routes -.->|"dispatches"| node_payment_logic
node_payment_logic -->|"queries"| node_payment_db
node_payment_logic -->|"uses auth"| node_payment_auth
node_payment_auth -->|"loads user"| node_payment_db

click node_web "https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/app/layout.tsx"
click node_auth_pages "https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/app/(auth)/login/page.tsx"
click node_job_browse "https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/app/jobs/page.tsx"
click node_job_details "https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/app/jobs/%5Bid%5D/page.tsx"
click node_company_pages "https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/app/company/%5Bid%5D/page.tsx"
click node_account_pages "https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/app/account/page.tsx"
click node_career_tools "https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/components/resume-analyser.tsx"
click node_auth_api "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/auth/src/app.ts"
click node_auth_routes "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/auth/src/routes/auth.ts"
click node_auth_logic "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/auth/src/controllers/auth.ts"
click node_auth_db "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/auth/src/utils/db.ts"
click node_mail_events "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/auth/src/producer.ts"
click node_user_api "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/user/src/routes/user.ts"
click node_user_logic "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/user/src/controllers/user.ts"
click node_user_db "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/user/src/utils/db.ts"
click node_job_api "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/job/src/app.ts"
click node_job_routes "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/job/src/routes/job.ts"
click node_job_logic "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/job/src/controllers/job.ts"
click node_job_db "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/job/src/utils/db.ts"
click node_job_auth "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/job/src/middlewares/auth.ts"
click node_payment_routes "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/payment/src/routes/payment.ts"
click node_payment_logic "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/payment/src/controllers/payment.ts"
click node_payment_db "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/payment/src/utils/db.ts"
click node_payment_auth "https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/payment/src/middlewares/auth.ts"

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_auth_pages,node_job_browse,node_job_details,node_company_pages,node_account_pages,node_career_tools toneBlue
class node_auth_api,node_auth_routes,node_auth_logic,node_auth_db,node_user_api,node_user_logic,node_user_db toneAmber
class node_job_api,node_job_routes,node_job_logic,node_job_db,node_job_auth toneMint
class node_mail_events,node_payment_routes,node_payment_logic,node_payment_db,node_payment_auth toneRose
class node_visitor,node_kafka,node_upload_service toneIndigo
```

## Components

### Web experience

- [Next.js application](https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/app/layout.tsx): `frontend/src/app/layout.tsx`
- [Account access](https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/app/(auth)/login/page.tsx): `frontend/src/app/(auth)/login/page.tsx`
- [Job discovery](https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/app/jobs/page.tsx): `frontend/src/app/jobs/page.tsx`
- [Job applications](https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/app/jobs/%5Bid%5D/page.tsx): `frontend/src/app/jobs/[id]/page.tsx`
- [Company profiles](https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/app/company/%5Bid%5D/page.tsx): `frontend/src/app/company/[id]/page.tsx`
- [User profiles](https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/app/account/page.tsx): `frontend/src/app/account/page.tsx`
- [Career tools](https://github.com/vaibhavpandey-1221/next-hire/blob/main/frontend/src/components/resume-analyser.tsx): `frontend/src/components/resume-analyser.tsx`

### Accounts and profiles

- [Auth API](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/auth/src/app.ts): `services/auth/src/app.ts`
- [Auth routes](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/auth/src/routes/auth.ts): `services/auth/src/routes/auth.ts`
- [Registration and recovery](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/auth/src/controllers/auth.ts): `services/auth/src/controllers/auth.ts`
- [Account database access](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/auth/src/utils/db.ts): `services/auth/src/utils/db.ts`
- [User profile API](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/user/src/routes/user.ts): `services/user/src/routes/user.ts`
- [Profile management](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/user/src/controllers/user.ts): `services/user/src/controllers/user.ts`
- [User database access](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/user/src/utils/db.ts): `services/user/src/utils/db.ts`

### Jobs and companies

- [Job API](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/job/src/app.ts): `services/job/src/app.ts`
- [Job routes](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/job/src/routes/job.ts): `services/job/src/routes/job.ts`
- [Listings and applications](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/job/src/controllers/job.ts): `services/job/src/controllers/job.ts`
- [Marketplace database access](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/job/src/utils/db.ts): `services/job/src/utils/db.ts`
- [Job authorization](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/job/src/middlewares/auth.ts): `services/job/src/middlewares/auth.ts`

### Subscriptions and messaging

- [Mail event publisher](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/auth/src/producer.ts): `services/auth/src/producer.ts`
- [Payment routes](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/payment/src/routes/payment.ts): `services/payment/src/routes/payment.ts`
- [Subscription payments](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/payment/src/controllers/payment.ts): `services/payment/src/controllers/payment.ts`
- [Payment database access](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/payment/src/utils/db.ts): `services/payment/src/utils/db.ts`
- [Payment authorization](https://github.com/vaibhavpandey-1221/next-hire/blob/main/services/payment/src/middlewares/auth.ts): `services/payment/src/middlewares/auth.ts`

### Other components

- **Jobseeker or recruiter**
- **Kafka**
- **Upload service**

## Connections

- Jobseeker or recruiter → Next.js application: uses
- Next.js application → Account access: presents
- Next.js application → Job discovery: presents
- Next.js application → Job applications: presents
- Next.js application → Company profiles: presents
- Next.js application → User profiles: presents
- Next.js application → Career tools: presents
- Auth API → Auth routes: mounts (evidence: `services/auth/src/app.ts`)
- Auth routes → Registration and recovery: dispatches (evidence: `services/auth/src/routes/auth.ts`)
- Registration and recovery → Account database access: queries (evidence: `services/auth/src/controllers/auth.ts`)
- Registration and recovery → Mail event publisher: publishes mail (evidence: `services/auth/src/controllers/auth.ts`)
- Auth API → Mail event publisher: connects (evidence: `services/auth/src/app.ts`)
- Registration and recovery → Upload service: uploads resume (evidence: `services/auth/src/controllers/auth.ts`)
- Registration and recovery → Kafka: publishes events
- User profile API → Profile management: dispatches
- Profile management → User database access: queries (evidence: `services/user/src/controllers/user.ts`)
- Job API → Job routes: mounts (evidence: `services/job/src/app.ts`)
- Job routes → Listings and applications: dispatches (evidence: `services/job/src/routes/job.ts`)
- Job routes → Job authorization: checks access (evidence: `services/job/src/routes/job.ts`)
- Listings and applications → Marketplace database access: queries (evidence: `services/job/src/controllers/job.ts`)
- Listings and applications → Upload service: uploads logo (evidence: `services/job/src/controllers/job.ts`)
- Listings and applications → Kafka: publishes mail (evidence: `services/job/src/controllers/job.ts`)
- Payment routes → Subscription payments: dispatches
- Subscription payments → Payment database access: queries (evidence: `services/payment/src/controllers/payment.ts`)
- Subscription payments → Payment authorization: uses auth (evidence: `services/payment/src/controllers/payment.ts`)
- Payment authorization → Payment database access: loads user (evidence: `services/payment/src/middlewares/auth.ts`)
