# jsharma9992/security architecture

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

- Interactive diagram: https://gitdiagram.com/jsharma9992/security
- Repository: https://github.com/jsharma9992/security

## Overview

73sec is a web cybersecurity platform for authenticated website technology and vulnerability scans, plus subdomain discovery. Users enter through the web app, submit scans, and view results and saved scan history; separate routes provide scan details and subdomain scans. The sampled scanner API detects technologies and queries the NVD CVE service, while the subdomain API combines DNS checks and certificate-transparency data. MongoDB stores users and scan records. Some UI-to-API connections are explicit in sampled code; unsampled route behavior is not inferred.

Main entry points: [`app/scanner/page.tsx`](https://github.com/jsharma9992/security/blob/main/app/scanner/page.tsx) (Scanner page), [`app/api/auth/options.ts`](https://github.com/jsharma9992/security/blob/main/app/api/auth/options.ts) (Google sign-in), [`lib/mongodb.ts`](https://github.com/jsharma9992/security/blob/main/lib/mongodb.ts) (MongoDB client), [`app/api/scanner/route.ts`](https://github.com/jsharma9992/security/blob/main/app/api/scanner/route.ts) (Technology scan)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_home["Home page<br/>[page.tsx]"]
  node_scannerpage["Scanner page<br/>[page.tsx]"]
  node_scanform["Scan form<br/>[ScanForm.tsx]"]
  node_progress["Scan progress<br/>[ScanProgress.tsx]"]
  node_results["Scan results<br/>[ScanResults.tsx]"]
  node_history["Scan history<br/>[ScanHistory.tsx]"]
  node_subdomainui["Subdomain UI"]
  node_details["Scan details<br/>[page.tsx]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_subdomainpage["Subdomain page<br/>[page.tsx]"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
end

subgraph group_identity["Identity"]
  node_auth["Google sign-in<br/>[options.ts]"]
  node_authroute["Auth route<br/>[route.ts]"]
end

subgraph group_scanning["Scan services"]
  node_siteapi["Technology scan<br/>[route.ts]"]
  node_scanrecord["Scan record routes<br/>[route.ts]"]
  node_scanhistoryapi["Scan history route<br/>[route.ts]"]
  node_subdomainapi["Subdomain discovery<br/>[route.ts]"]
  node_subdetailapi["Subdomain detail route<br/>[route.ts]"]
  node_subhistoryapi["Subdomain history route<br/>[route.ts]"]
end

subgraph group_data["Persistence"]
  node_schemas["Scan schemas<br/>[schemas.ts]"]
  node_mongo["MongoDB client<br/>[mongodb.ts]"]
  node_database[("MongoDB")]
end

node_user(("User"))
node_nvd{{"NVD CVE service"}}
node_crtsh{{"crt.sh"}}

node_user -->|"visits"| node_home
node_user -->|"opens"| node_scannerpage
node_scannerpage -->|"renders"| node_scanform
node_scannerpage -->|"renders"| node_progress
node_scannerpage -->|"renders"| node_results
node_scannerpage -->|"renders"| node_history
node_scannerpage -->|"renders"| node_subdomainui
node_scannerpage -->|"posts scan"| node_siteapi
node_scannerpage -->|"renders"| node_navbar
node_dashboard -->|"renders"| node_navbar
node_details -->|"renders"| node_navbar
node_subdomainpage -->|"renders"| node_navbar
node_authroute -->|"uses options"| node_auth
node_auth -->|"connects users"| node_mongo
node_siteapi -->|"checks session"| node_auth
node_siteapi -->|"reads and writes"| node_mongo
node_siteapi -->|"uses types"| node_schemas
node_siteapi -->|"looks up CVEs"| node_nvd
node_scanrecord -->|"checks session"| node_auth
node_scanrecord -->|"reads and deletes"| node_mongo
node_scanhistoryapi -->|"checks session"| node_auth
node_scanhistoryapi -->|"reads scans"| node_mongo
node_subdomainapi -->|"checks session"| node_auth
node_subdomainapi -->|"saves scans"| node_mongo
node_subdomainapi -->|"uses types"| node_schemas
node_subdomainapi -->|"queries certificates"| node_crtsh
node_subdetailapi -->|"checks session"| node_auth
node_subdetailapi -->|"reads scans"| node_mongo
node_mongo -->|"connects"| node_database

click node_home "https://github.com/jsharma9992/security/blob/main/app/page.tsx"
click node_scannerpage "https://github.com/jsharma9992/security/blob/main/app/scanner/page.tsx"
click node_scanform "https://github.com/jsharma9992/security/blob/main/app/components/scanner/ScanForm.tsx"
click node_progress "https://github.com/jsharma9992/security/blob/main/app/components/scanner/ScanProgress.tsx"
click node_results "https://github.com/jsharma9992/security/blob/main/app/components/scanner/ScanResults.tsx"
click node_history "https://github.com/jsharma9992/security/blob/main/app/components/scanner/ScanHistory.tsx"
click node_subdomainui "https://github.com/jsharma9992/security/blob/main/app/components/scanner/SubdomainScanner.tsx"
click node_details "https://github.com/jsharma9992/security/blob/main/app/scanner/details/%5Bid%5D/page.tsx"
click node_dashboard "https://github.com/jsharma9992/security/blob/main/app/dashboard/page.tsx"
click node_subdomainpage "https://github.com/jsharma9992/security/blob/main/app/subdomain-scanner/page.tsx"
click node_navbar "https://github.com/jsharma9992/security/blob/main/app/components/Navbar.tsx"
click node_auth "https://github.com/jsharma9992/security/blob/main/app/api/auth/options.ts"
click node_authroute "https://github.com/jsharma9992/security/blob/main/app/api/auth/%5B...nextauth%5D/route.ts"
click node_siteapi "https://github.com/jsharma9992/security/blob/main/app/api/scanner/route.ts"
click node_scanrecord "https://github.com/jsharma9992/security/blob/main/app/api/scanner/%5Bid%5D/route.ts"
click node_scanhistoryapi "https://github.com/jsharma9992/security/blob/main/app/api/scanner/history/route.ts"
click node_subdomainapi "https://github.com/jsharma9992/security/blob/main/app/api/subdomain-scanner/route.ts"
click node_subdetailapi "https://github.com/jsharma9992/security/blob/main/app/api/subdomain-scanner/%5Bid%5D/route.ts"
click node_subhistoryapi "https://github.com/jsharma9992/security/blob/main/app/api/subdomain-scanner/history/route.ts"
click node_schemas "https://github.com/jsharma9992/security/blob/main/lib/schemas.ts"
click node_mongo "https://github.com/jsharma9992/security/blob/main/lib/mongodb.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_scannerpage,node_scanform,node_progress,node_results,node_history,node_subdomainui,node_details,node_dashboard,node_subdomainpage,node_navbar,node_user toneBlue
class node_auth,node_authroute toneAmber
class node_siteapi,node_scanrecord,node_scanhistoryapi,node_subdomainapi,node_subdetailapi,node_subhistoryapi toneMint
class node_schemas,node_mongo,node_database toneRose
class node_nvd,node_crtsh toneIndigo
```

## Components

### Web experience

- [Home page](https://github.com/jsharma9992/security/blob/main/app/page.tsx): `app/page.tsx`
- [Scanner page](https://github.com/jsharma9992/security/blob/main/app/scanner/page.tsx): `app/scanner/page.tsx`
- [Scan form](https://github.com/jsharma9992/security/blob/main/app/components/scanner/ScanForm.tsx): `app/components/scanner/ScanForm.tsx`
- [Scan progress](https://github.com/jsharma9992/security/blob/main/app/components/scanner/ScanProgress.tsx): `app/components/scanner/ScanProgress.tsx`
- [Scan results](https://github.com/jsharma9992/security/blob/main/app/components/scanner/ScanResults.tsx): `app/components/scanner/ScanResults.tsx`
- [Scan history](https://github.com/jsharma9992/security/blob/main/app/components/scanner/ScanHistory.tsx): `app/components/scanner/ScanHistory.tsx`
- [Subdomain UI](https://github.com/jsharma9992/security/blob/main/app/components/scanner/SubdomainScanner.tsx): `app/components/scanner/SubdomainScanner.tsx`
- [Scan details](https://github.com/jsharma9992/security/blob/main/app/scanner/details/%5Bid%5D/page.tsx): `app/scanner/details/[id]/page.tsx`
- [Dashboard](https://github.com/jsharma9992/security/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Subdomain page](https://github.com/jsharma9992/security/blob/main/app/subdomain-scanner/page.tsx): `app/subdomain-scanner/page.tsx`
- [Navigation](https://github.com/jsharma9992/security/blob/main/app/components/Navbar.tsx): `app/components/Navbar.tsx`

### Identity

- [Google sign-in](https://github.com/jsharma9992/security/blob/main/app/api/auth/options.ts): `app/api/auth/options.ts`
- [Auth route](https://github.com/jsharma9992/security/blob/main/app/api/auth/%5B...nextauth%5D/route.ts): `app/api/auth/[...nextauth]/route.ts`

### Scan services

- [Technology scan](https://github.com/jsharma9992/security/blob/main/app/api/scanner/route.ts): `app/api/scanner/route.ts`
- [Scan record routes](https://github.com/jsharma9992/security/blob/main/app/api/scanner/%5Bid%5D/route.ts): `app/api/scanner/[id]/route.ts`
- [Scan history route](https://github.com/jsharma9992/security/blob/main/app/api/scanner/history/route.ts): `app/api/scanner/history/route.ts`
- [Subdomain discovery](https://github.com/jsharma9992/security/blob/main/app/api/subdomain-scanner/route.ts): `app/api/subdomain-scanner/route.ts`
- [Subdomain detail route](https://github.com/jsharma9992/security/blob/main/app/api/subdomain-scanner/%5Bid%5D/route.ts): `app/api/subdomain-scanner/[id]/route.ts`
- [Subdomain history route](https://github.com/jsharma9992/security/blob/main/app/api/subdomain-scanner/history/route.ts): `app/api/subdomain-scanner/history/route.ts`

### Persistence

- [Scan schemas](https://github.com/jsharma9992/security/blob/main/lib/schemas.ts): `lib/schemas.ts`
- [MongoDB client](https://github.com/jsharma9992/security/blob/main/lib/mongodb.ts): `lib/mongodb.ts`
- **MongoDB**

### Other components

- **User**
- **NVD CVE service**
- **crt.sh**

## Connections

- User → Home page: visits (evidence: `app/page.tsx`)
- User → Scanner page: opens (evidence: `app/scanner/page.tsx`)
- Scanner page → Scan form: renders (evidence: `app/scanner/page.tsx`)
- Scanner page → Scan progress: renders (evidence: `app/scanner/page.tsx`)
- Scanner page → Scan results: renders (evidence: `app/scanner/page.tsx`)
- Scanner page → Scan history: renders (evidence: `app/scanner/page.tsx`)
- Scanner page → Subdomain UI: renders (evidence: `app/scanner/page.tsx`)
- Scanner page → Technology scan: posts scan (evidence: `app/scanner/page.tsx`)
- Scanner page → Navigation: renders (evidence: `app/scanner/page.tsx`)
- Dashboard → Navigation: renders (evidence: `app/dashboard/page.tsx`)
- Scan details → Navigation: renders (evidence: `app/scanner/details/[id]/page.tsx`)
- Subdomain page → Navigation: renders (evidence: `app/subdomain-scanner/page.tsx`)
- Auth route → Google sign-in: uses options (evidence: `app/api/auth/[...nextauth]/route.ts`)
- Google sign-in → MongoDB client: connects users (evidence: `app/api/auth/options.ts`)
- Technology scan → Google sign-in: checks session (evidence: `app/api/scanner/route.ts`)
- Technology scan → MongoDB client: reads and writes (evidence: `app/api/scanner/route.ts`)
- Technology scan → Scan schemas: uses types (evidence: `app/api/scanner/route.ts`)
- Technology scan → NVD CVE service: looks up CVEs (evidence: `app/api/scanner/route.ts`)
- Scan record routes → Google sign-in: checks session (evidence: `app/api/scanner/[id]/route.ts`)
- Scan record routes → MongoDB client: reads and deletes (evidence: `app/api/scanner/[id]/route.ts`)
- Scan history route → Google sign-in: checks session (evidence: `app/api/scanner/history/route.ts`)
- Scan history route → MongoDB client: reads scans (evidence: `app/api/scanner/history/route.ts`)
- Subdomain discovery → Google sign-in: checks session (evidence: `app/api/subdomain-scanner/route.ts`)
- Subdomain discovery → MongoDB client: saves scans (evidence: `app/api/subdomain-scanner/route.ts`)
- Subdomain discovery → Scan schemas: uses types (evidence: `app/api/subdomain-scanner/route.ts`)
- Subdomain discovery → crt.sh: queries certificates (evidence: `app/api/subdomain-scanner/route.ts`)
- Subdomain detail route → Google sign-in: checks session (evidence: `app/api/subdomain-scanner/[id]/route.ts`)
- Subdomain detail route → MongoDB client: reads scans (evidence: `app/api/subdomain-scanner/[id]/route.ts`)
- MongoDB client → MongoDB: connects (evidence: `lib/mongodb.ts`)
