# akshat200009/phishing-detecting-platform architecture

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

- Interactive diagram: https://gitdiagram.com/akshat200009/phishing-detecting-platform
- Repository: https://github.com/akshat200009/phishing-detecting-platform

## Overview

PhishGuard is a user-facing phishing-analysis portal for scanning URLs and email content, reviewing scan history and reports, and administering accounts and threat statistics. The main workflow runs from the authenticated workspace through a URL or email API controller into analysis services, which score findings, persist scans, and return results; email analysis also submits extracted links to URL analysis. The tree and sampled sources support the scan, auth, history, dashboard, and admin branches. Some controllers and dashboard implementations are unsampled, so their internal call wiring is omitted.

Main entry points: [`frontend/src/api.js`](https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/api.js) (API client), [`src/main/java/com/phishing/urlAnalysis/service/UrlAnalysisService.java`](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/urlAnalysis/service/UrlAnalysisService.java) (URL analysis), [`frontend/src/App.jsx`](https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/App.jsx) (Workspace router), [`src/main/java/com/phishing/emailAnalysis/service/EmailAnalysisService.java`](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/emailAnalysis/service/EmailAnalysisService.java) (Email analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Web portal"]
  node_app["Workspace router<br/>[App.jsx]"]
  node_authui["Portal authentication<br/>[PortalAuthPage.jsx]"]
  node_urlui["URL scanner<br/>[UrlScannerPage.jsx]"]
  node_emailui["Email scanner"]
  node_dashboardui["User dashboard<br/>[DashboardPage.jsx]"]
  node_adminui["Admin dashboard"]
  node_frontendapi["API client<br/>[api.js]"]
end

subgraph group_access["Identity and access"]
  node_authcontroller["Auth endpoints"]
  node_authservice["Authentication<br/>[AuthService.java]"]
  node_userservice["User management<br/>[UserService.java]"]
  node_usercontroller["User endpoints"]
  node_userrepo[("User repository")]
  node_jwtservice["JWT service<br/>[JwtService.java]"]
end

subgraph group_analysis["Threat analysis"]
  node_urlcontroller["URL endpoints"]
  node_urlservice["URL analysis"]
  node_urlchecks["URL checks"]
  node_risk["Risk scoring"]
  node_vt["VirusTotal"]
  node_safe["Safe Browsing"]
  node_urlstore[("URL scan store")]
  node_emailcontroller["Email endpoints"]
  node_emailservice["Email analysis"]
  node_emailchecks["Email checks"]
  node_emailrisk["Email risk scoring"]
  node_emailstore[("Email scan store")]
end

subgraph group_insights["History and administration"]
  node_historycontroller["History endpoints"]
  node_historyservice["Unified history and reports"]
  node_userdashcontroller["User dashboard endpoints"]
  node_userdashservice["User dashboard metrics"]
  node_admindashcontroller["Admin endpoints"]
  node_admindashservice["Admin analytics"]
end

node_user(("User"))
node_externalvt{{"VirusTotal API"}}
node_externalsafe{{"Safe Browsing API"}}

node_user -->|"opens"| node_app
node_app -->|"renders"| node_authui
node_app -->|"routes"| node_urlui
node_app -->|"routes"| node_emailui
node_app -->|"routes"| node_dashboardui
node_app -->|"routes"| node_adminui
node_authui -->|"submits credentials"| node_frontendapi
node_frontendapi -->|"HTTP request"| node_authcontroller
node_authcontroller -->|"delegates auth"| node_authservice
node_authservice -->|"reads/writes users"| node_userrepo
node_authservice -->|"issues token"| node_jwtservice
node_urlui -->|"submits URL"| node_frontendapi
node_emailui -->|"submits email"| node_frontendapi
node_frontendapi -->|"HTTP request"| node_urlcontroller
node_frontendapi -->|"HTTP request"| node_emailcontroller
node_urlcontroller -->|"calls"| node_urlservice
node_urlservice -->|"checks URL"| node_urlchecks
node_urlservice -.->|"submits URL"| node_vt
node_urlservice -.->|"checks URL"| node_safe
node_urlservice -->|"scores findings"| node_risk
node_urlservice -->|"saves scan"| node_urlstore
node_vt -.->|"queries"| node_externalvt
node_safe -.->|"queries"| node_externalsafe
node_emailcontroller -->|"calls"| node_emailservice
node_emailservice -->|"inspects content"| node_emailchecks
node_emailservice -->|"analyzes extracted URLs"| node_urlservice
node_emailservice -->|"scores findings"| node_emailrisk
node_emailservice -->|"saves scan"| node_emailstore
node_dashboardui -->|"requests data"| node_frontendapi
node_adminui -->|"requests data"| node_frontendapi
node_frontendapi -->|"HTTP request"| node_historycontroller
node_historycontroller -->|"calls"| node_historyservice
node_historyservice -->|"reads scans"| node_urlstore
node_historyservice -->|"reads scans"| node_emailstore
node_frontendapi -->|"HTTP request"| node_userdashcontroller
node_userdashcontroller -->|"delegates metrics"| node_userdashservice
node_frontendapi -->|"HTTP request"| node_admindashcontroller
node_admindashcontroller -->|"delegates analytics"| node_admindashservice
node_admindashservice -->|"reads scans"| node_urlstore
node_admindashservice -->|"reads scans"| node_emailstore
node_frontendapi -->|"HTTP request"| node_usercontroller
node_usercontroller -->|"delegates profile/admin"| node_userservice

click node_app "https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/pages/PortalAuthPage.jsx"
click node_urlui "https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/pages/UrlScannerPage.jsx"
click node_emailui "https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/pages/EmailScannerPage.jsx"
click node_dashboardui "https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/pages/DashboardPage.jsx"
click node_adminui "https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/pages/AdminDashboardPage.jsx"
click node_frontendapi "https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/api.js"
click node_authcontroller "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Controllers/AuthController.java"
click node_authservice "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Services/AuthService.java"
click node_userservice "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Services/UserService.java"
click node_usercontroller "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Controllers/UserController.java"
click node_userrepo "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Repositories/UserRepository.java"
click node_jwtservice "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Services/JwtService.java"
click node_urlcontroller "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/urlAnalysis/controller/UrlAnalysisController.java"
click node_urlservice "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/urlAnalysis/service/UrlAnalysisService.java"
click node_urlchecks "https://github.com/akshat200009/phishing-detecting-platform/tree/main/src/main/java/com/phishing/urlAnalysis/service"
click node_risk "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/urlAnalysis/service/RiskScoreService.java"
click node_vt "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/urlAnalysis/service/VirusTotalService.java"
click node_safe "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/urlAnalysis/service/SafeBrowsingService.java"
click node_urlstore "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/urlAnalysis/repository/UrlScanRepository.java"
click node_emailcontroller "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/emailAnalysis/controller/EmailAnalysisController.java"
click node_emailservice "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/emailAnalysis/service/EmailAnalysisService.java"
click node_emailchecks "https://github.com/akshat200009/phishing-detecting-platform/tree/main/src/main/java/com/phishing/emailAnalysis/service"
click node_emailrisk "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/emailAnalysis/service/EmailRiskScoreService.java"
click node_emailstore "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/emailAnalysis/repository/EmailScanRepository.java"
click node_historycontroller "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/scanHistory/controller/ScanHistoryController.java"
click node_historyservice "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/scanHistory/service/ScanHistoryService.java"
click node_userdashcontroller "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Controllers/UserDashboardController.java"
click node_userdashservice "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Services/UserDashboardService.java"
click node_admindashcontroller "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Controllers/AdminDashboardController.java"
click node_admindashservice "https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Services/AdminDashboardService.java"

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_app,node_authui,node_urlui,node_emailui,node_dashboardui,node_adminui,node_frontendapi,node_user toneBlue
class node_authcontroller,node_authservice,node_userservice,node_usercontroller,node_userrepo,node_jwtservice toneAmber
class node_urlcontroller,node_urlservice,node_urlchecks,node_risk,node_vt,node_safe,node_urlstore,node_emailcontroller,node_emailservice,node_emailchecks,node_emailrisk,node_emailstore,node_externalvt,node_externalsafe toneMint
class node_historycontroller,node_historyservice,node_userdashcontroller,node_userdashservice,node_admindashcontroller,node_admindashservice toneRose
```

## Components

### Web portal

- [Workspace router](https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Portal authentication](https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/pages/PortalAuthPage.jsx): `frontend/src/pages/PortalAuthPage.jsx`
- [URL scanner](https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/pages/UrlScannerPage.jsx): `frontend/src/pages/UrlScannerPage.jsx`
- [Email scanner](https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/pages/EmailScannerPage.jsx): `frontend/src/pages/EmailScannerPage.jsx`
- [User dashboard](https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/pages/DashboardPage.jsx): `frontend/src/pages/DashboardPage.jsx`
- [Admin dashboard](https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/pages/AdminDashboardPage.jsx): `frontend/src/pages/AdminDashboardPage.jsx`
- [API client](https://github.com/akshat200009/phishing-detecting-platform/blob/main/frontend/src/api.js): `frontend/src/api.js`

### Identity and access

- [Auth endpoints](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Controllers/AuthController.java): `src/main/java/com/phishing/Controllers/AuthController.java`
- [Authentication](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Services/AuthService.java): `src/main/java/com/phishing/Services/AuthService.java`
- [User management](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Services/UserService.java): `src/main/java/com/phishing/Services/UserService.java`
- [User endpoints](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Controllers/UserController.java): `src/main/java/com/phishing/Controllers/UserController.java`
- [User repository](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Repositories/UserRepository.java): `src/main/java/com/phishing/Repositories/UserRepository.java`
- [JWT service](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Services/JwtService.java): `src/main/java/com/phishing/Services/JwtService.java`

### Threat analysis

- [URL endpoints](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/urlAnalysis/controller/UrlAnalysisController.java): `src/main/java/com/phishing/urlAnalysis/controller/UrlAnalysisController.java`
- [URL analysis](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/urlAnalysis/service/UrlAnalysisService.java): `src/main/java/com/phishing/urlAnalysis/service/UrlAnalysisService.java`
- [URL checks](https://github.com/akshat200009/phishing-detecting-platform/tree/main/src/main/java/com/phishing/urlAnalysis/service): `src/main/java/com/phishing/urlAnalysis/service`
- [Risk scoring](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/urlAnalysis/service/RiskScoreService.java): `src/main/java/com/phishing/urlAnalysis/service/RiskScoreService.java`
- [VirusTotal](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/urlAnalysis/service/VirusTotalService.java): `src/main/java/com/phishing/urlAnalysis/service/VirusTotalService.java`
- [Safe Browsing](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/urlAnalysis/service/SafeBrowsingService.java): `src/main/java/com/phishing/urlAnalysis/service/SafeBrowsingService.java`
- [URL scan store](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/urlAnalysis/repository/UrlScanRepository.java): `src/main/java/com/phishing/urlAnalysis/repository/UrlScanRepository.java`
- [Email endpoints](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/emailAnalysis/controller/EmailAnalysisController.java): `src/main/java/com/phishing/emailAnalysis/controller/EmailAnalysisController.java`
- [Email analysis](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/emailAnalysis/service/EmailAnalysisService.java): `src/main/java/com/phishing/emailAnalysis/service/EmailAnalysisService.java`
- [Email checks](https://github.com/akshat200009/phishing-detecting-platform/tree/main/src/main/java/com/phishing/emailAnalysis/service): `src/main/java/com/phishing/emailAnalysis/service`
- [Email risk scoring](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/emailAnalysis/service/EmailRiskScoreService.java): `src/main/java/com/phishing/emailAnalysis/service/EmailRiskScoreService.java`
- [Email scan store](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/emailAnalysis/repository/EmailScanRepository.java): `src/main/java/com/phishing/emailAnalysis/repository/EmailScanRepository.java`

### History and administration

- [History endpoints](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/scanHistory/controller/ScanHistoryController.java): `src/main/java/com/phishing/scanHistory/controller/ScanHistoryController.java`
- [Unified history and reports](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/scanHistory/service/ScanHistoryService.java): `src/main/java/com/phishing/scanHistory/service/ScanHistoryService.java`
- [User dashboard endpoints](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Controllers/UserDashboardController.java): `src/main/java/com/phishing/Controllers/UserDashboardController.java`
- [User dashboard metrics](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Services/UserDashboardService.java): `src/main/java/com/phishing/Services/UserDashboardService.java`
- [Admin endpoints](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Controllers/AdminDashboardController.java): `src/main/java/com/phishing/Controllers/AdminDashboardController.java`
- [Admin analytics](https://github.com/akshat200009/phishing-detecting-platform/blob/main/src/main/java/com/phishing/Services/AdminDashboardService.java): `src/main/java/com/phishing/Services/AdminDashboardService.java`

### Other components

- **User**
- **VirusTotal API**
- **Safe Browsing API**

## Connections

- User → Workspace router: opens
- Workspace router → Portal authentication: renders
- Workspace router → URL scanner: routes
- Workspace router → Email scanner: routes
- Workspace router → User dashboard: routes
- Workspace router → Admin dashboard: routes
- Portal authentication → API client: submits credentials
- API client → Auth endpoints: HTTP request
- Auth endpoints → Authentication: delegates auth
- Authentication → User repository: reads/writes users
- Authentication → JWT service: issues token
- URL scanner → API client: submits URL
- Email scanner → API client: submits email
- API client → URL endpoints: HTTP request
- API client → Email endpoints: HTTP request
- URL endpoints → URL analysis: calls
- URL analysis → URL checks: checks URL
- URL analysis → VirusTotal: submits URL
- URL analysis → Safe Browsing: checks URL
- URL analysis → Risk scoring: scores findings
- URL analysis → URL scan store: saves scan
- VirusTotal → VirusTotal API: queries
- Safe Browsing → Safe Browsing API: queries
- Email endpoints → Email analysis: calls
- Email analysis → Email checks: inspects content
- Email analysis → URL analysis: analyzes extracted URLs
- Email analysis → Email risk scoring: scores findings
- Email analysis → Email scan store: saves scan
- User dashboard → API client: requests data
- Admin dashboard → API client: requests data
- API client → History endpoints: HTTP request
- History endpoints → Unified history and reports: calls
- Unified history and reports → URL scan store: reads scans
- Unified history and reports → Email scan store: reads scans
- API client → User dashboard endpoints: HTTP request
- User dashboard endpoints → User dashboard metrics: delegates metrics
- API client → Admin endpoints: HTTP request
- Admin endpoints → Admin analytics: delegates analytics
- Admin analytics → URL scan store: reads scans
- Admin analytics → Email scan store: reads scans
- API client → User endpoints: HTTP request
- User endpoints → User management: delegates profile/admin
