# gaballagit/cpsc-491-ai-career-buddy architecture

> Architecture diagram of the GitHub repository gaballagit/cpsc-491-ai-career-buddy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gaballagit/cpsc-491-ai-career-buddy
- Repository: https://github.com/gaballagit/cpsc-491-ai-career-buddy

## Overview

CareerLM is a career-assistance product with a Next.js interface, an Express API, and a Supabase resume Edge Function. The main user flow is to create a career profile, then use profile, project, job, and resume features through the site. API route registrations and several frontend-to-client and function-to-helper calls are supported by excerpts; some backend implementation details and the site’s API proxy wiring are unsampled, so those relationships are left unasserted or marked unverified.

Main entry points: [`supabase/functions/resume/handler.ts`](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/resume/handler.ts) (Resume request handler), [`api/src/routes.ts`](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/routes.ts) (API routing), [`api/src/database/client.ts`](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/database/client.ts) (Supabase client), [`site/career-buddy-site/lib/careerProfile.ts`](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/lib/careerProfile.ts) (Profile client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Career site"]
  node_onboarding["Profile onboarding<br/>[page.tsx]"]
  node_profile_ui["Profile views<br/>[page.tsx]"]
  node_profile_edit["Edit profile<br/>[page.tsx]"]
  node_dashboard["Career dashboard<br/>[page.tsx]"]
  node_profile_client["Profile client<br/>[careerProfile.ts]"]
  node_jobs_ui["Job listings<br/>[job-list.tsx]"]
  node_job_client["Jobs client<br/>[jobs.ts]"]
  node_projects_ui["Project portfolio<br/>[page.tsx]"]
  node_project_client["Projects client<br/>[projects.ts]"]
  node_resume_ui["Resume workspace<br/>[page.tsx]"]
  node_resume_client["Resume client<br/>[resume.ts]"]
end

subgraph group_api["Backend API"]
  node_api_routes["API routing<br/>[routes.ts]"]
  node_profile_ctrl["Profile controller<br/>[careerProfile.ts]"]
  node_jobs_ctrl["Jobs controller<br/>[jobs.ts]"]
  node_projects_ctrl["Projects controller<br/>[projects.ts]"]
  node_resumes_ctrl["Resume controller<br/>[resumes.ts]"]
  node_job_matching["Job matching<br/>[jobMatching.ts]"]
  node_skill_gap["Skill gap analysis<br/>[skillGap.ts]"]
  node_skill_utils["Skill utilities<br/>[skills.ts]"]
  node_validation["Input validation<br/>[validation.ts]"]
end

subgraph group_data["Persistence"]
  node_profile_repo["Profile repository"]
  node_jobs_repo["Jobs repository<br/>[jobRepository.ts]"]
  node_projects_repo["Projects repository"]
  node_resume_repo["Resume repository"]
  node_db_client["Supabase client<br/>[client.ts]"]
end

subgraph group_edge["Resume function"]
  node_edge_handler["Resume request handler<br/>[handler.ts]"]
  node_edge_auth["Function authentication<br/>[auth.ts]"]
  node_resume_validate["File validation<br/>[validate.ts]"]
  node_resume_extract["Text extraction<br/>[extract.ts]"]
  node_resume_skills["Skill extraction<br/>[skills.ts]"]
  node_edge_store["Resume skills store<br/>[repository.ts]"]
  node_http_helpers["HTTP responses<br/>[http.ts]"]
end

node_user(("Career seeker"))
node_database[("Supabase data store")]

node_user -->|"starts profile"| node_onboarding
node_onboarding -->|"saves profile"| node_profile_client
node_profile_ui -->|"loads profile"| node_profile_client
node_profile_edit -->|"loads and saves"| node_profile_client
node_dashboard -->|"loads profile"| node_profile_client
node_dashboard -->|"loads projects"| node_project_client
node_jobs_ui -->|"loads jobs"| node_job_client
node_projects_ui -->|"uses client"| node_project_client
node_resume_ui -->|"loads saved skills"| node_resume_client
node_user -.->|"makes API requests"| node_api_routes
node_api_routes -->|"routes profile"| node_profile_ctrl
node_api_routes -->|"routes jobs"| node_jobs_ctrl
node_api_routes -->|"routes projects"| node_projects_ctrl
node_api_routes -->|"routes resumes"| node_resumes_ctrl
node_profile_ctrl -->|"uses repository"| node_profile_repo
node_profile_ctrl -->|"validates input"| node_validation
node_jobs_ctrl -->|"uses repository"| node_jobs_repo
node_profile_repo -->|"gets client"| node_db_client
node_jobs_repo -->|"reads jobs"| node_db_client
node_projects_repo -->|"gets client"| node_db_client
node_db_client -.->|"connects to"| node_database
node_user -.->|"uploads resume"| node_edge_handler
node_edge_handler -->|"authenticates request"| node_edge_auth
node_edge_handler -->|"validates file"| node_resume_validate
node_edge_handler -->|"extracts text"| node_resume_extract
node_edge_handler -->|"extracts skills"| node_resume_skills
node_edge_handler -->|"loads and saves"| node_edge_store
node_edge_handler -->|"formats responses"| node_http_helpers
node_edge_store -->|"normalizes skills"| node_skill_utils
node_resume_extract -->|"uses errors"| node_http_helpers

click node_onboarding "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/app/onboarding/page.tsx"
click node_profile_ui "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/app/profile/page.tsx"
click node_profile_edit "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/app/profile/edit/page.tsx"
click node_dashboard "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/app/dashboard/page.tsx"
click node_profile_client "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/lib/careerProfile.ts"
click node_jobs_ui "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/components/job-list.tsx"
click node_job_client "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/lib/jobs.ts"
click node_projects_ui "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/app/projects/page.tsx"
click node_project_client "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/lib/projects.ts"
click node_resume_ui "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/app/resume/page.tsx"
click node_resume_client "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/lib/resume.ts"
click node_api_routes "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/routes.ts"
click node_profile_ctrl "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/controllers/careerProfile.ts"
click node_jobs_ctrl "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/controllers/jobs.ts"
click node_projects_ctrl "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/controllers/projects.ts"
click node_resumes_ctrl "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/controllers/resumes.ts"
click node_job_matching "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/services/jobMatching.ts"
click node_skill_gap "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/utils/skillGap.ts"
click node_skill_utils "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/utils/skills.ts"
click node_validation "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/utils/validation.ts"
click node_profile_repo "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/database/careerProfileRepository.ts"
click node_jobs_repo "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/database/jobRepository.ts"
click node_projects_repo "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/database/projectRepository.ts"
click node_resume_repo "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/database/resumeRepository.ts"
click node_db_client "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/database/client.ts"
click node_edge_handler "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/resume/handler.ts"
click node_edge_auth "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/_shared/auth.ts"
click node_resume_validate "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/_shared/resume/validate.ts"
click node_resume_extract "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/_shared/resume/extract.ts"
click node_resume_skills "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/_shared/resume/skills.ts"
click node_edge_store "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/_shared/resume/repository.ts"
click node_http_helpers "https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/_shared/http.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_onboarding,node_profile_ui,node_profile_edit,node_dashboard,node_profile_client,node_jobs_ui,node_job_client,node_projects_ui,node_project_client,node_resume_ui,node_resume_client toneBlue
class node_api_routes,node_profile_ctrl,node_jobs_ctrl,node_projects_ctrl,node_resumes_ctrl,node_job_matching,node_skill_gap,node_skill_utils,node_validation,node_database toneAmber
class node_profile_repo,node_jobs_repo,node_projects_repo,node_resume_repo,node_db_client toneMint
class node_edge_handler,node_edge_auth,node_resume_validate,node_resume_extract,node_resume_skills,node_edge_store,node_http_helpers toneRose
class node_user toneIndigo
```

## Components

### Career site

- [Profile onboarding](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/app/onboarding/page.tsx): `site/career-buddy-site/app/onboarding/page.tsx`
- [Profile views](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/app/profile/page.tsx): `site/career-buddy-site/app/profile/page.tsx`
- [Edit profile](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/app/profile/edit/page.tsx): `site/career-buddy-site/app/profile/edit/page.tsx`
- [Career dashboard](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/app/dashboard/page.tsx): `site/career-buddy-site/app/dashboard/page.tsx`
- [Profile client](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/lib/careerProfile.ts): `site/career-buddy-site/lib/careerProfile.ts`
- [Job listings](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/components/job-list.tsx): `site/career-buddy-site/components/job-list.tsx`
- [Jobs client](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/lib/jobs.ts): `site/career-buddy-site/lib/jobs.ts`
- [Project portfolio](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/app/projects/page.tsx): `site/career-buddy-site/app/projects/page.tsx`
- [Projects client](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/lib/projects.ts): `site/career-buddy-site/lib/projects.ts`
- [Resume workspace](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/app/resume/page.tsx): `site/career-buddy-site/app/resume/page.tsx`
- [Resume client](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/site/career-buddy-site/lib/resume.ts): `site/career-buddy-site/lib/resume.ts`

### Backend API

- [API routing](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/routes.ts): `api/src/routes.ts`
- [Profile controller](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/controllers/careerProfile.ts): `api/src/controllers/careerProfile.ts`
- [Jobs controller](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/controllers/jobs.ts): `api/src/controllers/jobs.ts`
- [Projects controller](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/controllers/projects.ts): `api/src/controllers/projects.ts`
- [Resume controller](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/controllers/resumes.ts): `api/src/controllers/resumes.ts`
- [Job matching](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/services/jobMatching.ts): `api/src/services/jobMatching.ts`
- [Skill gap analysis](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/utils/skillGap.ts): `api/src/utils/skillGap.ts`
- [Skill utilities](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/utils/skills.ts): `api/src/utils/skills.ts`
- [Input validation](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/utils/validation.ts): `api/src/utils/validation.ts`

### Persistence

- [Profile repository](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/database/careerProfileRepository.ts): `api/src/database/careerProfileRepository.ts`
- [Jobs repository](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/database/jobRepository.ts): `api/src/database/jobRepository.ts`
- [Projects repository](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/database/projectRepository.ts): `api/src/database/projectRepository.ts`
- [Resume repository](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/database/resumeRepository.ts): `api/src/database/resumeRepository.ts`
- [Supabase client](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/api/src/database/client.ts): `api/src/database/client.ts`

### Resume function

- [Resume request handler](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/resume/handler.ts): `supabase/functions/resume/handler.ts`
- [Function authentication](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/_shared/auth.ts): `supabase/functions/_shared/auth.ts`
- [File validation](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/_shared/resume/validate.ts): `supabase/functions/_shared/resume/validate.ts`
- [Text extraction](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/_shared/resume/extract.ts): `supabase/functions/_shared/resume/extract.ts`
- [Skill extraction](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/_shared/resume/skills.ts): `supabase/functions/_shared/resume/skills.ts`
- [Resume skills store](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/_shared/resume/repository.ts): `supabase/functions/_shared/resume/repository.ts`
- [HTTP responses](https://github.com/gaballagit/cpsc-491-ai-career-buddy/blob/main/supabase/functions/_shared/http.ts): `supabase/functions/_shared/http.ts`

### Other components

- **Career seeker**
- **Supabase data store**

## Connections

- Career seeker → Profile onboarding: starts profile (evidence: `site/career-buddy-site/app/onboarding/page.tsx`)
- Profile onboarding → Profile client: saves profile (evidence: `site/career-buddy-site/app/onboarding/page.tsx`)
- Profile views → Profile client: loads profile (evidence: `site/career-buddy-site/app/profile/page.tsx`)
- Edit profile → Profile client: loads and saves (evidence: `site/career-buddy-site/app/profile/edit/page.tsx`)
- Career dashboard → Profile client: loads profile (evidence: `site/career-buddy-site/app/dashboard/page.tsx`)
- Career dashboard → Projects client: loads projects (evidence: `site/career-buddy-site/app/dashboard/page.tsx`)
- Job listings → Jobs client: loads jobs (evidence: `site/career-buddy-site/components/job-list.tsx`)
- Project portfolio → Projects client: uses client (evidence: `site/career-buddy-site/app/projects/page.tsx`)
- Resume workspace → Resume client: loads saved skills (evidence: `site/career-buddy-site/app/resume/page.tsx`)
- Career seeker → API routing: makes API requests
- API routing → Profile controller: routes profile (evidence: `api/src/routes.ts`)
- API routing → Jobs controller: routes jobs (evidence: `api/src/routes.ts`)
- API routing → Projects controller: routes projects (evidence: `api/src/routes.ts`)
- API routing → Resume controller: routes resumes (evidence: `api/src/routes.ts`)
- Profile controller → Profile repository: uses repository (evidence: `api/src/controllers/careerProfile.ts`)
- Profile controller → Input validation: validates input (evidence: `api/src/controllers/careerProfile.ts`)
- Jobs controller → Jobs repository: uses repository (evidence: `api/src/controllers/jobs.ts`)
- Profile repository → Supabase client: gets client (evidence: `api/src/database/careerProfileRepository.ts`)
- Jobs repository → Supabase client: reads jobs (evidence: `api/src/database/jobRepository.ts`)
- Projects repository → Supabase client: gets client (evidence: `api/src/database/projectRepository.ts`)
- Supabase client → Supabase data store: connects to
- Career seeker → Resume request handler: uploads resume
- Resume request handler → Function authentication: authenticates request (evidence: `supabase/functions/resume/handler.ts`)
- Resume request handler → File validation: validates file (evidence: `supabase/functions/resume/handler.ts`)
- Resume request handler → Text extraction: extracts text (evidence: `supabase/functions/resume/handler.ts`)
- Resume request handler → Skill extraction: extracts skills (evidence: `supabase/functions/resume/handler.ts`)
- Resume request handler → Resume skills store: loads and saves (evidence: `supabase/functions/resume/handler.ts`)
- Resume request handler → HTTP responses: formats responses (evidence: `supabase/functions/resume/handler.ts`)
- Resume skills store → Skill utilities: normalizes skills (evidence: `supabase/functions/_shared/resume/repository.ts`)
- Text extraction → HTTP responses: uses errors (evidence: `supabase/functions/_shared/resume/extract.ts`)
