# teechinyean/degree_final_year_project architecture

> Architecture diagram of the GitHub repository teechinyean/degree_final_year_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/teechinyean/degree_final_year_project
- Repository: https://github.com/teechinyean/degree_final_year_project

## Overview

Green Point combines a recycling station with a PHP user portal and admin console. The principal workflow is: a user starts detection, the station observes camera frames and weight, AI identifies items, and the web application records results that users can review and redeem against rewards. The portal also supports accounts and contact messages; admins manage users, item types, stations, messages, history, reports, and live video. The README documents the hardware/model workflow, but sampled code does not establish every station-to-PHP exchange, so uncertain links are omitted.

Main entry points: [`main_system.py`](https://github.com/teechinyean/degree_final_year_project/blob/main/main_system.py) (Station runtime), [`admin_video_server.py`](https://github.com/teechinyean/degree_final_year_project/blob/main/admin_video_server.py) (Admin video relay), [`Front-end/index.php`](https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/index.php) (Portal and contact), [`Front-end/start_detect_setup.php`](https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/start_detect_setup.php) (Detection setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_station["Detection station"]
  node_station_app["Station runtime<br/>[main_system.py]"]
  node_camera["Camera and weight<br/>[main_system.py]"]
  node_ai_inference["AI inference<br/>[main_system.py]"]
  node_station_setup["Station registration<br/>[setup.py]"]
  node_video_relay["Admin video relay"]
end

subgraph group_portal["User portal"]
  node_portal_home["Portal and contact<br/>[index.php]"]
  node_detection_setup["Detection setup"]
  node_detection_processing["Detection processing"]
  node_detection_results["Detection results"]
  node_user_dashboard["User dashboard<br/>[dashboard.php]"]
  node_rewards["Rewards redemption<br/>[redeem_rewards.php]"]
  node_accounts["User accounts<br/>[register.php]"]
end

subgraph group_admin["Admin console"]
  node_admin_console["Admin reports<br/>[index.php]"]
  node_admin_live["Admin live view<br/>[live_view.php]"]
  node_admin_management["Admin management<br/>[manage_users.php]"]
  node_admin_history["Recycle history<br/>[history.php]"]
  node_admin_export["PDF reports<br/>[generate_pdf.php]"]
end

subgraph group_data["Persistence and services"]
  node_mysql[("MySQL database")]
  node_video_service["Video relay service"]
end

node_user(("Recycling user"))
node_station_pc(("Station PC"))
node_admin_user(("Administrator"))

node_user -->|"visits"| node_portal_home
node_user -->|"starts detection"| node_detection_setup
node_detection_setup -->|"initiates session"| node_station_app
node_station_pc -->|"runs"| node_station_app
node_station_app -->|"captures frames and weight"| node_camera
node_station_app -->|"dispatches frames"| node_ai_inference
node_user -->|"reviews"| node_detection_results
node_user -->|"views activity"| node_user_dashboard
node_user -->|"redeems points"| node_rewards
node_admin_user -->|"views reports"| node_admin_console
node_admin_user -->|"manages records"| node_admin_management
node_admin_user -->|"reviews history"| node_admin_history
node_admin_user -->|"requests report"| node_admin_export
node_admin_user -->|"views video"| node_admin_live
node_admin_live -->|"receives stream"| node_video_relay
node_video_relay -->|"relays video"| node_video_service
node_station_setup -->|"configures station"| node_station_app
node_portal_home -->|"reads and writes messages"| node_mysql
node_admin_console -->|"reads recycle totals"| node_mysql
node_admin_management -->|"manages records"| node_mysql
node_admin_history -->|"reads history"| node_mysql
node_detection_processing -->|"records detection"| node_mysql
node_user_dashboard -->|"reads activity"| node_mysql
node_rewards -->|"updates rewards"| node_mysql
node_accounts -->|"stores account"| node_mysql

click node_station_app "https://github.com/teechinyean/degree_final_year_project/blob/main/main_system.py"
click node_camera "https://github.com/teechinyean/degree_final_year_project/blob/main/main_system.py"
click node_ai_inference "https://github.com/teechinyean/degree_final_year_project/blob/main/main_system.py"
click node_station_setup "https://github.com/teechinyean/degree_final_year_project/blob/main/setup.py"
click node_video_relay "https://github.com/teechinyean/degree_final_year_project/blob/main/admin_video_server.py"
click node_portal_home "https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/index.php"
click node_detection_setup "https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/start_detect_setup.php"
click node_detection_processing "https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/process_detection.php"
click node_detection_results "https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/detection_result.php"
click node_user_dashboard "https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/dashboard.php"
click node_rewards "https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/redeem_rewards.php"
click node_accounts "https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/register.php"
click node_admin_console "https://github.com/teechinyean/degree_final_year_project/blob/main/Admin/index.php"
click node_admin_live "https://github.com/teechinyean/degree_final_year_project/blob/main/Admin/live_view.php"
click node_admin_management "https://github.com/teechinyean/degree_final_year_project/blob/main/Admin/manage_users.php"
click node_admin_history "https://github.com/teechinyean/degree_final_year_project/blob/main/Admin/history.php"
click node_admin_export "https://github.com/teechinyean/degree_final_year_project/blob/main/Admin/generate_pdf.php"

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_station_app,node_camera,node_ai_inference,node_station_setup,node_video_relay,node_user toneBlue
class node_portal_home,node_detection_setup,node_detection_processing,node_detection_results,node_user_dashboard,node_rewards,node_accounts toneAmber
class node_admin_console,node_admin_live,node_admin_management,node_admin_history,node_admin_export toneMint
class node_mysql,node_video_service toneRose
class node_station_pc,node_admin_user toneIndigo
```

## Components

### Detection station

- [Station runtime](https://github.com/teechinyean/degree_final_year_project/blob/main/main_system.py): `main_system.py`
- [Camera and weight](https://github.com/teechinyean/degree_final_year_project/blob/main/main_system.py): `main_system.py`
- [AI inference](https://github.com/teechinyean/degree_final_year_project/blob/main/main_system.py): `main_system.py`
- [Station registration](https://github.com/teechinyean/degree_final_year_project/blob/main/setup.py): `setup.py`
- [Admin video relay](https://github.com/teechinyean/degree_final_year_project/blob/main/admin_video_server.py): `admin_video_server.py`

### User portal

- [Portal and contact](https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/index.php): `Front-end/index.php`
- [Detection setup](https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/start_detect_setup.php): `Front-end/start_detect_setup.php`
- [Detection processing](https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/process_detection.php): `Front-end/process_detection.php`
- [Detection results](https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/detection_result.php): `Front-end/detection_result.php`
- [User dashboard](https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/dashboard.php): `Front-end/dashboard.php`
- [Rewards redemption](https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/redeem_rewards.php): `Front-end/redeem_rewards.php`
- [User accounts](https://github.com/teechinyean/degree_final_year_project/blob/main/Front-end/register.php): `Front-end/register.php`

### Admin console

- [Admin reports](https://github.com/teechinyean/degree_final_year_project/blob/main/Admin/index.php): `Admin/index.php`
- [Admin live view](https://github.com/teechinyean/degree_final_year_project/blob/main/Admin/live_view.php): `Admin/live_view.php`
- [Admin management](https://github.com/teechinyean/degree_final_year_project/blob/main/Admin/manage_users.php): `Admin/manage_users.php`
- [Recycle history](https://github.com/teechinyean/degree_final_year_project/blob/main/Admin/history.php): `Admin/history.php`
- [PDF reports](https://github.com/teechinyean/degree_final_year_project/blob/main/Admin/generate_pdf.php): `Admin/generate_pdf.php`

### Persistence and services

- **MySQL database**
- **Video relay service**

### Other components

- **Recycling user**
- **Station PC**
- **Administrator**

## Connections

- Recycling user → Portal and contact: visits
- Recycling user → Detection setup: starts detection
- Detection setup → Station runtime: initiates session
- Station PC → Station runtime: runs
- Station runtime → Camera and weight: captures frames and weight
- Station runtime → AI inference: dispatches frames
- Recycling user → Detection results: reviews
- Recycling user → User dashboard: views activity
- Recycling user → Rewards redemption: redeems points
- Administrator → Admin reports: views reports
- Administrator → Admin management: manages records
- Administrator → Recycle history: reviews history
- Administrator → PDF reports: requests report
- Administrator → Admin live view: views video
- Admin live view → Admin video relay: receives stream
- Admin video relay → Video relay service: relays video
- Station registration → Station runtime: configures station
- Portal and contact → MySQL database: reads and writes messages
- Admin reports → MySQL database: reads recycle totals
- Admin management → MySQL database: manages records
- Recycle history → MySQL database: reads history
- Detection processing → MySQL database: records detection
- User dashboard → MySQL database: reads activity
- Rewards redemption → MySQL database: updates rewards
- User accounts → MySQL database: stores account
