# qduw/cs50-final-project architecture

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

- Interactive diagram: https://gitdiagram.com/qduw/cs50-final-project
- Repository: https://github.com/qduw/cs50-final-project

## Overview

This is a small Flask security-log analyzer. Users upload a CSV of login events; the app validates and stores the rows, detects brute-force bursts, and presents summary statistics and alerts. The source shows the upload, detection, and database interactions; templates and browser assets exist, but their contents were not sampled, so their internal behavior is not inferred.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_app["Flask routes"]
  node_upload["CSV upload"]
  node_dashboard["Dashboard view"]
  node_alerts_view["Alerts view"]
  node_index_view["Upload page"]
end

subgraph group_analysis["Detection"]
  node_detector["Brute-force detector"]
end

subgraph group_storage["Persistence"]
  node_validation["CSV validation"]
  node_database_helpers["DB helpers"]
  node_logs[("Log records")]
  node_alerts[("Alert records")]
end

node_user(("Analyst"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_index_view
node_app -->|"dispatches"| node_upload
node_upload -->|"validates with"| node_validation
node_upload -->|"stores via"| node_database_helpers
node_database_helpers -->|"writes"| node_logs
node_upload -->|"runs detection"| node_detector
node_detector -->|"reads"| node_logs
node_detector -->|"writes"| node_alerts
node_app -->|"queries"| node_logs
node_app -->|"queries"| node_alerts
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_alerts_view

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_upload,node_dashboard,node_alerts_view,node_index_view toneBlue
class node_detector toneAmber
class node_validation,node_database_helpers,node_logs,node_alerts toneMint
class node_user toneIndigo
```

## Components

### Web interface

- **Flask routes**
- **CSV upload**
- **Dashboard view**
- **Alerts view**
- **Upload page**

### Detection

- **Brute-force detector**

### Persistence

- **CSV validation**
- **DB helpers**
- **Log records**
- **Alert records**

### Other components

- **Analyst**

## Connections

- Analyst → Flask routes: uses
- Flask routes → Upload page: renders
- Flask routes → CSV upload: dispatches
- CSV upload → CSV validation: validates with
- CSV upload → DB helpers: stores via
- DB helpers → Log records: writes
- CSV upload → Brute-force detector: runs detection
- Brute-force detector → Log records: reads
- Brute-force detector → Alert records: writes
- Flask routes → Log records: queries
- Flask routes → Alert records: queries
- Flask routes → Dashboard view: renders
- Flask routes → Alerts view: renders
