# nallakshit-ops/careerpilotai-signallabs architecture

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

- Interactive diagram: https://gitdiagram.com/nallakshit-ops/careerpilotai-signallabs
- Repository: https://github.com/nallakshit-ops/careerpilotai-signallabs

## Overview

#### Purpose and Runtime
This is a Next.js App Router career-platform application for job seekers and recruiters. It combines profile/resume management, job and candidate workflows, AI-assisted career tools, interview practice, market exploration, and proactive career signals. The runtime includes React server/client components, Next.js route handlers, Prisma-backed persistence, and Inngest background execution.

Core entry points: `app/layout.js`, `app/page.js`, `middleware.js`, and `app/api/inngest/route.js`.

#### Route Segmentation and Access Boundaries
The UI is organized into authentication and protected/main route groups. Authentication screens are isolated under `app/(auth)/layout.js`; user-facing capabilities share `app/(main)/layout.jsx`; recruiter-specific workflows have an additional boundary at `app/(main)/recruiter/layout.jsx`.

Likely auth middleware enforcement and request gating are centralized in `middleware.js`. User records/profile bootstrap are represented by `actions/user.js` and `lib/db/checkUser.js`.

#### Domain Actions and Persistence Layer
Server-side domain operations are grouped by major entities: users, candidates, recruiters, jobs, resumes, cover letters, interviews, dashboard data, and signals. These action modules form the application-facing mutation/query boundary:
`actions/job.js`, `actions/candidate.js`, `actions/resume.js`, `actions/signals.js`.

Prisma defines the persistent model and migration history:
`prisma/schema.prisma`, `lib/db/prisma.js`, `prisma/migrations/20250114060115_create_models/migration.sql`.

#### Job-Seeker Experience
The main product flow supports onboarding/profile capture, resume construction, job/application access, AI cover-letter generation, dashboard analytics, and interview training. Route-level pages compose feature-local UI and invoke actions or API handlers:
`app/(main)/onboarding/page.jsx`, `app/(main)/resume/page.jsx`, `app/(main)/ai-cover-letter/page.jsx`.

Interview practice includes quiz/session views and a live-interview path; live evaluation is exposed as a server endpoint:
`app/(main)/interview/page.jsx`, `app/(main)/live-interview/page.jsx`, `app/api/evaluate-live-interview/route.js`.

#### Recruiter Workflow
Recruiter routes provide a separate operating surface for candidate discovery, job creation/listing, per-job hiring pipelines, and tracking analytics:
`app/(main)/recruiter/dashboard/page.jsx`, `app/(main)/recruiter/jobs/[id]/page.jsx`, `app/(main)/recruiter/candidate/[id]/page.jsx`.

The Kanban pipeline UI is a material workflow boundary for candidate/job-stage transitions:
`app/(main)/recruiter/jobs/[id]/_components/kanban-view.jsx`, `actions/recruiter.js`, `actions/candidate.js`.

#### AI, Career Intelligence, and Async Work
AI-backed capabilities include ATS resume generation/PDF creation, cover letters, cold DMs, interview questions, skill analysis, career simulation/risk/comparison, and recommendations. API routes provide the browser-to-server boundary:
`app/api/generate-ats-resume/route.js`, `app/api/career-simulate/route.js`, `app/api/skill/analyze/route.js`.

Gemini integration is abstracted behind pooled, cached AI clients:
`lib/ai/gemini-pool.js`, `lib/ai/gemini-with-cache.js`, `lib/ai/career-ai.js`.

Long-running TalentSync work is submitted, polled, and stored through distinct endpoints/services, with Inngest providing background orchestration:
`app/api/growth-tools/talentsync/start/route.js`, `app/api/growth-tools/talentsync/status/[jobId]/route.js`, `lib/inngest/function.js`.

#### Signals and External Exploration
The signals subsystem detects career events from performance, skill gaps, opportunities, and market changes; it correlates, scores, explains, and produces recommended actions. Its lifecycle API supports generation, retrieval, acknowledgment, resolution, and action state:
`lib/signals/signal-engine.js`, `lib/signals/correlation-engine.js`, `app/api/signals/generate/route.js`.

Explore APIs integrate external job, hackathon, and GitHub-repository data into the platform:
`app/api/explore/jobs/route.js`, `app/api/explore/hackathons/route.js`, `app/api/explore/github-repos/route.js`.

#### Client-Side Specialized Processing
Live-interview UI includes webcam analysis and ships face-api model assets for browser-side face/expression/landmark detection:
`components/WebcamAnalyzer.jsx`, `lib/utils/faceApiConfig.js`, `public/models/face-api`.

