# var-che/truckfind architecture

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

- Interactive diagram: https://gitdiagram.com/var-che/truckfind
- Repository: https://github.com/var-che/truckfind

## Overview

TruckFind is a truck-driver and trucking-company marketplace. Its central recruiting flow is company discovery of driver profiles, contact unlocking with credits, then lead follow-up through the company CRM. The tree also shows driver/company onboarding and profiles, saved searches, verification, subscription payments, and blog content. The sampled routes confirm several database and integration actions; other page-to-route wiring is not shown, so those links are omitted.

Main entry points: [`src/app/api/cron/update-saved-searches/route.ts`](https://github.com/var-che/truckfind/blob/main/src/app/api/cron/update-saved-searches/route.ts) (Search refresh job), [`src/app/company/crm/page.tsx`](https://github.com/var-che/truckfind/blob/main/src/app/company/crm/page.tsx) (Company CRM), [`src/app/api/companies/send-verification/route.ts`](https://github.com/var-che/truckfind/blob/main/src/app/api/companies/send-verification/route.ts) (Send verification), [`src/app/api/payments/create-order/route.ts`](https://github.com/var-che/truckfind/blob/main/src/app/api/payments/create-order/route.ts) (Credit purchase)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_marketplace["Driver Marketplace"]
  node_marketplace_pages["Browse &amp; profiles<br/>[page.tsx]"]
  node_company_pages["Company directory<br/>[page.tsx]"]
  node_driver_profile["Driver profiles<br/>[page.tsx]"]
  node_company_profile["Company profiles<br/>[page.tsx]"]
  node_driver_search["Driver search<br/>[actions.ts]"]
  node_test_driver_search["Search test API<br/>[route.ts]"]
end

subgraph group_recruiting["Recruiting CRM"]
  node_unlock_route["Contact unlock<br/>[route.ts]"]
  node_company_crm["Company CRM<br/>[page.tsx]"]
  node_crm_actions["CRM actions<br/>[actions.ts]"]
  node_saved_searches["Saved searches"]
  node_saved_search_cron["Search refresh job<br/>[route.ts]"]
end

subgraph group_accounts["Accounts &amp; Payments"]
  node_signup["Signup &amp; auth<br/>[page.tsx]"]
  node_verification_send["Send verification<br/>[route.ts]"]
  node_verification_confirm["Confirm verification<br/>[route.ts]"]
  node_purchase["Credit purchase<br/>[route.ts]"]
  node_payment_return["Payment return<br/>[route.ts]"]
  node_payment_webhook["Payment webhook<br/>[route.ts]"]
end

subgraph group_engagement["Content &amp; Alerts"]
  node_hub_signup["Hub subscription<br/>[route.ts]"]
  node_blog["Blog publishing<br/>[page.tsx]"]
  node_rss["Blog RSS feed<br/>[route.ts]"]
end

node_company_user(("Company recruiter"))
node_driver_user(("Driver"))
node_supabase[("Supabase")]
node_checkout["2Checkout"]
node_resend["Resend email"]

node_company_user -->|"browses"| node_marketplace_pages
node_company_user -->|"browses"| node_company_pages
node_driver_user -->|"creates profile"| node_driver_profile
node_marketplace_pages -->|"filters drivers"| node_driver_search
node_test_driver_search -->|"queries drivers"| node_supabase
node_company_user -->|"requests unlock"| node_unlock_route
node_unlock_route -->|"checks &amp; records"| node_supabase
node_company_user -->|"follows leads"| node_company_crm
node_company_crm -->|"runs actions"| node_crm_actions
node_company_crm -->|"manages searches"| node_saved_searches
node_saved_search_cron -->|"loads searches"| node_supabase
node_saved_search_cron -->|"refreshes matches"| node_saved_searches
node_saved_search_cron -.->|"sends alerts"| node_resend
node_driver_user -->|"signs up"| node_signup
node_company_user -->|"signs up"| node_signup
node_company_user -->|"requests verification"| node_verification_send
node_verification_send -->|"checks &amp; updates"| node_supabase
node_verification_send -->|"invites by email"| node_resend
node_verification_confirm -->|"verifies company"| node_supabase
node_company_user -->|"buys credits"| node_purchase
node_purchase -->|"creates purchase"| node_supabase
node_purchase -->|"creates order"| node_checkout
node_checkout -->|"posts payment event"| node_payment_webhook
node_payment_webhook -->|"records &amp; processes"| node_supabase
node_checkout -->|"returns browser"| node_payment_return
node_payment_return -->|"checks purchase"| node_supabase
node_driver_user -->|"subscribes"| node_hub_signup
node_hub_signup -->|"stores subscriber"| node_supabase
node_hub_signup -->|"sends confirmation"| node_resend
node_blog -->|"publishes content"| node_supabase
node_rss -->|"reads published posts"| node_supabase

click node_marketplace_pages "https://github.com/var-che/truckfind/blob/main/src/app/drivers/page.tsx"
click node_company_pages "https://github.com/var-che/truckfind/blob/main/src/app/companies/page.tsx"
click node_driver_profile "https://github.com/var-che/truckfind/blob/main/src/app/driver/profile/create/page.tsx"
click node_company_profile "https://github.com/var-che/truckfind/blob/main/src/app/company/profile/create/page.tsx"
click node_driver_search "https://github.com/var-che/truckfind/blob/main/src/app/drivers/actions.ts"
click node_test_driver_search "https://github.com/var-che/truckfind/blob/main/src/app/api/test-drivers/route.ts"
click node_unlock_route "https://github.com/var-che/truckfind/blob/main/src/app/api/drivers/%5Bid%5D/unlock/route.ts"
click node_company_crm "https://github.com/var-che/truckfind/blob/main/src/app/company/crm/page.tsx"
click node_crm_actions "https://github.com/var-che/truckfind/blob/main/src/app/company/crm/actions.ts"
click node_saved_searches "https://github.com/var-che/truckfind/blob/main/src/app/company/crm/saved-searches-actions.ts"
click node_saved_search_cron "https://github.com/var-che/truckfind/blob/main/src/app/api/cron/update-saved-searches/route.ts"
click node_signup "https://github.com/var-che/truckfind/blob/main/src/app/auth/signup/page.tsx"
click node_verification_send "https://github.com/var-che/truckfind/blob/main/src/app/api/companies/send-verification/route.ts"
click node_verification_confirm "https://github.com/var-che/truckfind/blob/main/src/app/api/companies/verify-email/route.ts"
click node_purchase "https://github.com/var-che/truckfind/blob/main/src/app/api/payments/create-order/route.ts"
click node_payment_return "https://github.com/var-che/truckfind/blob/main/src/app/api/payments/return/route.ts"
click node_payment_webhook "https://github.com/var-che/truckfind/blob/main/src/app/api/payments/webhook/route.ts"
click node_hub_signup "https://github.com/var-che/truckfind/blob/main/src/app/api/hub/subscribe/route.ts"
click node_blog "https://github.com/var-che/truckfind/blob/main/src/app/blog/page.tsx"
click node_rss "https://github.com/var-che/truckfind/blob/main/src/app/rss.xml/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_marketplace_pages,node_company_pages,node_driver_profile,node_company_profile,node_driver_search,node_test_driver_search toneBlue
class node_unlock_route,node_company_crm,node_crm_actions,node_saved_searches,node_saved_search_cron,node_supabase toneAmber
class node_signup,node_verification_send,node_verification_confirm,node_purchase,node_payment_return,node_payment_webhook toneMint
class node_hub_signup,node_blog,node_rss toneRose
class node_company_user,node_driver_user,node_checkout,node_resend toneIndigo
```

## Components

### Driver Marketplace

- [Browse & profiles](https://github.com/var-che/truckfind/blob/main/src/app/drivers/page.tsx): `src/app/drivers/page.tsx`
- [Company directory](https://github.com/var-che/truckfind/blob/main/src/app/companies/page.tsx): `src/app/companies/page.tsx`
- [Driver profiles](https://github.com/var-che/truckfind/blob/main/src/app/driver/profile/create/page.tsx): `src/app/driver/profile/create/page.tsx`
- [Company profiles](https://github.com/var-che/truckfind/blob/main/src/app/company/profile/create/page.tsx): `src/app/company/profile/create/page.tsx`
- [Driver search](https://github.com/var-che/truckfind/blob/main/src/app/drivers/actions.ts): `src/app/drivers/actions.ts`
- [Search test API](https://github.com/var-che/truckfind/blob/main/src/app/api/test-drivers/route.ts): `src/app/api/test-drivers/route.ts`

### Recruiting CRM

- [Contact unlock](https://github.com/var-che/truckfind/blob/main/src/app/api/drivers/%5Bid%5D/unlock/route.ts): `src/app/api/drivers/[id]/unlock/route.ts`
- [Company CRM](https://github.com/var-che/truckfind/blob/main/src/app/company/crm/page.tsx): `src/app/company/crm/page.tsx`
- [CRM actions](https://github.com/var-che/truckfind/blob/main/src/app/company/crm/actions.ts): `src/app/company/crm/actions.ts`
- [Saved searches](https://github.com/var-che/truckfind/blob/main/src/app/company/crm/saved-searches-actions.ts): `src/app/company/crm/saved-searches-actions.ts`
- [Search refresh job](https://github.com/var-che/truckfind/blob/main/src/app/api/cron/update-saved-searches/route.ts): `src/app/api/cron/update-saved-searches/route.ts`

### Accounts & Payments

- [Signup & auth](https://github.com/var-che/truckfind/blob/main/src/app/auth/signup/page.tsx): `src/app/auth/signup/page.tsx`
- [Send verification](https://github.com/var-che/truckfind/blob/main/src/app/api/companies/send-verification/route.ts): `src/app/api/companies/send-verification/route.ts`
- [Confirm verification](https://github.com/var-che/truckfind/blob/main/src/app/api/companies/verify-email/route.ts): `src/app/api/companies/verify-email/route.ts`
- [Credit purchase](https://github.com/var-che/truckfind/blob/main/src/app/api/payments/create-order/route.ts): `src/app/api/payments/create-order/route.ts`
- [Payment return](https://github.com/var-che/truckfind/blob/main/src/app/api/payments/return/route.ts): `src/app/api/payments/return/route.ts`
- [Payment webhook](https://github.com/var-che/truckfind/blob/main/src/app/api/payments/webhook/route.ts): `src/app/api/payments/webhook/route.ts`

### Content & Alerts

- [Hub subscription](https://github.com/var-che/truckfind/blob/main/src/app/api/hub/subscribe/route.ts): `src/app/api/hub/subscribe/route.ts`
- [Blog publishing](https://github.com/var-che/truckfind/blob/main/src/app/blog/page.tsx): `src/app/blog/page.tsx`
- [Blog RSS feed](https://github.com/var-che/truckfind/blob/main/src/app/rss.xml/route.ts): `src/app/rss.xml/route.ts`

### Other components

- **Company recruiter**
- **Driver**
- **Supabase**
- **2Checkout**
- **Resend email**

## Connections

- Company recruiter → Browse & profiles: browses
- Company recruiter → Company directory: browses
- Driver → Driver profiles: creates profile
- Browse & profiles → Driver search: filters drivers
- Search test API → Supabase: queries drivers
- Company recruiter → Contact unlock: requests unlock
- Contact unlock → Supabase: checks & records
- Company recruiter → Company CRM: follows leads
- Company CRM → CRM actions: runs actions
- Company CRM → Saved searches: manages searches
- Search refresh job → Supabase: loads searches
- Search refresh job → Saved searches: refreshes matches
- Search refresh job → Resend email: sends alerts
- Driver → Signup & auth: signs up
- Company recruiter → Signup & auth: signs up
- Company recruiter → Send verification: requests verification
- Send verification → Supabase: checks & updates
- Send verification → Resend email: invites by email
- Confirm verification → Supabase: verifies company
- Company recruiter → Credit purchase: buys credits
- Credit purchase → Supabase: creates purchase
- Credit purchase → 2Checkout: creates order
- 2Checkout → Payment webhook: posts payment event
- Payment webhook → Supabase: records & processes
- 2Checkout → Payment return: returns browser
- Payment return → Supabase: checks purchase
- Driver → Hub subscription: subscribes
- Hub subscription → Supabase: stores subscriber
- Hub subscription → Resend email: sends confirmation
- Blog publishing → Supabase: publishes content
- Blog RSS feed → Supabase: reads published posts
