# laila2005/recruitment-agent-wesam architecture

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

- Interactive diagram: https://gitdiagram.com/laila2005/recruitment-agent-wesam
- Repository: https://github.com/laila2005/recruitment-agent-wesam

## Overview

TalentScout AI (Lili) is an autonomous recruiting product with a recruiter dashboard and agent-facing APIs. Recruiters configure roles and import CVs; Lili evaluates queued candidates, optionally verifies GitHub claims, records tier-appropriate outreach, and sends eligible email. Recruiters review results and approve rejections. The README documents dashboard features beyond the sampled UI excerpt; those links are shown as documented rather than inferred from unsampled calls. Supabase and external integrations are represented as services.

Main entry points: [`api/mcp.js`](https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/mcp.js) (MCP Recruiting Tools), [`api/_lib/send-outreach.js`](https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/_lib/send-outreach.js) (Email Dispatch), [`frontend/src/routes/index.tsx`](https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/routes/index.tsx) (Dashboard), [`frontend/src/routeTree.gen.ts`](https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/routeTree.gen.ts) (Route Tree)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Recruiter Dashboard"]
  node_dashboard["Dashboard<br/>[index.tsx]"]
  node_role_setup["Role Setup<br/>[index.tsx]"]
  node_cv_import["CV Import<br/>[index.tsx]"]
  node_web_router["Router<br/>[router.tsx]"]
  node_route_tree["Route Tree<br/>[routeTree.gen.ts]"]
  node_root_route["Root Route<br/>[__root.tsx]"]
  node_web_start["Web Start<br/>[start.ts]"]
  node_web_server["SSR Server<br/>[server.ts]"]
  node_error_capture["Error Capture<br/>[error-capture.ts]"]
  node_error_page["Error Page<br/>[error-page.ts]"]
end

subgraph group_agent["Agent and Screening"]
  node_lili(("Lili Agent"))
  node_mcp["MCP Recruiting Tools<br/>[mcp.js]"]
  node_lili_api["Web Reader API<br/>[&#91;action&#93;.js]"]
  node_github_check["GitHub Verification<br/>[github.js]"]
end

subgraph group_data["Recruiting Data"]
  node_supabase_client["Supabase RPC Client<br/>[supabase.js]"]
  node_supabase[("Supabase")]
end

subgraph group_delivery["Outreach Delivery"]
  node_outreach_record["Outreach Records<br/>[mcp.js]"]
  node_send_outreach["Email Dispatch<br/>[send-outreach.js]"]
  node_approval["Approval Endpoint"]
  node_brevo["Brevo Email"]
end

node_recruiter(("Recruiter"))
node_github["GitHub API"]
node_gmail["Gmail Applications"]

node_recruiter -->|"reviews pipeline"| node_dashboard
node_recruiter -->|"defines requirements"| node_role_setup
node_recruiter -->|"imports CVs"| node_cv_import
node_role_setup -->|"configures roles"| node_dashboard
node_cv_import -->|"populates candidates"| node_dashboard
node_gmail -.->|"provides applications"| node_lili
node_lili -->|"uses recruiting tools"| node_mcp
node_lili -->|"uses web actions"| node_lili_api
node_mcp -->|"calls RPC"| node_supabase_client
node_supabase_client -->|"requests RPC"| node_supabase
node_mcp -->|"verifies profiles"| node_github_check
node_github_check -->|"queries public profiles"| node_github
node_mcp -->|"records outreach"| node_outreach_record
node_lili_api -->|"delegates actions"| node_mcp
node_lili_api -->|"requests sending"| node_send_outreach
node_approval -->|"approves and sends"| node_send_outreach
node_send_outreach -->|"claims and records send"| node_supabase_client
node_send_outreach -->|"sends email"| node_brevo
node_recruiter -->|"approves rejections"| node_approval
node_web_router -->|"uses routes"| node_route_tree
node_route_tree -->|"registers root"| node_root_route
node_route_tree -->|"registers index"| node_dashboard
node_web_server -->|"captures errors"| node_error_capture
node_web_server -->|"renders failures"| node_error_page
node_web_start -->|"uses fallback"| node_error_page

