# deringirish/federal_forensic_case_management_suite architecture

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

- Interactive diagram: https://gitdiagram.com/deringirish/federal_forensic_case_management_suite
- Repository: https://github.com/deringirish/federal_forensic_case_management_suite

## Overview

This is a FastAPI-based forensic case-management suite. Users enter through web pages or JSON endpoints, authenticate, and manage case dossiers, evidence custody, and lab reports; the application persists operational records in MySQL and provides dashboards, analytics, and CSV exports. The graph separates the web/API entry points from domain capabilities and storage. Some routes and templates were not sampled, so those capability links rely on README documentation rather than inspected route implementations.

Main entry points: [`app/web.py`](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py) (Web routes), [`app/main.py`](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/main.py) (API and middleware), [`app/db.py`](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/db.py) (Database access), [`app/analytics.py`](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/analytics.py) (Forensic analytics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_main["API and middleware<br/>[main.py]"]
  node_web["Web routes<br/>[web.py]"]
  node_auth["Authentication and RBAC<br/>[auth.py]"]
  node_templates["Pages and partials"]
end

subgraph group_operations["Case operations"]
  node_cases["Case dossiers<br/>[web.py]"]
  node_participants["Case participants<br/>[web.py]"]
end

subgraph group_evidence["Evidence and lab"]
  node_evidence["Evidence locker<br/>[web.py]"]
  node_custody["Custody transfers<br/>[main.py]"]
  node_lab["Lab reports<br/>[web.py]"]
end

subgraph group_insights["Insights and storage"]
  node_dashboard["Dashboard<br/>[web.py]"]
  node_analytics["Forensic analytics<br/>[analytics.py]"]
  node_exports["CSV exports<br/>[web.py]"]
  node_db["Database access<br/>[db.py]"]
  node_schema["Relational schema<br/>[schema.sql]"]
  node_mysql[("MySQL database")]
end

node_user(("Staff user"))

node_user -->|"sends API requests"| node_main
node_user -->|"uses web pages"| node_web
node_main -->|"registers routes"| node_web
node_main -->|"checks access"| node_auth
node_main -->|"queries and writes"| node_db
node_web -->|"checks sessions"| node_auth
node_web -->|"queries and writes"| node_db
node_web -->|"requests metrics"| node_analytics
node_web -->|"renders pages"| node_templates
node_web -->|"handles dossier workflows"| node_cases
node_web -->|"manages case registry"| node_participants
node_web -->|"handles evidence records"| node_evidence
node_main -->|"handles transfers"| node_custody
node_web -->|"handles lab reports"| node_lab
node_web -->|"serves dashboard"| node_dashboard
node_web -->|"streams CSV"| node_exports
node_analytics -->|"reads case data"| node_db
node_db -->|"executes SQL"| node_mysql
node_db -->|"bootstraps schema"| node_schema

click node_main "https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/main.py"
click node_web "https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py"
click node_auth "https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/auth.py"
click node_templates "https://github.com/deringirish/federal_forensic_case_management_suite/tree/main/templates"
click node_cases "https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py"
click node_participants "https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py"
click node_evidence "https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py"
click node_custody "https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/main.py"
click node_lab "https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py"
click node_dashboard "https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py"
click node_analytics "https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/analytics.py"
click node_exports "https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py"
click node_db "https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/db.py"
click node_schema "https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/database/schema.sql"

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_main,node_web,node_auth,node_templates,node_user toneBlue
class node_cases,node_participants toneAmber
class node_evidence,node_custody,node_lab toneMint
class node_dashboard,node_analytics,node_exports,node_db,node_schema,node_mysql toneRose
```

## Components

### Application entry

- [API and middleware](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/main.py): `app/main.py`
- [Web routes](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py): `app/web.py`
- [Authentication and RBAC](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/auth.py): `app/auth.py`
- [Pages and partials](https://github.com/deringirish/federal_forensic_case_management_suite/tree/main/templates): `templates`

### Case operations

- [Case dossiers](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py): `app/web.py`
- [Case participants](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py): `app/web.py`

### Evidence and lab

- [Evidence locker](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py): `app/web.py`
- [Custody transfers](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/main.py): `app/main.py`
- [Lab reports](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py): `app/web.py`

### Insights and storage

- [Dashboard](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py): `app/web.py`
- [Forensic analytics](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/analytics.py): `app/analytics.py`
- [CSV exports](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/web.py): `app/web.py`
- [Database access](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/app/db.py): `app/db.py`
- [Relational schema](https://github.com/deringirish/federal_forensic_case_management_suite/blob/main/database/schema.sql): `database/schema.sql`
- **MySQL database**

### Other components

- **Staff user**

## Connections

- Staff user → API and middleware: sends API requests (evidence: `README.md`)
- Staff user → Web routes: uses web pages (evidence: `README.md`)
- API and middleware → Web routes: registers routes (evidence: `app/main.py`)
- API and middleware → Authentication and RBAC: checks access (evidence: `app/main.py`)
- API and middleware → Database access: queries and writes (evidence: `app/main.py`)
- Web routes → Authentication and RBAC: checks sessions (evidence: `app/web.py`)
- Web routes → Database access: queries and writes (evidence: `app/web.py`)
- Web routes → Forensic analytics: requests metrics (evidence: `app/web.py`)
- Web routes → Pages and partials: renders pages (evidence: `README.md`)
- Web routes → Case dossiers: handles dossier workflows (evidence: `README.md`)
- Web routes → Case participants: manages case registry (evidence: `README.md`)
- Web routes → Evidence locker: handles evidence records (evidence: `README.md`)
- API and middleware → Custody transfers: handles transfers (evidence: `app/main.py`)
- Web routes → Lab reports: handles lab reports (evidence: `README.md`)
- Web routes → Dashboard: serves dashboard (evidence: `README.md`)
- Web routes → CSV exports: streams CSV (evidence: `README.md`)
- Forensic analytics → Database access: reads case data (evidence: `app/analytics.py`)
- Database access → MySQL database: executes SQL (evidence: `app/db.py`)
- Database access → Relational schema: bootstraps schema (evidence: `README.md`)
