# hegdepunithramesh/recruiterflow_assignment architecture

> Architecture diagram of the GitHub repository hegdepunithramesh/recruiterflow_assignment, 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/hegdepunithramesh/recruiterflow_assignment
- Repository: https://github.com/hegdepunithramesh/recruiterflow_assignment

## Overview

The repository contains two distinct products: a PostgreSQL-backed recruiter-matching API with offline SQL data tools, and a browser-based shared-expense tracker. The API workflow is request → route/controller validation → profile snapshot reads → ranking → JSON response. The frontend workflow is route → expense form or expense list → Redux state, with local persistence and balance/split calculations. The README documents backend capabilities; frontend links follow source-index references, so unsampled interactions are omitted where their caller is not shown.

Main entry points: [`backend/src/modules/matching/service.ts`](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/modules/matching/service.ts) (Matching service), [`frontend/src/pages/AddExpensePage.tsx`](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/pages/AddExpensePage.tsx) (Add expense), [`frontend/src/app/store.ts`](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/app/store.ts) (Application store), [`frontend/src/pages/ExpensesPage.tsx`](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/pages/ExpensesPage.tsx) (Expense overview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Matching API"]
  node_routes["Match routes<br/>[routes.ts]"]
  node_controller["Match controller<br/>[controller.ts]"]
  node_service["Matching service<br/>[service.ts]"]
  node_policy["Ranking policy<br/>[policy.ts]"]
  node_app["HTTP app<br/>[app.ts]"]
end

subgraph group_storage["Recruiter Data"]
  node_candidates["Candidate repository<br/>[repository.ts]"]
  node_jobs["Job repository<br/>[repository.ts]"]
  node_postgres[("Recruiter database")]
  node_storage_tools["Migrations and seed"]
  node_fixture["Fixture validation<br/>[fixture.ts]"]
end

subgraph group_detective["SQL Detective"]
  node_detective_tools["Detective commands"]
  node_detective_db[("Detective database")]
end

subgraph group_ui["Expense Tracker"]
  node_entry["Frontend entry<br/>[main.tsx]"]
  node_router["Page router<br/>[router.tsx]"]
  node_add_page["Add expense<br/>[AddExpensePage.tsx]"]
  node_expenses_page["Expense overview<br/>[ExpensesPage.tsx]"]
  node_balance["Balance summary<br/>[BalanceSummary.tsx]"]
  node_table["Expense table<br/>[ExpenseTable.tsx]"]
end

subgraph group_state["Expense State"]
  node_store["Application store<br/>[store.ts]"]
  node_expense_slice["Expense state<br/>[expensesSlice.ts]"]
  node_member_slice["Member state<br/>[membersSlice.ts]"]
  node_persistence["Local persistence<br/>[persistence.ts]"]
  node_splits["Split calculator<br/>[split.ts]"]
  node_money["Money utilities<br/>[money.ts]"]
  node_validation["Expense validation<br/>[validation.ts]"]
  node_selectors["Expense selectors"]
  node_balances["Balance calculations<br/>[balances.ts]"]
end

node_api_user(("API caller"))
node_browser_user(("Expense tracker user"))

node_api_user -->|"sends request"| node_app
node_app -->|"registers routes"| node_routes
node_routes -->|"dispatches"| node_controller
node_controller -->|"requests matches"| node_service
node_service -->|"reads candidates"| node_candidates
node_service -->|"reads jobs"| node_jobs
node_service -->|"ranks profiles"| node_policy
node_controller -->|"returns JSON"| node_api_user
node_service -->|"reads snapshot"| node_postgres
node_storage_tools -->|"migrates and seeds"| node_postgres
node_fixture -->|"validates fixture"| node_storage_tools
node_detective_tools -->|"loads and queries"| node_detective_db
node_browser_user -->|"uses tracker"| node_entry
node_entry -->|"renders routes"| node_router
node_entry -->|"creates app state"| node_store
node_router -->|"routes to form"| node_add_page
node_router -->|"routes to overview"| node_expenses_page
node_add_page -->|"dispatches expense"| node_store
node_add_page -->|"calculates shares"| node_splits
node_add_page -->|"parses amounts"| node_money
node_add_page -->|"validates input"| node_validation
node_expenses_page -->|"selects expenses"| node_selectors
node_expenses_page -->|"renders summary"| node_balance
node_expenses_page -->|"renders expenses"| node_table
node_store -->|"reduces actions"| node_expense_slice
node_store -->|"reduces members"| node_member_slice
node_store -->|"loads and saves"| node_persistence
node_expense_slice -->|"checks stored data"| node_persistence
node_balance -->|"reads selected data"| node_selectors
node_balance -->|"computes balances"| node_balances
node_balance -->|"formats totals"| node_money
node_table -->|"formats amounts"| node_money

click node_routes "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/modules/matching/routes.ts"
click node_controller "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/modules/matching/controller.ts"
click node_service "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/modules/matching/service.ts"
click node_policy "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/modules/matching/policy.ts"
click node_app "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/app.ts"
click node_candidates "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/modules/candidates/repository.ts"
click node_jobs "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/modules/jobs/repository.ts"
click node_storage_tools "https://github.com/hegdepunithramesh/recruiterflow_assignment/tree/main/backend/src/storage"
click node_fixture "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/storage/fixture.ts"
click node_detective_tools "https://github.com/hegdepunithramesh/recruiterflow_assignment/tree/main/backend/src/detective"
click node_entry "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/main.tsx"
click node_router "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/app/router.tsx"
click node_add_page "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/pages/AddExpensePage.tsx"
click node_expenses_page "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/pages/ExpensesPage.tsx"
click node_balance "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/components/BalanceSummary.tsx"
click node_table "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/components/ExpenseTable.tsx"
click node_store "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/app/store.ts"
click node_expense_slice "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/features/expenses/expensesSlice.ts"
click node_member_slice "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/features/members/membersSlice.ts"
click node_persistence "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/utils/persistence.ts"
click node_splits "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/utils/split.ts"
click node_money "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/utils/money.ts"
click node_validation "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/utils/validation.ts"
click node_selectors "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/features/expenses/expenseSelectors.ts"
click node_balances "https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/utils/balances.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_routes,node_controller,node_service,node_policy,node_app,node_browser_user toneBlue
class node_candidates,node_jobs,node_postgres,node_storage_tools,node_fixture toneAmber
class node_detective_tools,node_detective_db,node_api_user toneMint
class node_entry,node_router,node_add_page,node_expenses_page,node_balance,node_table toneRose
class node_store,node_expense_slice,node_member_slice,node_persistence,node_splits,node_money,node_validation,node_selectors,node_balances toneIndigo
```

## Components

### Matching API

- [Match routes](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/modules/matching/routes.ts): `backend/src/modules/matching/routes.ts`
- [Match controller](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/modules/matching/controller.ts): `backend/src/modules/matching/controller.ts`
- [Matching service](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/modules/matching/service.ts): `backend/src/modules/matching/service.ts`
- [Ranking policy](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/modules/matching/policy.ts): `backend/src/modules/matching/policy.ts`
- [HTTP app](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/app.ts): `backend/src/app.ts`

### Recruiter Data

- [Candidate repository](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/modules/candidates/repository.ts): `backend/src/modules/candidates/repository.ts`
- [Job repository](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/modules/jobs/repository.ts): `backend/src/modules/jobs/repository.ts`
- **Recruiter database**
- [Migrations and seed](https://github.com/hegdepunithramesh/recruiterflow_assignment/tree/main/backend/src/storage): `backend/src/storage`
- [Fixture validation](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/backend/src/storage/fixture.ts): `backend/src/storage/fixture.ts`

### SQL Detective

- [Detective commands](https://github.com/hegdepunithramesh/recruiterflow_assignment/tree/main/backend/src/detective): `backend/src/detective`
- **Detective database**

### Expense Tracker

- [Frontend entry](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [Page router](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/app/router.tsx): `frontend/src/app/router.tsx`
- [Add expense](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/pages/AddExpensePage.tsx): `frontend/src/pages/AddExpensePage.tsx`
- [Expense overview](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/pages/ExpensesPage.tsx): `frontend/src/pages/ExpensesPage.tsx`
- [Balance summary](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/components/BalanceSummary.tsx): `frontend/src/components/BalanceSummary.tsx`
- [Expense table](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/components/ExpenseTable.tsx): `frontend/src/components/ExpenseTable.tsx`

### Expense State

- [Application store](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/app/store.ts): `frontend/src/app/store.ts`
- [Expense state](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/features/expenses/expensesSlice.ts): `frontend/src/features/expenses/expensesSlice.ts`
- [Member state](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/features/members/membersSlice.ts): `frontend/src/features/members/membersSlice.ts`
- [Local persistence](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/utils/persistence.ts): `frontend/src/utils/persistence.ts`
- [Split calculator](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/utils/split.ts): `frontend/src/utils/split.ts`
- [Money utilities](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/utils/money.ts): `frontend/src/utils/money.ts`
- [Expense validation](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/utils/validation.ts): `frontend/src/utils/validation.ts`
- [Expense selectors](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/features/expenses/expenseSelectors.ts): `frontend/src/features/expenses/expenseSelectors.ts`
- [Balance calculations](https://github.com/hegdepunithramesh/recruiterflow_assignment/blob/main/frontend/src/utils/balances.ts): `frontend/src/utils/balances.ts`

### Other components

- **API caller**
- **Expense tracker user**

## Connections

- API caller → HTTP app: sends request
- HTTP app → Match routes: registers routes (evidence: `backend/src/app.ts`)
- Match routes → Match controller: dispatches (evidence: `backend/src/modules/matching/routes.ts`)
- Match controller → Matching service: requests matches (evidence: `backend/src/modules/matching/controller.ts`)
- Matching service → Candidate repository: reads candidates (evidence: `backend/src/modules/matching/service.ts`)
- Matching service → Job repository: reads jobs (evidence: `backend/src/modules/matching/service.ts`)
- Matching service → Ranking policy: ranks profiles (evidence: `backend/src/modules/matching/service.ts`)
- Match controller → API caller: returns JSON (evidence: `backend/src/modules/matching/controller.ts`)
- Matching service → Recruiter database: reads snapshot
- Migrations and seed → Recruiter database: migrates and seeds
- Fixture validation → Migrations and seed: validates fixture (evidence: `backend/src/storage/fixture.ts`)
- Detective commands → Detective database: loads and queries
- Expense tracker user → Frontend entry: uses tracker (evidence: `frontend/src/main.tsx`)
- Frontend entry → Page router: renders routes (evidence: `frontend/src/main.tsx`)
- Frontend entry → Application store: creates app state (evidence: `frontend/src/main.tsx`)
- Page router → Add expense: routes to form (evidence: `frontend/src/app/router.tsx`)
- Page router → Expense overview: routes to overview (evidence: `frontend/src/app/router.tsx`)
- Add expense → Application store: dispatches expense (evidence: `frontend/src/pages/AddExpensePage.tsx`)
- Add expense → Split calculator: calculates shares (evidence: `frontend/src/pages/AddExpensePage.tsx`)
- Add expense → Money utilities: parses amounts (evidence: `frontend/src/pages/AddExpensePage.tsx`)
- Add expense → Expense validation: validates input (evidence: `frontend/src/pages/AddExpensePage.tsx`)
- Expense overview → Expense selectors: selects expenses (evidence: `frontend/src/pages/ExpensesPage.tsx`)
- Expense overview → Balance summary: renders summary (evidence: `frontend/src/pages/ExpensesPage.tsx`)
- Expense overview → Expense table: renders expenses (evidence: `frontend/src/pages/ExpensesPage.tsx`)
- Application store → Expense state: reduces actions (evidence: `frontend/src/app/store.ts`)
- Application store → Member state: reduces members (evidence: `frontend/src/app/store.ts`)
- Application store → Local persistence: loads and saves (evidence: `frontend/src/app/store.ts`)
- Expense state → Local persistence: checks stored data (evidence: `frontend/src/features/expenses/expensesSlice.ts`)
- Balance summary → Expense selectors: reads selected data (evidence: `frontend/src/components/BalanceSummary.tsx`)
- Balance summary → Balance calculations: computes balances (evidence: `frontend/src/components/BalanceSummary.tsx`)
- Balance summary → Money utilities: formats totals (evidence: `frontend/src/components/BalanceSummary.tsx`)
- Expense table → Money utilities: formats amounts (evidence: `frontend/src/components/ExpenseTable.tsx`)
