# code-well0/sensai architecture

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

- Interactive diagram: https://gitdiagram.com/code-well0/sensai
- Repository: https://github.com/code-well0/sensai

## Overview

SensAI is an AI-assisted career-growth web app. A signed-in job seeker completes industry and skills onboarding, then uses the dashboard and growth tools: interview quizzes produce feedback and saved assessments; resume and cover-letter tools create career documents; the dashboard presents market insights and progress. Server actions and background jobs provide the application layer over persistent user and career data. README capabilities fill in unsampled areas; relationships not visible in the excerpts are omitted or marked unverified.

Main entry points: [`lib/prisma.js`](https://github.com/code-well0/sensai/blob/main/lib/prisma.js) (Application database), [`actions/cover-letter.js`](https://github.com/code-well0/sensai/blob/main/actions/cover-letter.js) (Cover letter actions), [`actions/interview.js`](https://github.com/code-well0/sensai/blob/main/actions/interview.js) (Interview actions), [`app/(main)/dashboard/_components/dashboard-view.jsx`](https://github.com/code-well0/sensai/blob/main/app/(main)/dashboard/_components/dashboard-view.jsx) (Insights dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Access and profile"]
  node_authpages["Sign in/up<br/>[page.jsx]"]
  node_profile["Profile onboarding"]
  node_useractions["User profile actions<br/>[user.js]"]
  node_usercheck["User provisioning<br/>[checkUser.js]"]
  node_landing["Product landing page<br/>[page.jsx]"]
  node_faqs["FAQ content<br/>[faqs.js]"]
end

subgraph group_insights["Career insights"]
  node_dashboard["Insights dashboard<br/>[dashboard-view.jsx]"]
  node_dashboardactions["Industry insight actions<br/>[dashboard.js]"]
  node_industrydata["Industry reference data<br/>[industries.js]"]
end

subgraph group_interview["Interview preparation"]
  node_interviewpage["Interview overview<br/>[page.jsx]"]
  node_quiz["Quiz experience<br/>[quiz.jsx]"]
  node_assessmentactions["Interview actions<br/>[interview.js]"]
  node_assessmentviews["Assessment analytics"]
end

subgraph group_documents["Career documents"]
  node_resume["Resume builder<br/>[resume-builder.jsx]"]
  node_resumeform["Resume entry editor<br/>[entry-form.jsx]"]
  node_resumeactions["Resume actions<br/>[resume.js]"]
  node_coverpage["Cover letter library<br/>[page.jsx]"]
  node_covergenerator["Cover letter generator"]
  node_coveractions["Cover letter actions<br/>[cover-letter.js]"]
  node_coverpreview["Letter preview"]
end

subgraph group_platform["Application services"]
  node_clerk{{"Clerk identity"}}
  node_db[("Application database<br/>[prisma.js]")]
  node_gemini{{"Google Gemini"}}
  node_inngestroute["Inngest endpoint<br/>[route.js]"]
  node_insightjob["Industry insight job<br/>[functions.js]"]
end

node_jobseeker(("Job seeker"))

node_jobseeker -->|"signs in"| node_authpages
node_jobseeker -.->|"sets up profile"| node_profile
node_authpages -->|"authenticates"| node_clerk
node_usercheck -->|"looks up identity"| node_clerk
node_usercheck -->|"finds or creates user"| node_db
node_profile -.->|"submits profile"| node_useractions
node_jobseeker -->|"views insights"| node_dashboard
node_dashboard -->|"requests insights"| node_dashboardactions
node_dashboardactions -.->|"reads career data"| node_db
node_jobseeker -->|"prepares"| node_interviewpage
node_interviewpage -->|"loads assessments"| node_assessmentactions
node_assessmentactions -->|"reads and saves results"| node_db
node_quiz -.->|"generates and saves quiz"| node_assessmentactions
node_assessmentactions -->|"generates questions and tips"| node_gemini
node_interviewpage -->|"renders analytics"| node_assessmentviews
node_jobseeker -->|"builds resume"| node_resume
node_resume -.->|"edits entries"| node_resumeform
node_resume -.->|"manages resume"| node_resumeactions
node_resumeactions -.->|"persists resume"| node_db
node_jobseeker -->|"creates letter"| node_covergenerator
node_covergenerator -.->|"submits generation"| node_coveractions
node_coveractions -->|"generates letter"| node_gemini
node_coveractions -->|"saves and retrieves letters"| node_db
node_coverpage -->|"loads letters"| node_coveractions
node_coverpreview -.->|"renders letter content"| node_coveractions
node_inngestroute -->|"registers function"| node_insightjob
node_insightjob -.->|"generates insights"| node_gemini
node_insightjob -.->|"stores insights"| node_db
node_dashboard -.->|"uses industry data"| node_industrydata
node_landing -->|"renders FAQs"| node_faqs

click node_authpages "https://github.com/code-well0/sensai/blob/main/app/(auth)/sign-in/%5B%5B...sign-in%5D%5D/page.jsx"
click node_profile "https://github.com/code-well0/sensai/blob/main/app/(main)/onboarding/_components/onboarding-form.jsx"
click node_useractions "https://github.com/code-well0/sensai/blob/main/actions/user.js"
click node_usercheck "https://github.com/code-well0/sensai/blob/main/lib/checkUser.js"
click node_dashboard "https://github.com/code-well0/sensai/blob/main/app/(main)/dashboard/_components/dashboard-view.jsx"
click node_dashboardactions "https://github.com/code-well0/sensai/blob/main/actions/dashboard.js"
click node_industrydata "https://github.com/code-well0/sensai/blob/main/data/industries.js"
click node_interviewpage "https://github.com/code-well0/sensai/blob/main/app/(main)/interview/page.jsx"
click node_quiz "https://github.com/code-well0/sensai/blob/main/app/(main)/interview/_components/quiz.jsx"
click node_assessmentactions "https://github.com/code-well0/sensai/blob/main/actions/interview.js"
click node_assessmentviews "https://github.com/code-well0/sensai/blob/main/app/(main)/interview/_components/performance-chart.jsx"
click node_resume "https://github.com/code-well0/sensai/blob/main/app/(main)/resume/_components/resume-builder.jsx"
click node_resumeform "https://github.com/code-well0/sensai/blob/main/app/(main)/resume/_components/entry-form.jsx"
click node_resumeactions "https://github.com/code-well0/sensai/blob/main/actions/resume.js"
click node_coverpage "https://github.com/code-well0/sensai/blob/main/app/(main)/ai-cover-letter/page.jsx"
click node_covergenerator "https://github.com/code-well0/sensai/blob/main/app/(main)/ai-cover-letter/_components/cover-letter-generator.jsx"
click node_coveractions "https://github.com/code-well0/sensai/blob/main/actions/cover-letter.js"
click node_coverpreview "https://github.com/code-well0/sensai/blob/main/app/(main)/ai-cover-letter/_components/cover-letter-preview.jsx"
click node_db "https://github.com/code-well0/sensai/blob/main/lib/prisma.js"
click node_inngestroute "https://github.com/code-well0/sensai/blob/main/app/api/inngest/route.js"
click node_insightjob "https://github.com/code-well0/sensai/blob/main/lib/inngest/functions.js"
click node_landing "https://github.com/code-well0/sensai/blob/main/app/page.jsx"
click node_faqs "https://github.com/code-well0/sensai/blob/main/data/faqs.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_authpages,node_profile,node_useractions,node_usercheck,node_landing,node_faqs toneBlue
class node_dashboard,node_dashboardactions,node_industrydata toneAmber
class node_interviewpage,node_quiz,node_assessmentactions,node_assessmentviews toneMint
class node_resume,node_resumeform,node_resumeactions,node_coverpage,node_covergenerator,node_coveractions,node_coverpreview toneRose
class node_clerk,node_db,node_gemini,node_inngestroute,node_insightjob,node_jobseeker toneIndigo
```

## Components

### Access and profile

- [Sign in/up](https://github.com/code-well0/sensai/blob/main/app/(auth)/sign-in/%5B%5B...sign-in%5D%5D/page.jsx): `app/(auth)/sign-in/[[...sign-in]]/page.jsx`
- [Profile onboarding](https://github.com/code-well0/sensai/blob/main/app/(main)/onboarding/_components/onboarding-form.jsx): `app/(main)/onboarding/_components/onboarding-form.jsx`
- [User profile actions](https://github.com/code-well0/sensai/blob/main/actions/user.js): `actions/user.js`
- [User provisioning](https://github.com/code-well0/sensai/blob/main/lib/checkUser.js): `lib/checkUser.js`
- [Product landing page](https://github.com/code-well0/sensai/blob/main/app/page.jsx): `app/page.jsx`
- [FAQ content](https://github.com/code-well0/sensai/blob/main/data/faqs.js): `data/faqs.js`

### Career insights

- [Insights dashboard](https://github.com/code-well0/sensai/blob/main/app/(main)/dashboard/_components/dashboard-view.jsx): `app/(main)/dashboard/_components/dashboard-view.jsx`
- [Industry insight actions](https://github.com/code-well0/sensai/blob/main/actions/dashboard.js): `actions/dashboard.js`
- [Industry reference data](https://github.com/code-well0/sensai/blob/main/data/industries.js): `data/industries.js`

### Interview preparation

- [Interview overview](https://github.com/code-well0/sensai/blob/main/app/(main)/interview/page.jsx): `app/(main)/interview/page.jsx`
- [Quiz experience](https://github.com/code-well0/sensai/blob/main/app/(main)/interview/_components/quiz.jsx): `app/(main)/interview/_components/quiz.jsx`
- [Interview actions](https://github.com/code-well0/sensai/blob/main/actions/interview.js): `actions/interview.js`
- [Assessment analytics](https://github.com/code-well0/sensai/blob/main/app/(main)/interview/_components/performance-chart.jsx): `app/(main)/interview/_components/performance-chart.jsx`

### Career documents

- [Resume builder](https://github.com/code-well0/sensai/blob/main/app/(main)/resume/_components/resume-builder.jsx): `app/(main)/resume/_components/resume-builder.jsx`
- [Resume entry editor](https://github.com/code-well0/sensai/blob/main/app/(main)/resume/_components/entry-form.jsx): `app/(main)/resume/_components/entry-form.jsx`
- [Resume actions](https://github.com/code-well0/sensai/blob/main/actions/resume.js): `actions/resume.js`
- [Cover letter library](https://github.com/code-well0/sensai/blob/main/app/(main)/ai-cover-letter/page.jsx): `app/(main)/ai-cover-letter/page.jsx`
- [Cover letter generator](https://github.com/code-well0/sensai/blob/main/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/code-well0/sensai/blob/main/actions/cover-letter.js): `actions/cover-letter.js`
- [Letter preview](https://github.com/code-well0/sensai/blob/main/app/(main)/ai-cover-letter/_components/cover-letter-preview.jsx): `app/(main)/ai-cover-letter/_components/cover-letter-preview.jsx`

### Application services

- **Clerk identity**
- [Application database](https://github.com/code-well0/sensai/blob/main/lib/prisma.js): `lib/prisma.js`
- **Google Gemini**
- [Inngest endpoint](https://github.com/code-well0/sensai/blob/main/app/api/inngest/route.js): `app/api/inngest/route.js`
- [Industry insight job](https://github.com/code-well0/sensai/blob/main/lib/inngest/functions.js): `lib/inngest/functions.js`

### Other components

- **Job seeker**

## Connections

- Job seeker → Sign in/up: signs in
- Job seeker → Profile onboarding: sets up profile
- Sign in/up → Clerk identity: authenticates
- User provisioning → Clerk identity: looks up identity (evidence: `lib/checkUser.js`)
- User provisioning → Application database: finds or creates user (evidence: `lib/checkUser.js`)
- Profile onboarding → User profile actions: submits profile
- Job seeker → Insights dashboard: views insights
- Insights dashboard → Industry insight actions: requests insights (evidence: `app/(main)/dashboard/page.jsx`)
- Industry insight actions → Application database: reads career data
- Job seeker → Interview overview: prepares
- Interview overview → Interview actions: loads assessments (evidence: `app/(main)/interview/page.jsx`)
- Interview actions → Application database: reads and saves results (evidence: `actions/interview.js`)
- Quiz experience → Interview actions: generates and saves quiz
- Interview actions → Google Gemini: generates questions and tips (evidence: `actions/interview.js`)
- Interview overview → Assessment analytics: renders analytics (evidence: `app/(main)/interview/page.jsx`)
- Job seeker → Resume builder: builds resume
- Resume builder → Resume entry editor: edits entries
- Resume builder → Resume actions: manages resume
- Resume actions → Application database: persists resume
- Job seeker → Cover letter generator: creates letter
- Cover letter generator → Cover letter actions: submits generation
- Cover letter actions → Google Gemini: generates letter (evidence: `actions/cover-letter.js`)
- Cover letter actions → Application database: saves and retrieves letters (evidence: `actions/cover-letter.js`)
- Cover letter library → Cover letter actions: loads letters (evidence: `app/(main)/ai-cover-letter/page.jsx`)
- Letter preview → Cover letter actions: renders letter content
- Inngest endpoint → Industry insight job: registers function (evidence: `app/api/inngest/route.js`)
- Industry insight job → Google Gemini: generates insights
- Industry insight job → Application database: stores insights
- Insights dashboard → Industry reference data: uses industry data
- Product landing page → FAQ content: renders FAQs (evidence: `app/page.jsx`)
