# purvratanpara/jobshield-ai architecture

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

- Interactive diagram: https://gitdiagram.com/purvratanpara/jobshield-ai
- Repository: https://github.com/purvratanpara/jobshield-ai

## Overview

JobShield AI is a student-facing demo frontend, not a live fraud-analysis or account service. The main workflow is to enter an offer or recruiter message, receive a browser-side phrase-based example report, and optionally view it in the results screen or local dashboard. Other documented branches provide a safety guide and non-submitting account previews. The shared UI and application error handling are internal layers. Relationships below rely on excerpts, the source index, and README statements; unsampled implementation details are not inferred.

Main entry points: [`src/routes/check.tsx`](https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/check.tsx) (Offer checker), [`src/components/jobshield/site-layout.tsx`](https://github.com/purvratanpara/jobshield-ai/blob/main/src/components/jobshield/site-layout.tsx) (Site navigation), [`src/routes/results.$scanId.tsx`](https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/results.%24scanId.tsx) (Example report), [`src/routes/dashboard.tsx`](https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/dashboard.tsx) (Demo dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Student experience"]
  node_home["Home screen<br/>[index.tsx]"]
  node_offer_check["Offer checker<br/>[check.tsx]"]
  node_results["Example report"]
  node_dashboard["Demo dashboard<br/>[dashboard.tsx]"]
  node_safety["Safety guide<br/>[safety.tsx]"]
  node_account_preview["Account preview<br/>[auth-preview.tsx]"]
end

subgraph group_analysis["Demo checking"]
  node_demo_logic["Phrase scoring<br/>[jobshield.ts]"]
  node_local_storage[("Browser demo storage<br/>[jobshield.ts]")]
end

subgraph group_shared["Shared application"]
  node_router["Router setup<br/>[router.tsx]"]
  node_route_tree["Route registry<br/>[routeTree.gen.ts]"]
  node_root["Application root<br/>[__root.tsx]"]
  node_site_layout["Site navigation<br/>[site-layout.tsx]"]
  node_ui_components["UI primitives"]
end

subgraph group_errors["Error handling"]
  node_error_capture["Error capture<br/>[error-capture.ts]"]
  node_error_page["Error page<br/>[error-page.ts]"]
  node_error_reporting["Error reporting"]
  node_server["Server middleware<br/>[server.ts]"]
  node_start["Start middleware<br/>[start.ts]"]
end

node_student(("Student"))

node_student -->|"visits"| node_home
node_home -->|"links to"| node_offer_check
node_student -->|"submits text"| node_offer_check
node_offer_check -->|"scores phrases"| node_demo_logic
node_demo_logic -->|"saves reports"| node_local_storage
node_offer_check -->|"shows report"| node_results
node_results -->|"uses report types"| node_demo_logic
node_student -->|"opens history"| node_dashboard
node_dashboard -->|"reads and clears"| node_local_storage
node_student -->|"opens guide"| node_safety
node_student -->|"opens preview"| node_account_preview
node_router -->|"registers routes"| node_route_tree
node_root -->|"uses reporting"| node_error_reporting
node_server -->|"uses capture"| node_error_capture
node_server -->|"uses error page"| node_error_page
node_start -->|"uses error page"| node_error_page
node_offer_check -->|"renders within"| node_site_layout
node_dashboard -->|"renders within"| node_site_layout
node_results -->|"renders within"| node_site_layout
node_safety -->|"renders within"| node_site_layout
node_account_preview -->|"renders within"| node_site_layout

click node_home "https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/index.tsx"
click node_offer_check "https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/check.tsx"
click node_results "https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/results.%24scanId.tsx"
click node_dashboard "https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/dashboard.tsx"
click node_safety "https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/safety.tsx"
click node_account_preview "https://github.com/purvratanpara/jobshield-ai/blob/main/src/components/jobshield/auth-preview.tsx"
click node_demo_logic "https://github.com/purvratanpara/jobshield-ai/blob/main/src/lib/jobshield.ts"
click node_local_storage "https://github.com/purvratanpara/jobshield-ai/blob/main/src/lib/jobshield.ts"
click node_router "https://github.com/purvratanpara/jobshield-ai/blob/main/src/router.tsx"
click node_route_tree "https://github.com/purvratanpara/jobshield-ai/blob/main/src/routeTree.gen.ts"
click node_root "https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/__root.tsx"
click node_site_layout "https://github.com/purvratanpara/jobshield-ai/blob/main/src/components/jobshield/site-layout.tsx"
click node_ui_components "https://github.com/purvratanpara/jobshield-ai/tree/main/src/components/ui"
click node_error_capture "https://github.com/purvratanpara/jobshield-ai/blob/main/src/lib/error-capture.ts"
click node_error_page "https://github.com/purvratanpara/jobshield-ai/blob/main/src/lib/error-page.ts"
click node_error_reporting "https://github.com/purvratanpara/jobshield-ai/blob/main/src/lib/lovable-error-reporting.ts"
click node_server "https://github.com/purvratanpara/jobshield-ai/blob/main/src/server.ts"
click node_start "https://github.com/purvratanpara/jobshield-ai/blob/main/src/start.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_offer_check,node_results,node_dashboard,node_safety,node_account_preview toneBlue
class node_demo_logic,node_local_storage toneAmber
class node_router,node_route_tree,node_root,node_site_layout,node_ui_components toneMint
class node_error_capture,node_error_page,node_error_reporting,node_server,node_start toneRose
class node_student toneIndigo
```

## Components

### Student experience

- [Home screen](https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Offer checker](https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/check.tsx): `src/routes/check.tsx`
- [Example report](https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/results.%24scanId.tsx): `src/routes/results.$scanId.tsx`
- [Demo dashboard](https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/dashboard.tsx): `src/routes/dashboard.tsx`
- [Safety guide](https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/safety.tsx): `src/routes/safety.tsx`
- [Account preview](https://github.com/purvratanpara/jobshield-ai/blob/main/src/components/jobshield/auth-preview.tsx): `src/components/jobshield/auth-preview.tsx`

### Demo checking

- [Phrase scoring](https://github.com/purvratanpara/jobshield-ai/blob/main/src/lib/jobshield.ts): `src/lib/jobshield.ts`
- [Browser demo storage](https://github.com/purvratanpara/jobshield-ai/blob/main/src/lib/jobshield.ts): `src/lib/jobshield.ts`

### Shared application

- [Router setup](https://github.com/purvratanpara/jobshield-ai/blob/main/src/router.tsx): `src/router.tsx`
- [Route registry](https://github.com/purvratanpara/jobshield-ai/blob/main/src/routeTree.gen.ts): `src/routeTree.gen.ts`
- [Application root](https://github.com/purvratanpara/jobshield-ai/blob/main/src/routes/__root.tsx): `src/routes/__root.tsx`
- [Site navigation](https://github.com/purvratanpara/jobshield-ai/blob/main/src/components/jobshield/site-layout.tsx): `src/components/jobshield/site-layout.tsx`
- [UI primitives](https://github.com/purvratanpara/jobshield-ai/tree/main/src/components/ui): `src/components/ui`

### Error handling

- [Error capture](https://github.com/purvratanpara/jobshield-ai/blob/main/src/lib/error-capture.ts): `src/lib/error-capture.ts`
- [Error page](https://github.com/purvratanpara/jobshield-ai/blob/main/src/lib/error-page.ts): `src/lib/error-page.ts`
- [Error reporting](https://github.com/purvratanpara/jobshield-ai/blob/main/src/lib/lovable-error-reporting.ts): `src/lib/lovable-error-reporting.ts`
- [Server middleware](https://github.com/purvratanpara/jobshield-ai/blob/main/src/server.ts): `src/server.ts`
- [Start middleware](https://github.com/purvratanpara/jobshield-ai/blob/main/src/start.ts): `src/start.ts`

### Other components

- **Student**

## Connections

- Student → Home screen: visits
- Home screen → Offer checker: links to (evidence: `src/routes/index.tsx`)
- Student → Offer checker: submits text
- Offer checker → Phrase scoring: scores phrases (evidence: `src/routes/check.tsx`)
- Phrase scoring → Browser demo storage: saves reports (evidence: `src/lib/jobshield.ts`)
- Offer checker → Example report: shows report
- Example report → Phrase scoring: uses report types (evidence: `src/routes/results.$scanId.tsx`)
- Student → Demo dashboard: opens history
- Demo dashboard → Browser demo storage: reads and clears (evidence: `src/routes/dashboard.tsx`)
- Student → Safety guide: opens guide
- Student → Account preview: opens preview
- Router setup → Route registry: registers routes (evidence: `src/router.tsx`)
- Application root → Error reporting: uses reporting (evidence: `src/routes/__root.tsx`)
- Server middleware → Error capture: uses capture (evidence: `src/server.ts`)
- Server middleware → Error page: uses error page (evidence: `src/server.ts`)
- Start middleware → Error page: uses error page (evidence: `src/start.ts`)
- Offer checker → Site navigation: renders within (evidence: `src/routes/check.tsx`)
- Demo dashboard → Site navigation: renders within (evidence: `src/routes/dashboard.tsx`)
- Example report → Site navigation: renders within (evidence: `src/routes/results.$scanId.tsx`)
- Safety guide → Site navigation: renders within (evidence: `src/routes/safety.tsx`)
- Account preview → Site navigation: renders within (evidence: `src/components/jobshield/auth-preview.tsx`)
