# rachit-star/trackhire architecture

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

- Interactive diagram: https://gitdiagram.com/rachit-star/trackhire
- Repository: https://github.com/rachit-star/trackhire

## Overview

TrackHire is an internship application tracker whose central workflow is Google sign-in, Gmail scanning, AI classification and application matching, then tracker updates and activity logging. Users can also manage applications manually, review dashboard and rule-based alerts, and request pipeline insights. The graph preserves those documented stages and major capabilities. Internal scanner details are represented from the README; route files are listed as read in the source index, but their implementation excerpts were not provided, so undocumented internal calls are not inferred.

Main entry points: [`app/api/cron/scan/route.js`](https://github.com/rachit-star/trackhire/blob/main/app/api/cron/scan/route.js) (Scheduled scan endpoint), [`app/applications/ApplicationsClient.js`](https://github.com/rachit-star/trackhire/blob/main/app/applications/ApplicationsClient.js) (Application editor), [`app/applications/page.js`](https://github.com/rachit-star/trackhire/blob/main/app/applications/page.js) (Application list), [`app/lib/supabase.js`](https://github.com/rachit-star/trackhire/blob/main/app/lib/supabase.js) (Browser database client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_landing["Sign-in page<br/>[page.js]"]
  node_google["Google OAuth"]
  node_callback["OAuth callback<br/>[route.js]"]
  node_navigation["App navigation<br/>[Navbar.js]"]
end

subgraph group_tracking["Application tracking"]
  node_applications_page["Application list<br/>[page.js]"]
  node_applications_client["Application editor"]
  node_add_form["Manual entry"]
  node_supabase_client["Browser database client<br/>[supabase.js]"]
end

subgraph group_scanner["Email automation"]
  node_inbox_client["Inbox scanner UI<br/>[InboxClient.js]"]
  node_gmail_scan["Gmail scan endpoint<br/>[route.js]"]
  node_cron_scan["Scheduled scan endpoint<br/>[route.js]"]
  node_gmail["Gmail API"]
  node_classification["Email classification<br/>[route.js]"]
  node_matching["Application matching<br/>[route.js]"]
  node_dedup["Scan deduplication<br/>[route.js]"]
end

subgraph group_analytics["Pipeline intelligence"]
  node_groq["Groq AI"]
  node_dashboard["Dashboard<br/>[page.js]"]
  node_alerts["Rule-based alerts<br/>[page.js]"]
  node_insights_page["Pipeline insights<br/>[page.js]"]
  node_ai_analysis["AI analysis UI<br/>[AIAnalysis.js]"]
  node_analyze_api["Analysis endpoint<br/>[route.js]"]
end

node_applicant(("Applicant"))
node_database[("Supabase data store")]

node_applicant -->|"signs in"| node_landing
node_landing -->|"starts OAuth"| node_google
node_google -->|"redirects to"| node_callback
node_callback -->|"saves tokens"| node_database
node_navigation -->|"links to"| node_applications_page
node_applicant -.->|"manages entries"| node_applications_client
node_applications_page -->|"reads applications"| node_database
node_applications_page -->|"renders"| node_applications_client
node_applications_client -->|"renders"| node_add_form
node_applications_client -->|"updates or deletes"| node_supabase_client
node_add_form -->|"inserts entry"| node_supabase_client
node_supabase_client -->|"accesses"| node_database
node_applicant -.->|"requests scan"| node_inbox_client
node_inbox_client -->|"posts scan request"| node_gmail_scan
node_applicant -->|"schedules daily scan"| node_cron_scan
node_gmail_scan -->|"fetches messages"| node_gmail
node_cron_scan -->|"fetches messages"| node_gmail
node_cron_scan -->|"skips processed IDs"| node_dedup
node_cron_scan -->|"classifies emails"| node_classification
node_classification -->|"uses for classification"| node_groq
node_cron_scan -->|"matches or extracts"| node_matching
node_matching -->|"uses for matching"| node_groq
node_cron_scan -->|"updates and logs"| node_database
node_cron_scan -->|"updates matched status"| node_applications_client
node_dashboard -->|"reads applications and events"| node_database
node_alerts -->|"reads applications"| node_database
node_insights_page -->|"reads applications"| node_database
node_insights_page -->|"renders with data"| node_ai_analysis
node_ai_analysis -->|"posts analysis request"| node_analyze_api
node_analyze_api -->|"analyzes pipeline"| node_groq

click node_landing "https://github.com/rachit-star/trackhire/blob/main/app/page.js"
click node_callback "https://github.com/rachit-star/trackhire/blob/main/app/auth/callback/route.js"
click node_navigation "https://github.com/rachit-star/trackhire/blob/main/app/components/Navbar.js"
click node_applications_page "https://github.com/rachit-star/trackhire/blob/main/app/applications/page.js"
click node_applications_client "https://github.com/rachit-star/trackhire/blob/main/app/applications/ApplicationsClient.js"
click node_add_form "https://github.com/rachit-star/trackhire/blob/main/app/components/AddApplicationForm.js"
click node_inbox_client "https://github.com/rachit-star/trackhire/blob/main/app/inbox/InboxClient.js"
click node_gmail_scan "https://github.com/rachit-star/trackhire/blob/main/app/api/gmail/scan/route.js"
click node_cron_scan "https://github.com/rachit-star/trackhire/blob/main/app/api/cron/scan/route.js"
click node_classification "https://github.com/rachit-star/trackhire/blob/main/app/api/cron/scan/route.js"
click node_matching "https://github.com/rachit-star/trackhire/blob/main/app/api/cron/scan/route.js"
click node_dedup "https://github.com/rachit-star/trackhire/blob/main/app/api/cron/scan/route.js"
click node_dashboard "https://github.com/rachit-star/trackhire/blob/main/app/dashboard/page.js"
click node_alerts "https://github.com/rachit-star/trackhire/blob/main/app/alerts/page.js"
click node_insights_page "https://github.com/rachit-star/trackhire/blob/main/app/insights/page.js"
click node_ai_analysis "https://github.com/rachit-star/trackhire/blob/main/app/insights/AIAnalysis.js"
click node_analyze_api "https://github.com/rachit-star/trackhire/blob/main/app/api/insights/analyze/route.js"
click node_supabase_client "https://github.com/rachit-star/trackhire/blob/main/app/lib/supabase.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_landing,node_google,node_callback,node_navigation toneBlue
class node_applications_page,node_applications_client,node_add_form,node_supabase_client,node_database toneAmber
class node_inbox_client,node_gmail_scan,node_cron_scan,node_gmail,node_classification,node_matching,node_dedup toneMint
class node_groq,node_dashboard,node_alerts,node_insights_page,node_ai_analysis,node_analyze_api toneRose
class node_applicant toneIndigo
```

## Components

### Access and navigation

- [Sign-in page](https://github.com/rachit-star/trackhire/blob/main/app/page.js): `app/page.js`
- **Google OAuth**
- [OAuth callback](https://github.com/rachit-star/trackhire/blob/main/app/auth/callback/route.js): `app/auth/callback/route.js`
- [App navigation](https://github.com/rachit-star/trackhire/blob/main/app/components/Navbar.js): `app/components/Navbar.js`

### Application tracking

- [Application list](https://github.com/rachit-star/trackhire/blob/main/app/applications/page.js): `app/applications/page.js`
- [Application editor](https://github.com/rachit-star/trackhire/blob/main/app/applications/ApplicationsClient.js): `app/applications/ApplicationsClient.js`
- [Manual entry](https://github.com/rachit-star/trackhire/blob/main/app/components/AddApplicationForm.js): `app/components/AddApplicationForm.js`
- [Browser database client](https://github.com/rachit-star/trackhire/blob/main/app/lib/supabase.js): `app/lib/supabase.js`

### Email automation

- [Inbox scanner UI](https://github.com/rachit-star/trackhire/blob/main/app/inbox/InboxClient.js): `app/inbox/InboxClient.js`
- [Gmail scan endpoint](https://github.com/rachit-star/trackhire/blob/main/app/api/gmail/scan/route.js): `app/api/gmail/scan/route.js`
- [Scheduled scan endpoint](https://github.com/rachit-star/trackhire/blob/main/app/api/cron/scan/route.js): `app/api/cron/scan/route.js`
- **Gmail API**
- [Email classification](https://github.com/rachit-star/trackhire/blob/main/app/api/cron/scan/route.js): `app/api/cron/scan/route.js`
- [Application matching](https://github.com/rachit-star/trackhire/blob/main/app/api/cron/scan/route.js): `app/api/cron/scan/route.js`
- [Scan deduplication](https://github.com/rachit-star/trackhire/blob/main/app/api/cron/scan/route.js): `app/api/cron/scan/route.js`

### Pipeline intelligence

- **Groq AI**
- [Dashboard](https://github.com/rachit-star/trackhire/blob/main/app/dashboard/page.js): `app/dashboard/page.js`
- [Rule-based alerts](https://github.com/rachit-star/trackhire/blob/main/app/alerts/page.js): `app/alerts/page.js`
- [Pipeline insights](https://github.com/rachit-star/trackhire/blob/main/app/insights/page.js): `app/insights/page.js`
- [AI analysis UI](https://github.com/rachit-star/trackhire/blob/main/app/insights/AIAnalysis.js): `app/insights/AIAnalysis.js`
- [Analysis endpoint](https://github.com/rachit-star/trackhire/blob/main/app/api/insights/analyze/route.js): `app/api/insights/analyze/route.js`

### Other components

- **Applicant**
- **Supabase data store**

## Connections

- Applicant → Sign-in page: signs in (evidence: `app/page.js`)
- Sign-in page → Google OAuth: starts OAuth (evidence: `app/page.js`)
- Google OAuth → OAuth callback: redirects to
- OAuth callback → Supabase data store: saves tokens (evidence: `README.md`)
- App navigation → Application list: links to (evidence: `app/components/Navbar.js`)
- Applicant → Application editor: manages entries
- Application list → Supabase data store: reads applications (evidence: `app/applications/page.js`)
- Application list → Application editor: renders (evidence: `app/applications/page.js`)
- Application editor → Manual entry: renders (evidence: `app/applications/ApplicationsClient.js`)
- Application editor → Browser database client: updates or deletes (evidence: `app/applications/ApplicationsClient.js`)
- Manual entry → Browser database client: inserts entry (evidence: `app/components/AddApplicationForm.js`)
- Browser database client → Supabase data store: accesses (evidence: `app/lib/supabase.js`)
- Applicant → Inbox scanner UI: requests scan
- Inbox scanner UI → Gmail scan endpoint: posts scan request (evidence: `app/inbox/InboxClient.js`)
- Applicant → Scheduled scan endpoint: schedules daily scan (evidence: `README.md`)
- Gmail scan endpoint → Gmail API: fetches messages (evidence: `README.md`)
- Scheduled scan endpoint → Gmail API: fetches messages (evidence: `README.md`)
- Scheduled scan endpoint → Scan deduplication: skips processed IDs (evidence: `README.md`)
- Scheduled scan endpoint → Email classification: classifies emails (evidence: `README.md`)
- Email classification → Groq AI: uses for classification (evidence: `README.md`)
- Scheduled scan endpoint → Application matching: matches or extracts (evidence: `README.md`)
- Application matching → Groq AI: uses for matching (evidence: `README.md`)
- Scheduled scan endpoint → Supabase data store: updates and logs (evidence: `README.md`)
- Scheduled scan endpoint → Application editor: updates matched status (evidence: `README.md`)
- Dashboard → Supabase data store: reads applications and events (evidence: `app/dashboard/page.js`)
- Rule-based alerts → Supabase data store: reads applications (evidence: `app/alerts/page.js`)
- Pipeline insights → Supabase data store: reads applications (evidence: `app/insights/page.js`)
- Pipeline insights → AI analysis UI: renders with data (evidence: `app/insights/page.js`)
- AI analysis UI → Analysis endpoint: posts analysis request (evidence: `app/insights/AIAnalysis.js`)
- Analysis endpoint → Groq AI: analyzes pipeline (evidence: `README.md`)
