# herman-junior/project-in-d0020e architecture

> Architecture diagram of the GitHub repository herman-junior/project-in-d0020e, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/herman-junior/project-in-d0020e
- Repository: https://github.com/herman-junior/project-in-d0020e

## Overview

This is a three-tier Flask application for importing sensor/weather CSVs and audio recordings, relating them by time, then querying, exporting, deleting, or restoring data. The main workflow runs from browser uploads through Flask routes and parsing/audio services into MySQL; filtered results and audio-to-environment correlations return through the same backend to the browser. The README documents the broader product capabilities. Some route and service bodies were sampled only partially, so edges are limited to shown calls, indexed references, or documented architecture.

Main entry points: [`Backend/routes.py`](https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/routes.py) (HTTP routes), [`Backend/db.py`](https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/db.py) (Database access), [`Backend/services.py`](https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/services.py) (Audio processing), [`Backend/static/scripts`](https://github.com/herman-junior/project-in-d0020e/tree/main/Backend/static/scripts) (Browser interactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser interface"]
  node_browser["Web browser"]
  node_templates["Page templates"]
  node_scripts["Browser interactions"]
end

subgraph group_web["Flask application"]
  node_entry["Flask entry point<br/>[app.py]"]
  node_routes["HTTP routes<br/>[routes.py]"]
  node_config["Configuration<br/>[config.py]"]
end

subgraph group_data["Data processing"]
  node_csvload["CSV ingestion<br/>[data_loader.py]"]
  node_audio["Audio processing<br/>[services.py]"]
  node_timeutils["Timestamp and audio utilities<br/>[utils.py]"]
end

subgraph group_storage["Persistence"]
  node_dbaccess["Database access<br/>[db.py]"]
  node_mysql[("MySQL database<br/>[Database.sql]")]
  node_audiofiles["Audio file storage"]
end

node_user(("User"))

node_user -->|"uses"| node_browser
node_browser -->|"views pages"| node_templates
node_browser -->|"runs interactions"| node_scripts
node_scripts -->|"requests data"| node_routes
node_entry -->|"registers handlers"| node_routes
node_routes -->|"imports CSV handler"| node_csvload
node_routes -->|"calls data services"| node_audio
node_routes -->|"imports database actions"| node_dbaccess
node_csvload -->|"inserts rows"| node_dbaccess
node_audio -->|"queries and inserts"| node_dbaccess
node_audio -->|"formats metadata"| node_timeutils
node_dbaccess -->|"uses DB settings"| node_config
node_dbaccess -->|"reads and writes"| node_mysql
node_audio -->|"stores recordings"| node_audiofiles
node_config -->|"sets storage directory"| node_audiofiles
node_routes -.->|"returns results"| node_browser

click node_templates "https://github.com/herman-junior/project-in-d0020e/tree/main/Backend/templates"
click node_scripts "https://github.com/herman-junior/project-in-d0020e/tree/main/Backend/static/scripts"
click node_entry "https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/app.py"
click node_routes "https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/routes.py"
click node_config "https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/config.py"
click node_csvload "https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/data_loader.py"
click node_audio "https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/services.py"
click node_timeutils "https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/utils.py"
click node_dbaccess "https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/db.py"
click node_mysql "https://github.com/herman-junior/project-in-d0020e/blob/main/Database/Database.sql"
click node_audiofiles "https://github.com/herman-junior/project-in-d0020e/tree/main/Backend/audio_files"

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_browser,node_templates,node_scripts,node_user toneBlue
class node_entry,node_routes,node_config toneAmber
class node_csvload,node_audio,node_timeutils toneMint
class node_dbaccess,node_mysql,node_audiofiles toneRose
```

## Components

### Browser interface

- **Web browser**
- [Page templates](https://github.com/herman-junior/project-in-d0020e/tree/main/Backend/templates): `Backend/templates`
- [Browser interactions](https://github.com/herman-junior/project-in-d0020e/tree/main/Backend/static/scripts): `Backend/static/scripts`

### Flask application

- [Flask entry point](https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/app.py): `Backend/app.py`
- [HTTP routes](https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/routes.py): `Backend/routes.py`
- [Configuration](https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/config.py): `Backend/config.py`

### Data processing

- [CSV ingestion](https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/data_loader.py): `Backend/data_loader.py`
- [Audio processing](https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/services.py): `Backend/services.py`
- [Timestamp and audio utilities](https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/utils.py): `Backend/utils.py`

### Persistence

- [Database access](https://github.com/herman-junior/project-in-d0020e/blob/main/Backend/db.py): `Backend/db.py`
- [MySQL database](https://github.com/herman-junior/project-in-d0020e/blob/main/Database/Database.sql): `Database/Database.sql`
- [Audio file storage](https://github.com/herman-junior/project-in-d0020e/tree/main/Backend/audio_files): `Backend/audio_files`

### Other components

- **User**

## Connections

- User → Web browser: uses (evidence: `README.md`)
- Web browser → Page templates: views pages (evidence: `README.md`)
- Web browser → Browser interactions: runs interactions (evidence: `README.md`)
- Browser interactions → HTTP routes: requests data (evidence: `Backend/static/scripts/query.js`)
- Flask entry point → HTTP routes: registers handlers (evidence: `Backend/app.py`)
- HTTP routes → CSV ingestion: imports CSV handler (evidence: `Backend/routes.py`)
- HTTP routes → Audio processing: calls data services (evidence: `Backend/routes.py`)
- HTTP routes → Database access: imports database actions (evidence: `Backend/routes.py`)
- CSV ingestion → Database access: inserts rows (evidence: `Backend/data_loader.py`)
- Audio processing → Database access: queries and inserts (evidence: `Backend/services.py`)
- Audio processing → Timestamp and audio utilities: formats metadata (evidence: `Backend/services.py`)
- Database access → Configuration: uses DB settings (evidence: `Backend/db.py`)
- Database access → MySQL database: reads and writes (evidence: `README.md`)
- Audio processing → Audio file storage: stores recordings (evidence: `Backend/services.py`)
- Configuration → Audio file storage: sets storage directory (evidence: `Backend/config.py`)
- HTTP routes → Web browser: returns results
