# apoorvsharma964/career-coach architecture

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

- Interactive diagram: https://gitdiagram.com/apoorvsharma964/career-coach
- Repository: https://github.com/apoorvsharma964/career-coach

## Overview

This is a Next.js career-development app whose main workflow is account setup and onboarding, followed by resume editing with a live preview and access to dashboard, cover-letter, and interview-coaching features. Server actions handle profile, dashboard, cover-letter, and assessment work; Prisma is the shared persistence layer, while Gemini powers documented AI generation. The graph includes documented capabilities whose implementation was not sampled; those links are dashed where runtime wiring is not evidenced in the excerpts.

Main entry points: [`lib/prisma.js`](https://github.com/apoorvsharma964/career-coach/blob/master/lib/prisma.js) (PostgreSQL via Prisma), [`actions/cover-letter.js`](https://github.com/apoorvsharma964/career-coach/blob/master/actions/cover-letter.js) (Cover-letter actions), [`actions/user.js`](https://github.com/apoorvsharma964/career-coach/blob/master/actions/user.js) (User profile actions), [`actions/dashboard.js`](https://github.com/apoorvsharma964/career-coach/blob/master/actions/dashboard.js) (Dashboard actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and profile"]
  node_onboarding["Profile onboarding"]
  node_profile["User profile actions<br/>[user.js]"]
  node_dashboard["Dashboard view<br/>[dashboard-view.jsx]"]
  node_dashboard_data["Dashboard actions<br/>[dashboard.js]"]
end

subgraph group_resume["Resume workspace"]
  node_resume_page["Resume editor<br/>[page.jsx]"]
  node_resume_form["Resume form<br/>[resume-form.jsx]"]
  node_resume_context["Resume state<br/>[ResumeContext.jsx]"]
  node_resume_preview["Live preview<br/>[resume-preview.jsx]"]
  node_resume_ai["AI resume generation"]
end

subgraph group_career["Career tools"]
  node_cover_page["Cover-letter pages<br/>[page.jsx]"]
  node_cover_list["Cover-letter list"]
  node_cover_generator["Cover-letter generator"]
  node_cover_actions["Cover-letter actions<br/>[cover-letter.js]"]
  node_interview_page["Interview coaching<br/>[page.jsx]"]
  node_interview_actions["Interview actions<br/>[interview.js]"]
end

subgraph group_services["Application services"]
  node_clerk{{"Clerk auth"}}
  node_inngest_route["Inngest endpoint<br/>[route.js]"]
  node_insight_job["Industry insights job<br/>[functions.js]"]
  node_gemini{{"Gemini API"}}
  node_database[("PostgreSQL via Prisma<br/>[prisma.js]")]
end

node_user(("Career user"))

node_user -->|"sets up profile"| node_onboarding
node_onboarding -->|"submits profile"| node_profile
node_profile -->|"requests insights"| node_dashboard_data
node_dashboard_data -->|"reads data"| node_database
node_dashboard_data -->|"supplies dashboard"| node_dashboard
node_user -.->|"edits resume"| node_resume_page
node_resume_page -->|"renders"| node_resume_form
node_resume_page -->|"renders"| node_resume_preview
node_resume_form -->|"uses state"| node_resume_context
node_resume_preview -->|"reads state"| node_resume_context
node_resume_ai -.->|"generates content"| node_gemini
node_resume_ai -.->|"stores resume data"| node_database
node_user -.->|"creates letters"| node_cover_page
node_cover_page -->|"renders list"| node_cover_list
node_cover_list -->|"loads letters"| node_cover_actions
node_cover_generator -.->|"generates letter"| node_cover_actions
node_cover_actions -->|"generates text"| node_gemini
node_cover_actions -->|"reads and writes"| node_database
node_user -.->|"practices interviews"| node_interview_page
node_interview_page -->|"loads assessments"| node_interview_actions
node_interview_actions -->|"generates questions"| node_gemini
node_interview_actions -->|"stores results"| node_database
node_inngest_route -->|"registers job"| node_insight_job
node_insight_job -->|"reads and writes"| node_database
node_profile -->|"authenticates user"| node_clerk

click node_onboarding "https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/onboarding/_components/onboarding-form.jsx"
click node_profile "https://github.com/apoorvsharma964/career-coach/blob/master/actions/user.js"
click node_dashboard "https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/dashboard/_components/dashboard-view.jsx"
click node_dashboard_data "https://github.com/apoorvsharma964/career-coach/blob/master/actions/dashboard.js"
click node_resume_page "https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/resume/page.jsx"
click node_resume_form "https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/resume/_components/resume-form.jsx"
click node_resume_context "https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/resume/_components/ResumeContext.jsx"
click node_resume_preview "https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/resume/_components/resume-preview.jsx"
click node_resume_ai "https://github.com/apoorvsharma964/career-coach/tree/master/app/(main)/resume"
click node_cover_page "https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/ai-cover-letter/page.jsx"
click node_cover_list "https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/ai-cover-letter/_components/cover-letter-list.jsx"
click node_cover_generator "https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/ai-cover-letter/_components/cover-letter-generator.jsx"
click node_cover_actions "https://github.com/apoorvsharma964/career-coach/blob/master/actions/cover-letter.js"
click node_interview_page "https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/interview/page.jsx"
click node_interview_actions "https://github.com/apoorvsharma964/career-coach/blob/master/actions/interview.js"
click node_inngest_route "https://github.com/apoorvsharma964/career-coach/blob/master/app/api/inngest/route.js"
click node_insight_job "https://github.com/apoorvsharma964/career-coach/blob/master/lib/inngest/functions.js"
click node_database "https://github.com/apoorvsharma964/career-coach/blob/master/lib/prisma.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_onboarding,node_profile,node_dashboard,node_dashboard_data,node_user toneBlue
class node_resume_page,node_resume_form,node_resume_context,node_resume_preview,node_resume_ai toneAmber
class node_cover_page,node_cover_list,node_cover_generator,node_cover_actions,node_interview_page,node_interview_actions toneMint
class node_clerk,node_inngest_route,node_insight_job,node_gemini,node_database toneRose
```

## Components

### Entry and profile

- [Profile onboarding](https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/onboarding/_components/onboarding-form.jsx): `app/(main)/onboarding/_components/onboarding-form.jsx`
- [User profile actions](https://github.com/apoorvsharma964/career-coach/blob/master/actions/user.js): `actions/user.js`
- [Dashboard view](https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/dashboard/_components/dashboard-view.jsx): `app/(main)/dashboard/_components/dashboard-view.jsx`
- [Dashboard actions](https://github.com/apoorvsharma964/career-coach/blob/master/actions/dashboard.js): `actions/dashboard.js`

### Resume workspace

- [Resume editor](https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/resume/page.jsx): `app/(main)/resume/page.jsx`
- [Resume form](https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/resume/_components/resume-form.jsx): `app/(main)/resume/_components/resume-form.jsx`
- [Resume state](https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/resume/_components/ResumeContext.jsx): `app/(main)/resume/_components/ResumeContext.jsx`
- [Live preview](https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/resume/_components/resume-preview.jsx): `app/(main)/resume/_components/resume-preview.jsx`
- [AI resume generation](https://github.com/apoorvsharma964/career-coach/tree/master/app/(main)/resume): `app/(main)/resume`

### Career tools

- [Cover-letter pages](https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/ai-cover-letter/page.jsx): `app/(main)/ai-cover-letter/page.jsx`
- [Cover-letter list](https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/ai-cover-letter/_components/cover-letter-list.jsx): `app/(main)/ai-cover-letter/_components/cover-letter-list.jsx`
- [Cover-letter generator](https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/ai-cover-letter/_components/cover-letter-generator.jsx): `app/(main)/ai-cover-letter/_components/cover-letter-generator.jsx`
- [Cover-letter actions](https://github.com/apoorvsharma964/career-coach/blob/master/actions/cover-letter.js): `actions/cover-letter.js`
- [Interview coaching](https://github.com/apoorvsharma964/career-coach/blob/master/app/(main)/interview/page.jsx): `app/(main)/interview/page.jsx`
- [Interview actions](https://github.com/apoorvsharma964/career-coach/blob/master/actions/interview.js): `actions/interview.js`

### Application services

- **Clerk auth**
- [Inngest endpoint](https://github.com/apoorvsharma964/career-coach/blob/master/app/api/inngest/route.js): `app/api/inngest/route.js`
- [Industry insights job](https://github.com/apoorvsharma964/career-coach/blob/master/lib/inngest/functions.js): `lib/inngest/functions.js`
- **Gemini API**
- [PostgreSQL via Prisma](https://github.com/apoorvsharma964/career-coach/blob/master/lib/prisma.js): `lib/prisma.js`

### Other components

- **Career user**

## Connections

- Career user → Profile onboarding: sets up profile
- Profile onboarding → User profile actions: submits profile (evidence: `app/(main)/onboarding/_components/onboarding-form.jsx`)
- User profile actions → Dashboard actions: requests insights (evidence: `actions/user.js`)
- Dashboard actions → PostgreSQL via Prisma: reads data (evidence: `actions/dashboard.js`)
- Dashboard actions → Dashboard view: supplies dashboard (evidence: `app/(main)/dashboard/page.jsx`)
- Career user → Resume editor: edits resume
- Resume editor → Resume form: renders (evidence: `app/(main)/resume/page.jsx`)
- Resume editor → Live preview: renders (evidence: `app/(main)/resume/page.jsx`)
- Resume form → Resume state: uses state (evidence: `app/(main)/resume/_components/resume-form.jsx`)
- Live preview → Resume state: reads state (evidence: `app/(main)/resume/_components/resume-preview.jsx`)
- AI resume generation → Gemini API: generates content
- AI resume generation → PostgreSQL via Prisma: stores resume data
- Career user → Cover-letter pages: creates letters
- Cover-letter pages → Cover-letter list: renders list (evidence: `app/(main)/ai-cover-letter/page.jsx`)
- Cover-letter list → Cover-letter actions: loads letters (evidence: `app/(main)/ai-cover-letter/_components/cover-letter-list.jsx`)
- Cover-letter generator → Cover-letter actions: generates letter
- Cover-letter actions → Gemini API: generates text (evidence: `actions/cover-letter.js`)
- Cover-letter actions → PostgreSQL via Prisma: reads and writes (evidence: `actions/cover-letter.js`)
- Career user → Interview coaching: practices interviews
- Interview coaching → Interview actions: loads assessments (evidence: `app/(main)/interview/page.jsx`)
- Interview actions → Gemini API: generates questions (evidence: `actions/interview.js`)
- Interview actions → PostgreSQL via Prisma: stores results (evidence: `actions/interview.js`)
- Inngest endpoint → Industry insights job: registers job (evidence: `app/api/inngest/route.js`)
- Industry insights job → PostgreSQL via Prisma: reads and writes (evidence: `lib/inngest/functions.js`)
- User profile actions → Clerk auth: authenticates user (evidence: `actions/user.js`)
