# phumudzom574/student-reward-system-2026 architecture

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

- Interactive diagram: https://gitdiagram.com/phumudzom574/student-reward-system-2026
- Repository: https://github.com/phumudzom574/student-reward-system-2026

## Overview

This is a Flask-based student reward system. Staff sign in, manage participants and point rules, record transactions, and review histories, goals, progress, and leaderboards; the app also builds participant PDF reports. The sampled source shows the Flask app dispatching to domain modules, which use a shared MySQL connection helper. The README is only a brief description, and unsampled routes and templates limit confirmation of some UI relationships.

Main entry points: [`app.py`](https://github.com/phumudzom574/student-reward-system-2026/blob/main/app.py) (Flask routes), [`database.py`](https://github.com/phumudzom574/student-reward-system-2026/blob/main/database.py) (DB connection), [`participants.py`](https://github.com/phumudzom574/student-reward-system-2026/blob/main/participants.py) (Participants), [`point_rules.py`](https://github.com/phumudzom574/student-reward-system-2026/blob/main/point_rules.py) (Point rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask routes<br/>[app.py]"]
  node_views["Web pages<br/>[login.html]"]
  node_reports["PDF reports<br/>[app.py]"]
end

subgraph group_people["Participant management"]
  node_participants["Participants<br/>[participants.py]"]
end

subgraph group_rewards["Rewards and goals"]
  node_rules["Point rules<br/>[point_rules.py]"]
  node_transactions["Point transactions"]
  node_goals["Goals<br/>[goals.py]"]
  node_progress["Goal progress<br/>[goal_progress.py]"]
  node_leaderboard["Leaderboard<br/>[leaderboard.py]"]
end

subgraph group_persistence["Persistence and identity"]
  node_users["User validation<br/>[users.py]"]
  node_connection["DB connection<br/>[database.py]"]
end

node_staff(("Staff user"))
node_mysql[("MySQL database")]

node_staff -->|"uses"| node_app
node_app -->|"renders"| node_views
node_app -->|"validates login"| node_users
node_app -->|"manages"| node_participants
node_app -->|"manages"| node_rules
node_app -->|"records and reads"| node_transactions
node_app -->|"manages"| node_goals
node_app -->|"reads and records"| node_progress
node_app -->|"loads"| node_leaderboard
node_app -->|"queries directly"| node_connection
node_app -->|"generates"| node_reports
node_participants -->|"queries"| node_connection
node_users -->|"queries"| node_connection
node_rules -->|"queries"| node_connection
node_transactions -->|"queries"| node_connection
node_goals -->|"queries"| node_connection
node_progress -->|"queries"| node_connection
node_leaderboard -->|"queries"| node_connection
node_connection -->|"connects"| node_mysql

click node_app "https://github.com/phumudzom574/student-reward-system-2026/blob/main/app.py"
click node_views "https://github.com/phumudzom574/student-reward-system-2026/blob/main/login.html"
click node_reports "https://github.com/phumudzom574/student-reward-system-2026/blob/main/app.py"
click node_participants "https://github.com/phumudzom574/student-reward-system-2026/blob/main/participants.py"
click node_users "https://github.com/phumudzom574/student-reward-system-2026/blob/main/users.py"
click node_rules "https://github.com/phumudzom574/student-reward-system-2026/blob/main/point_rules.py"
click node_transactions "https://github.com/phumudzom574/student-reward-system-2026/blob/main/point_transactions.py"
click node_goals "https://github.com/phumudzom574/student-reward-system-2026/blob/main/goals.py"
click node_progress "https://github.com/phumudzom574/student-reward-system-2026/blob/main/goal_progress.py"
click node_leaderboard "https://github.com/phumudzom574/student-reward-system-2026/blob/main/leaderboard.py"
click node_connection "https://github.com/phumudzom574/student-reward-system-2026/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_app,node_views,node_reports,node_staff toneBlue
class node_participants,node_mysql toneAmber
class node_rules,node_transactions,node_goals,node_progress,node_leaderboard toneMint
class node_users,node_connection toneRose
```

## Components

### Web application

- [Flask routes](https://github.com/phumudzom574/student-reward-system-2026/blob/main/app.py): `app.py`
- [Web pages](https://github.com/phumudzom574/student-reward-system-2026/blob/main/login.html): `login.html`
- [PDF reports](https://github.com/phumudzom574/student-reward-system-2026/blob/main/app.py): `app.py`

### Participant management

- [Participants](https://github.com/phumudzom574/student-reward-system-2026/blob/main/participants.py): `participants.py`

### Rewards and goals

- [Point rules](https://github.com/phumudzom574/student-reward-system-2026/blob/main/point_rules.py): `point_rules.py`
- [Point transactions](https://github.com/phumudzom574/student-reward-system-2026/blob/main/point_transactions.py): `point_transactions.py`
- [Goals](https://github.com/phumudzom574/student-reward-system-2026/blob/main/goals.py): `goals.py`
- [Goal progress](https://github.com/phumudzom574/student-reward-system-2026/blob/main/goal_progress.py): `goal_progress.py`
- [Leaderboard](https://github.com/phumudzom574/student-reward-system-2026/blob/main/leaderboard.py): `leaderboard.py`

### Persistence and identity

- [User validation](https://github.com/phumudzom574/student-reward-system-2026/blob/main/users.py): `users.py`
- [DB connection](https://github.com/phumudzom574/student-reward-system-2026/blob/main/database.py): `database.py`

### Other components

- **Staff user**
- **MySQL database**

## Connections

- Staff user → Flask routes: uses
- Flask routes → Web pages: renders (evidence: `app.py`)
- Flask routes → User validation: validates login (evidence: `app.py`)
- Flask routes → Participants: manages (evidence: `app.py`)
- Flask routes → Point rules: manages (evidence: `app.py`)
- Flask routes → Point transactions: records and reads (evidence: `app.py`)
- Flask routes → Goals: manages (evidence: `app.py`)
- Flask routes → Goal progress: reads and records (evidence: `app.py`)
- Flask routes → Leaderboard: loads (evidence: `app.py`)
- Flask routes → DB connection: queries directly (evidence: `app.py`)
- Flask routes → PDF reports: generates (evidence: `app.py`)
- Participants → DB connection: queries (evidence: `participants.py`)
- User validation → DB connection: queries (evidence: `users.py`)
- Point rules → DB connection: queries (evidence: `point_rules.py`)
- Point transactions → DB connection: queries (evidence: `point_transactions.py`)
- Goals → DB connection: queries (evidence: `goals.py`)
- Goal progress → DB connection: queries (evidence: `goal_progress.py`)
- Leaderboard → DB connection: queries (evidence: `leaderboard.py`)
- DB connection → MySQL database: connects (evidence: `database.py`)