click node_dashboard "https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/routes/index.tsx"
click node_role_setup "https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/routes/index.tsx"
click node_cv_import "https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/routes/index.tsx"
click node_web_router "https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/router.tsx"
click node_route_tree "https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/routeTree.gen.ts"
click node_root_route "https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/routes/__root.tsx"
click node_web_start "https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/start.ts"
click node_web_server "https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/server.ts"
click node_error_capture "https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/lib/error-capture.ts"
click node_error_page "https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/lib/error-page.ts"
click node_mcp "https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/mcp.js"
click node_lili_api "https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/lili/%5Bkey%5D/%5Baction%5D.js"
click node_github_check "https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/_lib/github.js"
click node_supabase_client "https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/_lib/supabase.js"
click node_outreach_record "https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/mcp.js"
click node_send_outreach "https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/_lib/send-outreach.js"
click node_approval "https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/approve-outreach.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_dashboard,node_role_setup,node_cv_import,node_web_router,node_route_tree,node_root_route,node_web_start,node_web_server,node_error_capture,node_error_page toneBlue
class node_lili,node_mcp,node_lili_api,node_github_check toneAmber
class node_supabase_client,node_supabase,node_github toneMint
class node_outreach_record,node_send_outreach,node_approval,node_brevo toneRose
class node_recruiter,node_gmail toneIndigo
```

## Components

### Recruiter Dashboard

- [Dashboard](https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/routes/index.tsx): `frontend/src/routes/index.tsx`
- [Role Setup](https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/routes/index.tsx): `frontend/src/routes/index.tsx`
- [CV Import](https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/routes/index.tsx): `frontend/src/routes/index.tsx`
- [Router](https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/router.tsx): `frontend/src/router.tsx`
- [Route Tree](https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/routeTree.gen.ts): `frontend/src/routeTree.gen.ts`
- [Root Route](https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/routes/__root.tsx): `frontend/src/routes/__root.tsx`
- [Web Start](https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/start.ts): `frontend/src/start.ts`
- [SSR Server](https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/server.ts): `frontend/src/server.ts`
- [Error Capture](https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/lib/error-capture.ts): `frontend/src/lib/error-capture.ts`
- [Error Page](https://github.com/laila2005/recruitment-agent-wesam/blob/main/frontend/src/lib/error-page.ts): `frontend/src/lib/error-page.ts`

### Agent and Screening

- **Lili Agent**
- [MCP Recruiting Tools](https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/mcp.js): `api/mcp.js`
- [Web Reader API](https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/lili/%5Bkey%5D/%5Baction%5D.js): `api/lili/[key]/[action].js`
- [GitHub Verification](https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/_lib/github.js): `api/_lib/github.js`

### Recruiting Data

- [Supabase RPC Client](https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/_lib/supabase.js): `api/_lib/supabase.js`
- **Supabase**

### Outreach Delivery

- [Outreach Records](https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/mcp.js): `api/mcp.js`
- [Email Dispatch](https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/_lib/send-outreach.js): `api/_lib/send-outreach.js`
- [Approval Endpoint](https://github.com/laila2005/recruitment-agent-wesam/blob/main/api/approve-outreach.js): `api/approve-outreach.js`
- **Brevo Email**

### Other components

- **Recruiter**
- **GitHub API**
- **Gmail Applications**

## Connections

- Recruiter → Dashboard: reviews pipeline
- Recruiter → Role Setup: defines requirements
- Recruiter → CV Import: imports CVs
- Role Setup → Dashboard: configures roles (evidence: `frontend/src/routes/index.tsx`)
- CV Import → Dashboard: populates candidates (evidence: `frontend/src/routes/index.tsx`)
- Gmail Applications → Lili Agent: provides applications
- Lili Agent → MCP Recruiting Tools: uses recruiting tools
- Lili Agent → Web Reader API: uses web actions (evidence: `api/lili/[key]/[action].js`)
- MCP Recruiting Tools → Supabase RPC Client: calls RPC (evidence: `api/mcp.js`)
- Supabase RPC Client → Supabase: requests RPC (evidence: `api/_lib/supabase.js`)
- MCP Recruiting Tools → GitHub Verification: verifies profiles (evidence: `api/mcp.js`)
- GitHub Verification → GitHub API: queries public profiles
- MCP Recruiting Tools → Outreach Records: records outreach (evidence: `api/mcp.js`)
- Web Reader API → MCP Recruiting Tools: delegates actions (evidence: `api/lili/[key]/[action].js`)
- Web Reader API → Email Dispatch: requests sending (evidence: `api/lili/[key]/[action].js`)
- Approval Endpoint → Email Dispatch: approves and sends (evidence: `api/approve-outreach.js`)
- Email Dispatch → Supabase RPC Client: claims and records send (evidence: `api/_lib/send-outreach.js`)
- Email Dispatch → Brevo Email: sends email (evidence: `api/_lib/send-outreach.js`)
- Recruiter → Approval Endpoint: approves rejections
- Router → Route Tree: uses routes (evidence: `frontend/src/router.tsx`)
- Route Tree → Root Route: registers root (evidence: `frontend/src/routeTree.gen.ts`)
- Route Tree → Dashboard: registers index (evidence: `frontend/src/routeTree.gen.ts`)
- SSR Server → Error Capture: captures errors (evidence: `frontend/src/server.ts`)
- SSR Server → Error Page: renders failures (evidence: `frontend/src/server.ts`)
- Web Start → Error Page: uses fallback (evidence: `frontend/src/start.ts`)
