# jerwil445/it114_auto_fissh_feedng_project architecture

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

- Interactive diagram: https://gitdiagram.com/jerwil445/it114_auto_fissh_feedng_project
- Repository: https://github.com/jerwil445/it114_auto_fissh_feedng_project

## Overview

AquaFeed Pro is a Flask-based fish-feeder application with account-protected monitoring, feeding controls, scheduling, history, and hardware diagnostics. The main workflow is a user configuring or initiating a feeding in the web interface; Flask routes delegate to the shared feeder service, which coordinates serial commands and persists settings or events. The service also runs scheduled feedings and monitoring independently of page requests. The README documents additional device alarm and LCD schedule behavior; unsampled implementation details are represented only where the repository tree supports them.

Main entry points: [`aquafeed.py`](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/aquafeed.py) (Feeder service), [`app.py`](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/app.py) (Flask entry and serial), [`pages/landing.py`](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/pages/landing.py) (Landing and auth), [`database.py`](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/database.py) (Feeder persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_landing["Landing and auth<br/>[landing.py]"]
  node_landing_ui["Landing client<br/>[landing.js]"]
  node_dashboard["Dashboard routes<br/>[dashboard.py]"]
  node_dashboard_ui["Dashboard client<br/>[dashboard.js]"]
  node_control["Control routes<br/>[control.py]"]
  node_control_ui["Control client<br/>[control.js]"]
  node_history["History routes<br/>[history.py]"]
  node_history_ui["History client<br/>[history.js]"]
  node_hardware["Hardware routes<br/>[hardware.py]"]
  node_hardware_ui["Hardware client<br/>[hardware.js]"]
end

subgraph group_service["Feeder operations"]
  node_app["Flask entry and serial<br/>[app.py]"]
  node_feeder["Feeder service<br/>[aquafeed.py]"]
  node_scheduler["Automation scheduler<br/>[aquafeed.py]"]
  node_diagnostics["Hardware diagnostics<br/>[aquafeed.py]"]
  node_monitoring["Monitoring and alarms<br/>[aquafeed.py]"]
end

subgraph group_device["Hardware interface"]
  node_protocol["Serial protocol<br/>[serial_protocol.py]"]
  node_arduino{{"Feeder controller"}}
  node_firmware["Arduino sketch<br/>[arduino_code.c++]"]
end

subgraph group_data["Persistence and accounts"]
  node_store[("Feeder persistence<br/>[database.py]")]
  node_postgres[("PostgreSQL")]
  node_users[("Account records<br/>[database.py]")]
end

node_user(("Feeder user"))
node_browser(("Web browser"))

node_user -->|"uses"| node_browser
node_browser -->|"opens"| node_landing_ui
node_landing_ui -->|"auth requests"| node_landing
node_landing -->|"reads and writes"| node_users
node_landing -->|"serves landing"| node_browser
node_browser -->|"views"| node_dashboard_ui
node_dashboard_ui -->|"monitor requests"| node_dashboard
node_dashboard -->|"reads monitor"| node_feeder
node_dashboard -->|"serves dashboard"| node_browser
node_browser -->|"configures feeding"| node_control_ui
node_control_ui -->|"settings and feed"| node_control
node_control -->|"delegates operations"| node_feeder
node_control -->|"serves control"| node_browser
node_browser -->|"views history"| node_history_ui
node_history_ui -->|"queries events"| node_history
node_history -->|"reads history"| node_feeder
node_history -->|"serves history"| node_browser
node_browser -->|"starts diagnostics"| node_hardware_ui
node_hardware_ui -->|"test requests"| node_hardware
node_hardware -->|"starts and cancels"| node_diagnostics
node_hardware -->|"serves tests"| node_browser
node_app -->|"initializes service"| node_feeder
node_app -->|"sets up auth"| node_landing
node_scheduler -->|"uses feed operations"| node_feeder
node_scheduler -->|"records executions"| node_store
node_feeder -->|"reads and writes"| node_store
node_store -->|"persists data"| node_postgres
node_landing -->|"loads account data"| node_store
node_monitoring -->|"queries connection"| node_app
node_feeder -->|"sends commands"| node_app
node_app -->|"parses replies"| node_protocol
node_app -->|"serial commands"| node_arduino
node_arduino -->|"serial replies"| node_app
node_diagnostics -->|"coordinates device use"| node_feeder
node_monitoring -->|"checks feeder state"| node_feeder
node_firmware -.->|"runs on"| node_arduino

click node_landing "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/pages/landing.py"
click node_landing_ui "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/static/js/landing.js"
click node_dashboard "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/pages/dashboard.py"
click node_dashboard_ui "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/static/js/dashboard.js"
click node_control "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/pages/control.py"
click node_control_ui "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/static/js/control.js"
click node_history "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/pages/history.py"
click node_history_ui "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/static/js/history.js"
click node_hardware "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/pages/hardware.py"
click node_hardware_ui "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/static/js/hardware.js"
click node_app "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/app.py"
click node_feeder "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/aquafeed.py"
click node_scheduler "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/aquafeed.py"
click node_diagnostics "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/aquafeed.py"
click node_monitoring "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/aquafeed.py"
click node_protocol "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/serial_protocol.py"
click node_firmware "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/arduino_code.c%2B%2B"
click node_store "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/database.py"
click node_users "https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/database.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_landing,node_landing_ui,node_dashboard,node_dashboard_ui,node_control,node_control_ui,node_history,node_history_ui,node_hardware,node_hardware_ui,node_user,node_browser toneBlue
class node_app,node_feeder,node_scheduler,node_diagnostics,node_monitoring toneAmber
class node_protocol,node_arduino,node_firmware toneMint
class node_store,node_postgres,node_users toneRose
```

## Components

### Web experience

- [Landing and auth](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/pages/landing.py): `pages/landing.py`
- [Landing client](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/static/js/landing.js): `static/js/landing.js`
- [Dashboard routes](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/pages/dashboard.py): `pages/dashboard.py`
- [Dashboard client](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/static/js/dashboard.js): `static/js/dashboard.js`
- [Control routes](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/pages/control.py): `pages/control.py`
- [Control client](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/static/js/control.js): `static/js/control.js`
- [History routes](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/pages/history.py): `pages/history.py`
- [History client](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/static/js/history.js): `static/js/history.js`
- [Hardware routes](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/pages/hardware.py): `pages/hardware.py`
- [Hardware client](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/static/js/hardware.js): `static/js/hardware.js`

### Feeder operations

- [Flask entry and serial](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/app.py): `app.py`
- [Feeder service](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/aquafeed.py): `aquafeed.py`
- [Automation scheduler](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/aquafeed.py): `aquafeed.py`
- [Hardware diagnostics](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/aquafeed.py): `aquafeed.py`
- [Monitoring and alarms](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/aquafeed.py): `aquafeed.py`

### Hardware interface

- [Serial protocol](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/serial_protocol.py): `serial_protocol.py`
- **Feeder controller**
- [Arduino sketch](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/arduino_code.c%2B%2B): `arduino_code.c++`

### Persistence and accounts

- [Feeder persistence](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/database.py): `database.py`
- **PostgreSQL**
- [Account records](https://github.com/jerwil445/it114_auto_fissh_feedng_project/blob/main/database.py): `database.py`

### Other components

- **Feeder user**
- **Web browser**

## Connections

- Feeder user → Web browser: uses
- Web browser → Landing client: opens
- Landing client → Landing and auth: auth requests
- Landing and auth → Account records: reads and writes
- Landing and auth → Web browser: serves landing
- Web browser → Dashboard client: views
- Dashboard client → Dashboard routes: monitor requests
- Dashboard routes → Feeder service: reads monitor
- Dashboard routes → Web browser: serves dashboard
- Web browser → Control client: configures feeding
- Control client → Control routes: settings and feed
- Control routes → Feeder service: delegates operations
- Control routes → Web browser: serves control
- Web browser → History client: views history
- History client → History routes: queries events
- History routes → Feeder service: reads history
- History routes → Web browser: serves history
- Web browser → Hardware client: starts diagnostics
- Hardware client → Hardware routes: test requests
- Hardware routes → Hardware diagnostics: starts and cancels
- Hardware routes → Web browser: serves tests
- Flask entry and serial → Feeder service: initializes service
- Flask entry and serial → Landing and auth: sets up auth
- Automation scheduler → Feeder service: uses feed operations
- Automation scheduler → Feeder persistence: records executions
- Feeder service → Feeder persistence: reads and writes
- Feeder persistence → PostgreSQL: persists data
- Landing and auth → Feeder persistence: loads account data
- Monitoring and alarms → Flask entry and serial: queries connection
- Feeder service → Flask entry and serial: sends commands
- Flask entry and serial → Serial protocol: parses replies
- Flask entry and serial → Feeder controller: serial commands
- Feeder controller → Flask entry and serial: serial replies
- Hardware diagnostics → Feeder service: coordinates device use
- Monitoring and alarms → Feeder service: checks feeder state
- Arduino sketch → Feeder controller: runs on
