# karkinnovation/damak-ai-job-hunter architecture

> Architecture diagram of the GitHub repository karkinnovation/damak-ai-job-hunter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/karkinnovation/damak-ai-job-hunter
- Repository: https://github.com/karkinnovation/damak-ai-job-hunter

## Overview

Awasar is a Nepal-focused job marketplace connecting job seekers and employers. The seeker workflow runs from vacancy discovery and profile creation through compatibility-ranked matches, applications, and status tracking; employers maintain business and job listings and review applicants or anonymous talent. Supporting capabilities include AI match explanations, application insights, and location-aware search. The map autocomplete path is documented in the README; other connections below rely only on the supplied excerpts and SOURCE INDEX, so unsampled relationships are omitted.

Main entry points: [`lib/auth.ts`](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/lib/auth.ts) (Auth guards), [`lib/supabase/server.ts`](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/lib/supabase/server.ts) (Supabase access), [`lib/matching.ts`](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/lib/matching.ts) (Compatibility scoring), [`app/dashboard/page.tsx`](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/dashboard/page.tsx) (Role dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Job Discovery"]
  node_home["Home vacancies<br/>[page.tsx]"]
  node_job_search["Job search<br/>[page.tsx]"]
  node_job_detail["Job detail<br/>[page.tsx]"]
end

subgraph group_seeker["Seeker Journey"]
  node_seeker_profile["Seeker profile<br/>[page.tsx]"]
  node_dashboard["Role dashboard<br/>[page.tsx]"]
  node_hunt["Match browser<br/>[page.tsx]"]
  node_matching["Compatibility scoring<br/>[matching.ts]"]
  node_apply["Job application<br/>[page.tsx]"]
  node_applications["Application tracking<br/>[page.tsx]"]
  node_application_insights["Application insights"]
end

subgraph group_employer["Employer Hiring"]
  node_employer_profile["Business profile<br/>[page.tsx]"]
  node_employer_jobs["Job management<br/>[page.tsx]"]
  node_new_job["Create vacancy<br/>[page.tsx]"]
  node_applicants["Applicant review<br/>[page.tsx]"]
  node_talent["Talent browsing<br/>[page.tsx]"]
  node_insights["Market insights<br/>[page.tsx]"]
end

subgraph group_platform["Shared Services"]
  node_auth["Authentication<br/>[page.tsx]"]
  node_auth_form["Auth form<br/>[AuthForm.tsx]"]
  node_auth_service["Auth guards<br/>[auth.ts]"]
  node_supabase["Supabase access<br/>[server.ts]"]
  node_ai_route["AI explanation API<br/>[route.ts]"]
  node_ai_service["AI explanation<br/>[ai.ts]"]
end

subgraph group_location["Location Search"]
  node_map["Interactive location map<br/>[LeafletMap.tsx]"]
  node_place_search["Place autocomplete<br/>[PlaceSearch.tsx]"]
  node_geocode["Geocode API<br/>[route.ts]"]
  node_photon["Photon OSM"]
  node_reverse_geocode["Reverse geocoding<br/>[route.ts]"]
end

node_seeker_actor(("Job seeker"))
node_employer_actor(("Employer"))

node_seeker_actor -->|"browses"| node_home
node_seeker_actor -->|"searches"| node_job_search
node_home -->|"queries vacancies"| node_supabase
node_job_search -->|"queries vacancies"| node_supabase
node_job_search -->|"opens vacancy"| node_job_detail
node_seeker_actor -->|"signs in"| node_auth
node_auth -->|"renders"| node_auth_form
node_auth_form -->|"authenticates"| node_supabase
node_auth_service -->|"checks claims"| node_supabase
node_seeker_actor -->|"maintains profile"| node_seeker_profile
node_seeker_profile -->|"requires role"| node_auth_service
node_employer_actor -->|"maintains business"| node_employer_profile
node_employer_profile -->|"requires role"| node_auth_service
node_seeker_actor -->|"views progress"| node_dashboard
node_dashboard -->|"requires user"| node_auth_service
node_dashboard -->|"scores vacancies"| node_matching
node_dashboard -->|"gets nudge copy"| node_application_insights
node_seeker_actor -->|"explores matches"| node_hunt
node_hunt -->|"requires user"| node_auth_service
node_hunt -->|"ranks matches"| node_matching
node_seeker_actor -->|"applies"| node_apply
node_apply -->|"requires user"| node_auth_service
node_apply -->|"checks fit"| node_matching
node_apply -->|"uses insights"| node_application_insights
node_seeker_actor -->|"tracks applications"| node_applications
node_applications -->|"requires user"| node_auth_service
node_applications -->|"scores fit"| node_matching
node_employer_actor -->|"manages vacancies"| node_employer_jobs
node_employer_actor -->|"posts vacancy"| node_new_job
node_employer_actor -.->|"reviews applicants"| node_applicants
node_employer_actor -->|"browses talent"| node_talent
node_employer_actor -.->|"views insights"| node_insights
node_job_detail -->|"loads vacancy"| node_supabase
node_ai_route -->|"loads match data"| node_supabase
node_ai_route -->|"calculates score"| node_matching
node_ai_route -->|"requests explanation"| node_ai_service
node_seeker_profile -->|"uses map"| node_map
node_employer_profile -->|"uses map"| node_map
node_map -->|"renders autocomplete"| node_place_search
node_place_search -.->|"requests suggestions"| node_geocode
node_geocode -->|"searches businesses"| node_supabase
node_geocode -->|"searches places"| node_photon
node_map -.->|"resolves location"| node_reverse_geocode

click node_home "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/page.tsx"
click node_job_search "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/jobs/page.tsx"
click node_job_detail "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/jobs/%5Bid%5D/page.tsx"
click node_auth "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/auth/page.tsx"
click node_auth_form "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/components/AuthForm.tsx"
click node_auth_service "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/lib/auth.ts"
click node_supabase "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/lib/supabase/server.ts"
click node_seeker_profile "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/seeker/profile/page.tsx"
click node_dashboard "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/dashboard/page.tsx"
click node_hunt "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/seeker/hunt/page.tsx"
click node_matching "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/lib/matching.ts"
click node_apply "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/jobs/%5Bid%5D/apply/page.tsx"
click node_applications "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/seeker/applications/page.tsx"
click node_application_insights "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/lib/applicationInsights.ts"
click node_employer_profile "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/employer/profile/page.tsx"
click node_employer_jobs "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/employer/jobs/page.tsx"
click node_new_job "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/employer/jobs/new/page.tsx"
click node_applicants "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/employer/jobs/%5Bid%5D/applicants/page.tsx"
click node_talent "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/employer/talent/page.tsx"
click node_insights "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/insights/page.tsx"
click node_ai_route "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/api/ai/explain/route.ts"
click node_ai_service "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/lib/ai.ts"
click node_map "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/components/LeafletMap.tsx"
click node_place_search "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/components/PlaceSearch.tsx"
click node_geocode "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/api/geocode/route.ts"
click node_reverse_geocode "https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/api/reverse-geocode/route.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_home,node_job_search,node_job_detail toneBlue
class node_seeker_profile,node_dashboard,node_hunt,node_matching,node_apply,node_applications,node_application_insights toneAmber
class node_employer_profile,node_employer_jobs,node_new_job,node_applicants,node_talent,node_insights toneMint
class node_auth,node_auth_form,node_auth_service,node_supabase,node_ai_route,node_ai_service toneRose
class node_map,node_place_search,node_geocode,node_photon,node_reverse_geocode,node_seeker_actor,node_employer_actor toneIndigo
```

## Components

### Job Discovery

- [Home vacancies](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/page.tsx): `app/page.tsx`
- [Job search](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/jobs/page.tsx): `app/jobs/page.tsx`
- [Job detail](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/jobs/%5Bid%5D/page.tsx): `app/jobs/[id]/page.tsx`

### Seeker Journey

- [Seeker profile](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/seeker/profile/page.tsx): `app/seeker/profile/page.tsx`
- [Role dashboard](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Match browser](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/seeker/hunt/page.tsx): `app/seeker/hunt/page.tsx`
- [Compatibility scoring](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/lib/matching.ts): `lib/matching.ts`
- [Job application](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/jobs/%5Bid%5D/apply/page.tsx): `app/jobs/[id]/apply/page.tsx`
- [Application tracking](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/seeker/applications/page.tsx): `app/seeker/applications/page.tsx`
- [Application insights](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/lib/applicationInsights.ts): `lib/applicationInsights.ts`

### Employer Hiring

- [Business profile](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/employer/profile/page.tsx): `app/employer/profile/page.tsx`
- [Job management](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/employer/jobs/page.tsx): `app/employer/jobs/page.tsx`
- [Create vacancy](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/employer/jobs/new/page.tsx): `app/employer/jobs/new/page.tsx`
- [Applicant review](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/employer/jobs/%5Bid%5D/applicants/page.tsx): `app/employer/jobs/[id]/applicants/page.tsx`
- [Talent browsing](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/employer/talent/page.tsx): `app/employer/talent/page.tsx`
- [Market insights](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/insights/page.tsx): `app/insights/page.tsx`

### Shared Services

- [Authentication](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/auth/page.tsx): `app/auth/page.tsx`
- [Auth form](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/components/AuthForm.tsx): `components/AuthForm.tsx`
- [Auth guards](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/lib/auth.ts): `lib/auth.ts`
- [Supabase access](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/lib/supabase/server.ts): `lib/supabase/server.ts`
- [AI explanation API](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/api/ai/explain/route.ts): `app/api/ai/explain/route.ts`
- [AI explanation](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/lib/ai.ts): `lib/ai.ts`

### Location Search

- [Interactive location map](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/components/LeafletMap.tsx): `components/LeafletMap.tsx`
- [Place autocomplete](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/components/PlaceSearch.tsx): `components/PlaceSearch.tsx`
- [Geocode API](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/api/geocode/route.ts): `app/api/geocode/route.ts`
- **Photon OSM**
- [Reverse geocoding](https://github.com/karkinnovation/damak-ai-job-hunter/blob/main/app/api/reverse-geocode/route.ts): `app/api/reverse-geocode/route.ts`

### Other components

- **Job seeker**
- **Employer**

## Connections

- Job seeker → Home vacancies: browses (evidence: `app/page.tsx`)
- Job seeker → Job search: searches (evidence: `app/jobs/page.tsx`)
- Home vacancies → Supabase access: queries vacancies (evidence: `app/page.tsx`)
- Job search → Supabase access: queries vacancies (evidence: `app/jobs/page.tsx`)
- Job search → Job detail: opens vacancy (evidence: `app/jobs/page.tsx`)
- Job seeker → Authentication: signs in (evidence: `app/auth/page.tsx`)
- Authentication → Auth form: renders (evidence: `app/auth/page.tsx`)
- Auth form → Supabase access: authenticates (evidence: `components/AuthForm.tsx`)
- Auth guards → Supabase access: checks claims (evidence: `lib/auth.ts`)
- Job seeker → Seeker profile: maintains profile (evidence: `app/seeker/profile/page.tsx`)
- Seeker profile → Auth guards: requires role (evidence: `app/seeker/profile/page.tsx`)
- Employer → Business profile: maintains business (evidence: `app/employer/profile/page.tsx`)
- Business profile → Auth guards: requires role (evidence: `app/employer/profile/page.tsx`)
- Job seeker → Role dashboard: views progress (evidence: `app/dashboard/page.tsx`)
- Role dashboard → Auth guards: requires user (evidence: `app/dashboard/page.tsx`)
- Role dashboard → Compatibility scoring: scores vacancies (evidence: `app/dashboard/page.tsx`)
- Role dashboard → Application insights: gets nudge copy (evidence: `app/dashboard/page.tsx`)
- Job seeker → Match browser: explores matches (evidence: `app/seeker/hunt/page.tsx`)
- Match browser → Auth guards: requires user (evidence: `app/seeker/hunt/page.tsx`)
- Match browser → Compatibility scoring: ranks matches (evidence: `app/seeker/hunt/page.tsx`)
- Job seeker → Job application: applies (evidence: `app/jobs/[id]/apply/page.tsx`)
- Job application → Auth guards: requires user (evidence: `app/jobs/[id]/apply/page.tsx`)
- Job application → Compatibility scoring: checks fit (evidence: `app/jobs/[id]/apply/page.tsx`)
- Job application → Application insights: uses insights (evidence: `app/jobs/[id]/apply/page.tsx`)
- Job seeker → Application tracking: tracks applications (evidence: `app/seeker/applications/page.tsx`)
- Application tracking → Auth guards: requires user (evidence: `app/seeker/applications/page.tsx`)
- Application tracking → Compatibility scoring: scores fit (evidence: `app/seeker/applications/page.tsx`)
- Employer → Job management: manages vacancies
- Employer → Create vacancy: posts vacancy
- Employer → Applicant review: reviews applicants
- Employer → Talent browsing: browses talent
- Employer → Market insights: views insights
- Job detail → Supabase access: loads vacancy (evidence: `app/jobs/[id]/page.tsx`)
- AI explanation API → Supabase access: loads match data (evidence: `app/api/ai/explain/route.ts`)
- AI explanation API → Compatibility scoring: calculates score (evidence: `app/api/ai/explain/route.ts`)
- AI explanation API → AI explanation: requests explanation (evidence: `app/api/ai/explain/route.ts`)
- Seeker profile → Interactive location map: uses map (evidence: `app/seeker/profile/page.tsx`)
- Business profile → Interactive location map: uses map (evidence: `app/employer/profile/page.tsx`)
- Interactive location map → Place autocomplete: renders autocomplete (evidence: `components/LeafletMap.tsx`)
- Place autocomplete → Geocode API: requests suggestions
- Geocode API → Supabase access: searches businesses (evidence: `app/api/geocode/route.ts`)
- Geocode API → Photon OSM: searches places (evidence: `app/api/geocode/route.ts`)
- Interactive location map → Reverse geocoding: resolves location
