# joy-ne-cc/webdev architecture

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

- Interactive diagram: https://gitdiagram.com/joy-ne-cc/webdev
- Repository: https://github.com/joy-ne-cc/webdev

## Overview

Wina Bwangu Booth Operations is a small web app for recording mobile-money booth transactions and reviewing service limits, revenue, and activity. The main workflow is to choose a booth, fetch its offered services, submit an amount, and review saved records and dashboard summaries. The browser uses a Flask API; the API validates booth/service offerings, monthly limits, and amounts before saving transactions. CSV seed data initializes the database, and dashboard figures can fall back to illustrative demo data. The README documents the browser/API workflow; some frontend details are therefore represented only at that level.

Main entry points: [`Backend/app/__init__.py`](https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/__init__.py) (App factory), [`Backend/app/models.py`](https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/models.py) (Booth and transaction models), [`Backend/seed_db.py`](https://github.com/joy-ne-cc/webdev/blob/main/Backend/seed_db.py) (CSV database seeding), [`Frontend/script.js`](https://github.com/joy-ne-cc/webdev/blob/main/Frontend/script.js) (Transaction form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser app"]
  node_login["Login and signup<br/>[auth.js]"]
  node_entry["Transaction form<br/>[script.js]"]
  node_dashboard_ui["Dashboard views<br/>[dashboard.js]"]
  node_demo_data["Illustrative data<br/>[mock-data.js]"]
end

subgraph group_api["Flask API"]
  node_app_factory["App factory<br/>[__init__.py]"]
  node_config["App configuration<br/>[config.py]"]
  node_booth_routes["Booth catalog API<br/>[booths.py]"]
  node_service_routes["Service catalog API<br/>[services.py]"]
  node_transaction_routes["Transaction API<br/>[transactions.py]"]
  node_dashboard_routes["Dashboard API<br/>[dashboard.py]"]
  node_demo_routes["Demo reset API<br/>[demo.py]"]
end

subgraph group_domain["Transaction domain"]
  node_money_rules["Amount and tax rules<br/>[utils.py]"]
end

subgraph group_storage["Data storage"]
  node_models["Booth and transaction models<br/>[models.py]"]
  node_database[("SQLite database")]
  node_seed["CSV database seeding<br/>[seed_db.py]"]
  node_seed_csv["Seed CSV files"]
end

node_agent(("Booth operator"))

node_agent -->|"opens"| node_login
node_agent -->|"enters transaction"| node_entry
node_agent -->|"reviews records"| node_dashboard_ui
node_entry -->|"fetches booth options"| node_booth_routes
node_entry -->|"fetches service catalog"| node_service_routes
node_entry -->|"submits transaction"| node_transaction_routes
node_dashboard_ui -->|"fetches summaries"| node_dashboard_routes
node_dashboard_ui -->|"falls back to"| node_demo_data
node_app_factory -->|"loads"| node_config
node_app_factory -->|"registers"| node_booth_routes
node_app_factory -->|"registers"| node_service_routes
node_app_factory -->|"registers"| node_transaction_routes
node_app_factory -->|"registers"| node_dashboard_routes
node_app_factory -->|"registers"| node_demo_routes
node_booth_routes -->|"queries"| node_models
node_service_routes -->|"queries"| node_models
node_transaction_routes -->|"queries and saves"| node_models
node_transaction_routes -->|"validates and calculates"| node_money_rules
node_dashboard_routes -->|"queries"| node_models
node_dashboard_routes -->|"uses month window"| node_money_rules
node_models -.->|"maps records"| node_database
node_seed -->|"creates records"| node_models
node_seed -->|"reads"| node_seed_csv
node_demo_routes -->|"resets through"| node_seed
node_seed -->|"calculates seeded amounts"| node_money_rules
node_seed -->|"populates"| node_database

click node_login "https://github.com/joy-ne-cc/webdev/blob/main/Frontend/auth.js"
click node_entry "https://github.com/joy-ne-cc/webdev/blob/main/Frontend/script.js"
click node_dashboard_ui "https://github.com/joy-ne-cc/webdev/blob/main/Frontend/dashboard.js"
click node_demo_data "https://github.com/joy-ne-cc/webdev/blob/main/Frontend/mock-data.js"
click node_app_factory "https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/__init__.py"
click node_config "https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/config.py"
click node_booth_routes "https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/routes/booths.py"
click node_service_routes "https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/routes/services.py"
click node_transaction_routes "https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/routes/transactions.py"
click node_dashboard_routes "https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/routes/dashboard.py"
click node_demo_routes "https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/routes/demo.py"
click node_money_rules "https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/utils.py"
click node_models "https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/models.py"
click node_seed "https://github.com/joy-ne-cc/webdev/blob/main/Backend/seed_db.py"
click node_seed_csv "https://github.com/joy-ne-cc/webdev/tree/main/Backend/seed_data"

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_login,node_entry,node_dashboard_ui,node_demo_data toneBlue
class node_app_factory,node_config,node_booth_routes,node_service_routes,node_transaction_routes,node_dashboard_routes,node_demo_routes toneAmber
class node_money_rules toneMint
class node_models,node_database,node_seed,node_seed_csv toneRose
class node_agent toneIndigo
```

## Components

### Browser app

- [Login and signup](https://github.com/joy-ne-cc/webdev/blob/main/Frontend/auth.js): `Frontend/auth.js`
- [Transaction form](https://github.com/joy-ne-cc/webdev/blob/main/Frontend/script.js): `Frontend/script.js`
- [Dashboard views](https://github.com/joy-ne-cc/webdev/blob/main/Frontend/dashboard.js): `Frontend/dashboard.js`
- [Illustrative data](https://github.com/joy-ne-cc/webdev/blob/main/Frontend/mock-data.js): `Frontend/mock-data.js`

### Flask API

- [App factory](https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/__init__.py): `Backend/app/__init__.py`
- [App configuration](https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/config.py): `Backend/app/config.py`
- [Booth catalog API](https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/routes/booths.py): `Backend/app/routes/booths.py`
- [Service catalog API](https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/routes/services.py): `Backend/app/routes/services.py`
- [Transaction API](https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/routes/transactions.py): `Backend/app/routes/transactions.py`
- [Dashboard API](https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/routes/dashboard.py): `Backend/app/routes/dashboard.py`
- [Demo reset API](https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/routes/demo.py): `Backend/app/routes/demo.py`

### Transaction domain

- [Amount and tax rules](https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/utils.py): `Backend/app/utils.py`

### Data storage

- [Booth and transaction models](https://github.com/joy-ne-cc/webdev/blob/main/Backend/app/models.py): `Backend/app/models.py`
- **SQLite database**
- [CSV database seeding](https://github.com/joy-ne-cc/webdev/blob/main/Backend/seed_db.py): `Backend/seed_db.py`
- [Seed CSV files](https://github.com/joy-ne-cc/webdev/tree/main/Backend/seed_data): `Backend/seed_data`

### Other components

- **Booth operator**

## Connections

- Booth operator → Login and signup: opens (evidence: `README.md`)
- Booth operator → Transaction form: enters transaction (evidence: `README.md`)
- Booth operator → Dashboard views: reviews records (evidence: `README.md`)
- Transaction form → Booth catalog API: fetches booth options (evidence: `README.md`)
- Transaction form → Service catalog API: fetches service catalog (evidence: `README.md`)
- Transaction form → Transaction API: submits transaction (evidence: `README.md`)
- Dashboard views → Dashboard API: fetches summaries (evidence: `README.md`)
- Dashboard views → Illustrative data: falls back to (evidence: `README.md`)
- App factory → App configuration: loads (evidence: `Backend/app/__init__.py`)
- App factory → Booth catalog API: registers (evidence: `Backend/app/__init__.py`)
- App factory → Service catalog API: registers (evidence: `Backend/app/__init__.py`)
- App factory → Transaction API: registers (evidence: `Backend/app/__init__.py`)
- App factory → Dashboard API: registers (evidence: `Backend/app/__init__.py`)
- App factory → Demo reset API: registers (evidence: `Backend/app/__init__.py`)
- Booth catalog API → Booth and transaction models: queries (evidence: `Backend/app/routes/booths.py`)
- Service catalog API → Booth and transaction models: queries (evidence: `Backend/app/routes/services.py`)
- Transaction API → Booth and transaction models: queries and saves (evidence: `Backend/app/routes/transactions.py`)
- Transaction API → Amount and tax rules: validates and calculates (evidence: `Backend/app/routes/transactions.py`)
- Dashboard API → Booth and transaction models: queries (evidence: `Backend/app/routes/dashboard.py`)
- Dashboard API → Amount and tax rules: uses month window (evidence: `Backend/app/routes/dashboard.py`)
- Booth and transaction models → SQLite database: maps records
- CSV database seeding → Booth and transaction models: creates records (evidence: `Backend/seed_db.py`)
- CSV database seeding → Seed CSV files: reads (evidence: `Backend/seed_db.py`)
- Demo reset API → CSV database seeding: resets through (evidence: `Backend/app/routes/demo.py`)
- CSV database seeding → Amount and tax rules: calculates seeded amounts (evidence: `Backend/seed_db.py`)
- CSV database seeding → SQLite database: populates (evidence: `Backend/seed_db.py`)