Main entry points: [`app/(main)/layout.jsx`](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(main)/layout.jsx) (Protected app shell), [`actions/candidate.js`](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/actions/candidate.js) (Domain actions), [`lib/db/prisma.js`](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/lib/db/prisma.js) (Prisma persistence), [`app/(main)/resume/page.jsx`](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(main)/resume/page.jsx) (Resume & cover letter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["App Router UI"]
  node_entry["App entry &amp; request gate<br/>Next.js entry<br/>[layout.js]"]
  node_auth["Auth route boundary<br/>route layout<br/>[layout.js]"]
  node_main["Protected app shell<br/>route layout<br/>[layout.jsx]"]
  node_onboarding["Onboarding &amp; profile<br/>page<br/>[page.jsx]"]
  node_career_tools["Resume &amp; cover letter<br/>pages<br/>[page.jsx]"]
  node_interview["Interview practice<br/>pages<br/>[page.jsx]"]
  node_recruiter["Recruiter workspace<br/>route boundary<br/>[layout.jsx]"]
  node_kanban["Hiring Kanban<br/>workflow UI<br/>[kanban-view.jsx]"]
  node_webcam["Webcam analysis<br/>browser processing<br/>[WebcamAnalyzer.jsx]"]
end

subgraph group_domain["Domain &amp; Data"]
  node_actions{{"Domain actions<br/>server actions<br/>[candidate.js]"}}
  node_user_bootstrap["User bootstrap<br/>identity service<br/>[checkUser.js]"]
  node_prisma[("Prisma persistence<br/>ORM<br/>[prisma.js]")]
  node_schema[("Data model &amp; migrations<br/>database schema<br/>[schema.prisma]")]
end

subgraph group_intelligence["AI &amp; Intelligence"]
  node_ai_api{{"AI career APIs<br/>route handlers<br/>[route.js]"}}
  node_gemini["Gemini AI layer<br/>AI client"]
  node_signals["Career signals engine<br/>intelligence engine<br/>[signal-engine.js]"]
  node_signals_api{{"Signals lifecycle API<br/>route handler<br/>[route.js]"}}
  node_talentsync["TalentSync workflow<br/>async orchestration<br/>[function.js]"]
  node_inngest_api{{"Inngest endpoint<br/>route handler<br/>[route.js]"}}
  node_live_evaluation{{"Live evaluation API<br/>route handler<br/>[route.js]"}}
end

subgraph group_integrations["External Exploration"]
  node_explore{{"Explore data APIs<br/>route handlers<br/>[route.js]"}}
end

node_entry -->|"routes unauthenticated users"| node_auth
node_entry -->|"gates protected requests"| node_main
node_main -->|"hosts"| node_onboarding
node_main -->|"hosts"| node_career_tools
node_main -->|"hosts"| node_interview
node_main -->|"scopes recruiter access"| node_recruiter
node_recruiter -->|"hosts job pipeline"| node_kanban
node_onboarding -->|"initializes profile"| node_user_bootstrap
node_user_bootstrap -->|"reads and creates user"| node_prisma
node_career_tools -->|"manages resumes and applications"| node_actions
node_recruiter -->|"queries jobs and candidates"| node_actions
node_kanban -->|"updates hiring stages"| node_actions
node_actions -->|"persists domain state"| node_prisma
node_prisma -->|"implements"| node_schema
node_career_tools -->|"requests generation"| node_ai_api
node_ai_api -->|"uses AI capabilities"| node_gemini
node_interview -->|"analyzes webcam locally"| node_webcam
node_interview -->|"submits live evaluation"| node_live_evaluation
node_signals_api -->|"generates and manages signals"| node_signals
node_signals -->|"stores signal state"| node_prisma
node_inngest_api -->|"registers background functions"| node_talentsync
node_talentsync -->|"stores job progress"| node_prisma
node_explore -.->|"feeds market workflows"| node_actions

click node_entry "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/layout.js"
click node_auth "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(auth)/layout.js"
click node_main "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(main)/layout.jsx"
click node_onboarding "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(main)/onboarding/page.jsx"
click node_career_tools "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(main)/resume/page.jsx"
click node_interview "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(main)/live-interview/page.jsx"
click node_recruiter "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(main)/recruiter/layout.jsx"
click node_kanban "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(main)/recruiter/jobs/%5Bid%5D/_components/kanban-view.jsx"
click node_actions "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/actions/candidate.js"
click node_user_bootstrap "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/lib/db/checkUser.js"
click node_prisma "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/lib/db/prisma.js"
click node_schema "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/prisma/schema.prisma"
click node_ai_api "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/api/generate-ats-resume/route.js"
click node_gemini "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/lib/ai/gemini-with-cache.js"
click node_signals "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/lib/signals/signal-engine.js"
click node_signals_api "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/api/signals/generate/route.js"
click node_talentsync "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/lib/inngest/function.js"
click node_inngest_api "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/api/inngest/route.js"
click node_explore "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/api/explore/jobs/route.js"
click node_webcam "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/components/WebcamAnalyzer.jsx"
click node_live_evaluation "https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/api/evaluate-live-interview/route.js"

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_entry,node_auth,node_main,node_onboarding,node_career_tools,node_interview,node_recruiter,node_kanban,node_webcam toneBlue
class node_actions,node_user_bootstrap,node_prisma,node_schema toneAmber
class node_ai_api,node_gemini,node_signals,node_signals_api,node_talentsync,node_inngest_api,node_live_evaluation toneMint
class node_explore toneRose
```

## Components

### App Router UI

User and recruiter route surfaces.

- [App entry & request gate](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/layout.js): Next.js entry · `app/layout.js`
- [Auth route boundary](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(auth)/layout.js): route layout · `app/(auth)/layout.js`
- [Protected app shell](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(main)/layout.jsx): route layout · `app/(main)/layout.jsx`
- [Onboarding & profile](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(main)/onboarding/page.jsx): page · `app/(main)/onboarding/page.jsx`
- [Resume & cover letter](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(main)/resume/page.jsx): pages · `app/(main)/resume/page.jsx`
- [Interview practice](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(main)/live-interview/page.jsx): pages · Includes live interview evaluation. · `app/(main)/live-interview/page.jsx`
- [Recruiter workspace](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(main)/recruiter/layout.jsx): route boundary · `app/(main)/recruiter/layout.jsx`
- [Hiring Kanban](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/(main)/recruiter/jobs/%5Bid%5D/_components/kanban-view.jsx): workflow UI · Moves candidates through job stages. · `app/(main)/recruiter/jobs/[id]/_components/kanban-view.jsx`
- [Webcam analysis](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/components/WebcamAnalyzer.jsx): browser processing · Face and expression analysis using bundled models. · `components/WebcamAnalyzer.jsx`

### Domain & Data

Server action boundary and persistence.

- [Domain actions](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/actions/candidate.js): server actions · Application query and mutation boundary. · `actions/candidate.js`
- [User bootstrap](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/lib/db/checkUser.js): identity service · `lib/db/checkUser.js`
- [Prisma persistence](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/lib/db/prisma.js): ORM · `lib/db/prisma.js`
- [Data model & migrations](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/prisma/schema.prisma): database schema · `prisma/schema.prisma`

### AI & Intelligence

AI, signals, and asynchronous processing.

- [AI career APIs](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/api/generate-ats-resume/route.js): route handlers · Resume, career simulation, and skill-analysis endpoints. · `app/api/generate-ats-resume/route.js`
- [Gemini AI layer](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/lib/ai/gemini-with-cache.js): AI client · Pooled and cached model access. · `lib/ai/gemini-with-cache.js`
- [Career signals engine](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/lib/signals/signal-engine.js): intelligence engine · Correlates, scores, explains, and recommends actions. · `lib/signals/signal-engine.js`
- [Signals lifecycle API](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/api/signals/generate/route.js): route handler · `app/api/signals/generate/route.js`
- [TalentSync workflow](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/lib/inngest/function.js): async orchestration · Background submission, polling, and storage. · `lib/inngest/function.js`
- [Inngest endpoint](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/api/inngest/route.js): route handler · `app/api/inngest/route.js`
- [Live evaluation API](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/api/evaluate-live-interview/route.js): route handler · `app/api/evaluate-live-interview/route.js`

### External Exploration

Third-party market data sources.

- [Explore data APIs](https://github.com/nallakshit-ops/careerpilotai-signallabs/blob/main/app/api/explore/jobs/route.js): route handlers · Jobs, hackathons, and GitHub repositories. · `app/api/explore/jobs/route.js`

## Connections

- App entry & request gate → Auth route boundary: routes unauthenticated users
- App entry & request gate → Protected app shell: gates protected requests
- Protected app shell → Onboarding & profile: hosts
- Protected app shell → Resume & cover letter: hosts
- Protected app shell → Interview practice: hosts
- Protected app shell → Recruiter workspace: scopes recruiter access
- Recruiter workspace → Hiring Kanban: hosts job pipeline
- Onboarding & profile → User bootstrap: initializes profile
- User bootstrap → Prisma persistence: reads and creates user
- Resume & cover letter → Domain actions: manages resumes and applications
- Recruiter workspace → Domain actions: queries jobs and candidates
- Hiring Kanban → Domain actions: updates hiring stages
- Domain actions → Prisma persistence: persists domain state
- Prisma persistence → Data model & migrations: implements
- Resume & cover letter → AI career APIs: requests generation
- AI career APIs → Gemini AI layer: uses AI capabilities
- Interview practice → Webcam analysis: analyzes webcam locally
- Interview practice → Live evaluation API: submits live evaluation
- Signals lifecycle API → Career signals engine: generates and manages signals
- Career signals engine → Prisma persistence: stores signal state
- Inngest endpoint → TalentSync workflow: registers background functions
- TalentSync workflow → Prisma persistence: stores job progress
- Explore data APIs → Domain actions: feeds market workflows
