# shrisha398/origincheck architecture

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

## Overview

OriginCheck is presented as a media-verification application for journalists and fact-checkers. Users enter through a landing page, register or sign in, then use a dashboard to upload media, view verification results, and consult verification history. The repository also contains a Flask backend, AI detector assets, PDF-generation and image-resizing code, plus a separate Express/MySQL authentication service. The supplied excerpts show the frontend structure and some HTTP endpoints, but not the Flask request-handling internals or the upload request, so those connections are left unasserted.

Main entry points: [`src/App.jsx`](https://github.com/shrisha398/origincheck/blob/master/src/App.jsx) (View coordinator), [`src/Dashboard.jsx`](https://github.com/shrisha398/origincheck/blob/master/src/Dashboard.jsx) (Dashboard shell), [`src/SignIn.jsx`](https://github.com/shrisha398/origincheck/blob/master/src/SignIn.jsx) (Sign-in form), [`src/UserDashboard.jsx`](https://github.com/shrisha398/origincheck/blob/master/src/UserDashboard.jsx) (Verification metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["View coordinator<br/>[App.jsx]"]
  node_landing["Landing page"]
  node_signin["Sign-in form<br/>[SignIn.jsx]"]
  node_register["Registration form<br/>[Register.jsx]"]
  node_dashboard["Dashboard shell<br/>[Dashboard.jsx]"]
  node_userdash["Verification metrics<br/>[UserDashboard.jsx]"]
  node_upload["Upload and results"]
  node_history["Verification history"]
end

subgraph group_auth["Authentication service"]
  node_auth_api["Auth API<br/>[server.js]"]
  node_auth_db["MySQL connection pool<br/>[db.js]"]
  node_mysql[("MySQL database")]
end

subgraph group_verification["Verification backend"]
  node_flask["Flask API<br/>[app.py]"]
  node_predict["AI prediction<br/>[predict.py]"]
  node_model["Detector model<br/>[ai_detector.h5]"]
end

subgraph group_utilities["Media and reports"]
  node_pdf["PDF reports<br/>[pdf_generator.py]"]
  node_resize["Image resizing<br/>[resize.py]"]
end

node_visitor(("Visitor or user"))

node_visitor -->|"opens application"| node_app
node_app -->|"renders"| node_landing
node_app -->|"renders"| node_signin
node_app -->|"renders"| node_register
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_upload
node_visitor -->|"browses"| node_landing
node_signin -->|"posts login"| node_auth_api
node_auth_api -->|"queries pool"| node_auth_db
node_auth_db -->|"connects"| node_mysql
node_dashboard -->|"renders"| node_userdash
node_dashboard -->|"renders"| node_upload
node_dashboard -->|"renders"| node_history
node_userdash -->|"fetches dashboard stats"| node_flask
node_history -->|"fetches history"| node_flask

click node_app "https://github.com/shrisha398/origincheck/blob/master/src/App.jsx"
click node_landing "https://github.com/shrisha398/origincheck/blob/master/src/OriginCheckLanding.jsx"
click node_signin "https://github.com/shrisha398/origincheck/blob/master/src/SignIn.jsx"
click node_register "https://github.com/shrisha398/origincheck/blob/master/src/Register.jsx"
click node_dashboard "https://github.com/shrisha398/origincheck/blob/master/src/Dashboard.jsx"
click node_userdash "https://github.com/shrisha398/origincheck/blob/master/src/UserDashboard.jsx"
click node_upload "https://github.com/shrisha398/origincheck/blob/master/src/UploadAndVerify.jsx"
click node_history "https://github.com/shrisha398/origincheck/blob/master/src/VerificationHistory.jsx"
click node_auth_api "https://github.com/shrisha398/origincheck/blob/master/auth-system-mysql/server.js"
click node_auth_db "https://github.com/shrisha398/origincheck/blob/master/auth-system-mysql/db.js"
click node_flask "https://github.com/shrisha398/origincheck/blob/master/backend/app.py"
click node_predict "https://github.com/shrisha398/origincheck/blob/master/backend/predict.py"
click node_model "https://github.com/shrisha398/origincheck/blob/master/backend/model/ai_detector.h5"
click node_pdf "https://github.com/shrisha398/origincheck/blob/master/backend/pdf_generator.py"
click node_resize "https://github.com/shrisha398/origincheck/blob/master/src/resize.py"

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_landing,node_signin,node_register,node_dashboard,node_userdash,node_upload,node_history,node_visitor toneBlue
class node_auth_api,node_auth_db,node_mysql toneAmber
class node_flask,node_predict,node_model toneMint
class node_pdf,node_resize toneRose
```

## Components

### Frontend experience

- [View coordinator](https://github.com/shrisha398/origincheck/blob/master/src/App.jsx): `src/App.jsx`
- [Landing page](https://github.com/shrisha398/origincheck/blob/master/src/OriginCheckLanding.jsx): `src/OriginCheckLanding.jsx`
- [Sign-in form](https://github.com/shrisha398/origincheck/blob/master/src/SignIn.jsx): `src/SignIn.jsx`
- [Registration form](https://github.com/shrisha398/origincheck/blob/master/src/Register.jsx): `src/Register.jsx`
- [Dashboard shell](https://github.com/shrisha398/origincheck/blob/master/src/Dashboard.jsx): `src/Dashboard.jsx`
- [Verification metrics](https://github.com/shrisha398/origincheck/blob/master/src/UserDashboard.jsx): `src/UserDashboard.jsx`
- [Upload and results](https://github.com/shrisha398/origincheck/blob/master/src/UploadAndVerify.jsx): `src/UploadAndVerify.jsx`
- [Verification history](https://github.com/shrisha398/origincheck/blob/master/src/VerificationHistory.jsx): `src/VerificationHistory.jsx`

### Authentication service

- [Auth API](https://github.com/shrisha398/origincheck/blob/master/auth-system-mysql/server.js): `auth-system-mysql/server.js`
- [MySQL connection pool](https://github.com/shrisha398/origincheck/blob/master/auth-system-mysql/db.js): `auth-system-mysql/db.js`
- **MySQL database**

### Verification backend

- [Flask API](https://github.com/shrisha398/origincheck/blob/master/backend/app.py): `backend/app.py`
- [AI prediction](https://github.com/shrisha398/origincheck/blob/master/backend/predict.py): `backend/predict.py`
- [Detector model](https://github.com/shrisha398/origincheck/blob/master/backend/model/ai_detector.h5): `backend/model/ai_detector.h5`

### Media and reports

- [PDF reports](https://github.com/shrisha398/origincheck/blob/master/backend/pdf_generator.py): `backend/pdf_generator.py`
- [Image resizing](https://github.com/shrisha398/origincheck/blob/master/src/resize.py): `src/resize.py`

### Other components

- **Visitor or user**

## Connections

- Visitor or user → View coordinator: opens application
- View coordinator → Landing page: renders (evidence: `src/App.jsx`)
- View coordinator → Sign-in form: renders (evidence: `src/App.jsx`)
- View coordinator → Registration form: renders (evidence: `src/App.jsx`)
- View coordinator → Dashboard shell: renders (evidence: `src/App.jsx`)
- View coordinator → Upload and results: renders (evidence: `src/App.jsx`)
- Visitor or user → Landing page: browses (evidence: `src/OriginCheckLanding.jsx`)
- Sign-in form → Auth API: posts login (evidence: `src/SignIn.jsx`)
- Auth API → MySQL connection pool: queries pool (evidence: `auth-system-mysql/server.js`)
- MySQL connection pool → MySQL database: connects (evidence: `auth-system-mysql/db.js`)
- Dashboard shell → Verification metrics: renders (evidence: `src/Dashboard.jsx`)
- Dashboard shell → Upload and results: renders (evidence: `src/Dashboard.jsx`)
- Dashboard shell → Verification history: renders (evidence: `src/Dashboard.jsx`)
- Verification metrics → Flask API: fetches dashboard stats (evidence: `src/UserDashboard.jsx`)
- Verification history → Flask API: fetches history (evidence: `src/VerificationHistory.jsx`)
