# jcgante25-maker/dgdlfc-report architecture

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

- Interactive diagram: https://gitdiagram.com/jcgante25-maker/dgdlfc-report
- Repository: https://github.com/jcgante25-maker/dgdlfc-report

## Overview

This is a bullying-incident reporting and assessment web application. Reporters submit named or anonymous reports, optionally attach evidence, receive a tracking token, and can check status; administrators log in to review cases, update status and notes, delete records, and view summary and category analytics. The graph covers the sampled route/controller flow and documented route behavior. The README is empty, and unsampled view behavior and ancillary middleware are not inferred.

Main entry points: [`routes/admin.js`](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/routes/admin.js) (Admin routes), [`routes/reports.js`](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/routes/reports.js) (Public routes), [`config/db.js`](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/config/db.js) (SQLite setup), [`server.js`](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/server.js) (Express server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public reporting"]
  node_public_pages["Public pages"]
  node_report_routes["Public routes<br/>[reports.js]"]
  node_report_processing["Report intake and tracking"]
  node_evidence_files["Uploaded evidence"]
  node_tracking["Status tracking"]
end

subgraph group_admin["Administration"]
  node_admin_routes["Admin routes<br/>[admin.js]"]
  node_auth["Admin authentication<br/>[authController.js]"]
  node_session_guard["Session guard<br/>[auth.js]"]
  node_case_management["Case management<br/>[adminController.js]"]
  node_admin_pages["Admin pages"]
  node_analytics["Category analytics<br/>[admin.js]"]
end

subgraph group_runtime["Application runtime"]
  node_app_server["Express server<br/>[server.js]"]
end

subgraph group_data["Persistence and email"]
  node_database_config["SQLite setup<br/>[db.js]"]
  node_report_store[("SQLite database<br/>[database.db]")]
  node_mail_service["Confirmation email<br/>[mailService.js]"]
end

node_reporter(("Reporter"))
node_admin_user(("Administrator"))
node_smtp["Gmail SMTP"]

node_reporter -->|"uses"| node_public_pages
node_public_pages -->|"submits requests"| node_report_routes
node_app_server -->|"mounts"| node_report_routes
node_report_routes -->|"dispatches"| node_report_processing
node_report_routes -->|"stores attachments"| node_evidence_files
node_report_processing -->|"writes and reads"| node_database_config
node_database_config -->|"opens and initializes"| node_report_store
node_report_processing -->|"sends confirmation"| node_mail_service
node_mail_service -->|"sends email"| node_smtp
node_reporter -->|"checks status"| node_tracking
node_app_server -->|"routes tracking API"| node_tracking
node_admin_user -->|"uses"| node_admin_pages
node_app_server -->|"mounts"| node_admin_routes
node_admin_routes -->|"dispatches login"| node_auth
node_auth -->|"checks credentials"| node_database_config
node_admin_routes -->|"guards endpoints"| node_session_guard
node_admin_routes -->|"dispatches case actions"| node_case_management
node_case_management -->|"reads and updates"| node_database_config
node_admin_routes -->|"queries categories"| node_analytics

click node_public_pages "https://github.com/jcgante25-maker/dgdlfc-report/tree/main/views/public"
click node_report_routes "https://github.com/jcgante25-maker/dgdlfc-report/blob/main/routes/reports.js"
click node_report_processing "https://github.com/jcgante25-maker/dgdlfc-report/blob/main/controllers/reportController.js"
click node_evidence_files "https://github.com/jcgante25-maker/dgdlfc-report/tree/main/public/uploads"
click node_tracking "https://github.com/jcgante25-maker/dgdlfc-report/blob/main/controllers/reportController.js"
click node_admin_routes "https://github.com/jcgante25-maker/dgdlfc-report/blob/main/routes/admin.js"
click node_auth "https://github.com/jcgante25-maker/dgdlfc-report/blob/main/controllers/authController.js"
click node_session_guard "https://github.com/jcgante25-maker/dgdlfc-report/blob/main/middleware/auth.js"
click node_case_management "https://github.com/jcgante25-maker/dgdlfc-report/blob/main/controllers/adminController.js"
click node_admin_pages "https://github.com/jcgante25-maker/dgdlfc-report/tree/main/views/admin"
click node_analytics "https://github.com/jcgante25-maker/dgdlfc-report/blob/main/routes/admin.js"
click node_app_server "https://github.com/jcgante25-maker/dgdlfc-report/blob/main/server.js"
click node_database_config "https://github.com/jcgante25-maker/dgdlfc-report/blob/main/config/db.js"
click node_report_store "https://github.com/jcgante25-maker/dgdlfc-report/blob/main/database.db"
click node_mail_service "https://github.com/jcgante25-maker/dgdlfc-report/blob/main/services/mailService.js"

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_public_pages,node_report_routes,node_report_processing,node_evidence_files,node_tracking toneBlue
class node_admin_routes,node_auth,node_session_guard,node_case_management,node_admin_pages,node_analytics toneAmber
class node_app_server toneMint
class node_database_config,node_report_store,node_mail_service toneRose
class node_reporter,node_admin_user,node_smtp toneIndigo
```

## Components

### Public reporting

- [Public pages](https://github.com/jcgante25-maker/dgdlfc-report/tree/main/views/public): `views/public`
- [Public routes](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/routes/reports.js): `routes/reports.js`
- [Report intake and tracking](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/controllers/reportController.js): `controllers/reportController.js`
- [Uploaded evidence](https://github.com/jcgante25-maker/dgdlfc-report/tree/main/public/uploads): `public/uploads`
- [Status tracking](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/controllers/reportController.js): `controllers/reportController.js`

### Administration

- [Admin routes](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/routes/admin.js): `routes/admin.js`
- [Admin authentication](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/controllers/authController.js): `controllers/authController.js`
- [Session guard](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/middleware/auth.js): `middleware/auth.js`
- [Case management](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/controllers/adminController.js): `controllers/adminController.js`
- [Admin pages](https://github.com/jcgante25-maker/dgdlfc-report/tree/main/views/admin): `views/admin`
- [Category analytics](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/routes/admin.js): `routes/admin.js`

### Application runtime

- [Express server](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/server.js): `server.js`

### Persistence and email

- [SQLite setup](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/config/db.js): `config/db.js`
- [SQLite database](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/database.db): `database.db`
- [Confirmation email](https://github.com/jcgante25-maker/dgdlfc-report/blob/main/services/mailService.js): `services/mailService.js`

### Other components

- **Reporter**
- **Administrator**
- **Gmail SMTP**

## Connections

- Reporter → Public pages: uses
- Public pages → Public routes: submits requests (evidence: `routes/reports.js`)
- Express server → Public routes: mounts (evidence: `server.js`)
- Public routes → Report intake and tracking: dispatches (evidence: `routes/reports.js`)
- Public routes → Uploaded evidence: stores attachments (evidence: `routes/reports.js`)
- Report intake and tracking → SQLite setup: writes and reads (evidence: `controllers/reportController.js`)
- SQLite setup → SQLite database: opens and initializes (evidence: `config/db.js`)
- Report intake and tracking → Confirmation email: sends confirmation (evidence: `controllers/reportController.js`)
- Confirmation email → Gmail SMTP: sends email (evidence: `services/mailService.js`)
- Reporter → Status tracking: checks status
- Express server → Status tracking: routes tracking API (evidence: `server.js`)
- Administrator → Admin pages: uses
- Express server → Admin routes: mounts (evidence: `server.js`)
- Admin routes → Admin authentication: dispatches login (evidence: `routes/admin.js`)
- Admin authentication → SQLite setup: checks credentials (evidence: `controllers/authController.js`)
- Admin routes → Session guard: guards endpoints (evidence: `routes/admin.js`)
- Admin routes → Case management: dispatches case actions (evidence: `routes/admin.js`)
- Case management → SQLite setup: reads and updates (evidence: `controllers/adminController.js`)
- Admin routes → Category analytics: queries categories (evidence: `routes/admin.js`)
