# takaa04/tugas architecture

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

- Interactive diagram: https://gitdiagram.com/takaa04/tugas
- Repository: https://github.com/takaa04/tugas

## Overview

ChickGuard is a native PHP/MySQL admin web app for monitoring and managing a chicken coop. An admin enters through the login page; authenticated users reach the dashboard and use separate pages to manage feeding and watering schedules, lighting schedules, and daily logs. Schedule forms submit to dedicated handlers, while log search is represented by its page and filter handler. The dashboard’s temperature and humidity display is documented as simulated, not live sensor data. Several authentication and log-handler internals were not sampled, so their detailed wiring is omitted.

Main entry points: [`config/koneksi.php`](https://github.com/takaa04/tugas/blob/main/config/koneksi.php) (DB connection), [`login.php`](https://github.com/takaa04/tugas/blob/main/login.php) (Admin login), [`proses/init_tables.php`](https://github.com/takaa04/tugas/blob/main/proses/init_tables.php) (Table and log helpers), [`pages/log_harian.php`](https://github.com/takaa04/tugas/blob/main/pages/log_harian.php) (Daily logs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and access"]
  node_index["Entry redirect<br/>[index.php]"]
  node_login["Admin login<br/>[login.php]"]
  node_login_handler["Login handler<br/>[proses_login.php]"]
  node_forgot_handler["Password recovery"]
  node_reset_page["Password reset<br/>[reset_password.php]"]
  node_reset_handler["Reset handler"]
end

subgraph group_monitor["Monitoring"]
  node_dashboard["Dashboard<br/>[dashboard.php]"]
  node_daily_logs["Daily logs<br/>[log_harian.php]"]
  node_log_filter["Log search"]
  node_log_handler["Log actions"]
end

subgraph group_management["Coop management"]
  node_feed_page["Feed and water<br/>[pakan_minum.php]"]
  node_feed_handler["Schedule actions"]
  node_light_page["Lighting schedule<br/>[pencahayaan.php]"]
  node_light_handler["Lighting actions"]
end

subgraph group_runtime["Runtime and storage"]
  node_db_config["DB connection<br/>[koneksi.php]"]
  node_init["Table and log helpers<br/>[init_tables.php]"]
  node_database[("MySQL database<br/>[chickguard.sql]")]
  node_layout["Shared layout<br/>[sidebar.php]"]
end

node_admin(("Admin"))

node_admin -->|"opens"| node_index
node_index -->|"redirects unauthenticated"| node_login
node_index -->|"redirects authenticated"| node_dashboard
node_admin -->|"submits credentials"| node_login
node_login -->|"submits"| node_login_handler
node_login_handler -->|"uses connection"| node_db_config
node_login_handler -->|"checks account"| node_database
node_login -.->|"requests recovery"| node_forgot_handler
node_reset_page -.->|"submits reset"| node_reset_handler
node_reset_handler -.->|"uses connection"| node_db_config
node_dashboard -->|"initializes tables"| node_init
node_dashboard -->|"includes navigation"| node_layout
node_daily_logs -->|"includes navigation"| node_layout
node_admin -->|"manages schedules"| node_feed_page
node_feed_page -->|"submits schedule changes"| node_feed_handler
node_feed_handler -->|"uses connection"| node_db_config
node_feed_handler -->|"initializes tables"| node_init
node_admin -->|"manages lighting"| node_light_page
node_light_page -->|"submits schedule changes"| node_light_handler
node_light_handler -->|"uses connection"| node_db_config
node_light_handler -->|"initializes tables"| node_init
node_daily_logs -.->|"requests filtering"| node_log_filter
node_daily_logs -.->|"submits log actions"| node_log_handler
node_log_filter -.->|"uses connection"| node_db_config
node_log_handler -.->|"uses connection"| node_db_config
node_db_config -->|"connects"| node_database
node_init -->|"creates and updates tables"| node_database

click node_index "https://github.com/takaa04/tugas/blob/main/index.php"
click node_login "https://github.com/takaa04/tugas/blob/main/login.php"
click node_login_handler "https://github.com/takaa04/tugas/blob/main/proses/proses_login.php"
click node_forgot_handler "https://github.com/takaa04/tugas/blob/main/proses/proses_lupa_password.php"
click node_reset_page "https://github.com/takaa04/tugas/blob/main/reset_password.php"
click node_reset_handler "https://github.com/takaa04/tugas/blob/main/proses/proses_reset_password.php"
click node_dashboard "https://github.com/takaa04/tugas/blob/main/pages/dashboard.php"
click node_daily_logs "https://github.com/takaa04/tugas/blob/main/pages/log_harian.php"
click node_log_filter "https://github.com/takaa04/tugas/blob/main/proses/filter_log_harian.php"
click node_log_handler "https://github.com/takaa04/tugas/blob/main/proses/proses_log_harian.php"
click node_feed_page "https://github.com/takaa04/tugas/blob/main/pages/pakan_minum.php"
click node_feed_handler "https://github.com/takaa04/tugas/blob/main/proses/proses_pakan_minum.php"
click node_light_page "https://github.com/takaa04/tugas/blob/main/pages/pencahayaan.php"
click node_light_handler "https://github.com/takaa04/tugas/blob/main/proses/proses_pencahayaan.php"
click node_db_config "https://github.com/takaa04/tugas/blob/main/config/koneksi.php"
click node_init "https://github.com/takaa04/tugas/blob/main/proses/init_tables.php"
click node_database "https://github.com/takaa04/tugas/blob/main/database/chickguard.sql"
click node_layout "https://github.com/takaa04/tugas/blob/main/components/sidebar.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_index,node_login,node_login_handler,node_forgot_handler,node_reset_page,node_reset_handler toneBlue
class node_dashboard,node_daily_logs,node_log_filter,node_log_handler toneAmber
class node_feed_page,node_feed_handler,node_light_page,node_light_handler toneMint
class node_db_config,node_init,node_database,node_layout toneRose
class node_admin toneIndigo
```

## Components

### Entry and access

- [Entry redirect](https://github.com/takaa04/tugas/blob/main/index.php): `index.php`
- [Admin login](https://github.com/takaa04/tugas/blob/main/login.php): `login.php`
- [Login handler](https://github.com/takaa04/tugas/blob/main/proses/proses_login.php): `proses/proses_login.php`
- [Password recovery](https://github.com/takaa04/tugas/blob/main/proses/proses_lupa_password.php): `proses/proses_lupa_password.php`
- [Password reset](https://github.com/takaa04/tugas/blob/main/reset_password.php): `reset_password.php`
- [Reset handler](https://github.com/takaa04/tugas/blob/main/proses/proses_reset_password.php): `proses/proses_reset_password.php`

### Monitoring

- [Dashboard](https://github.com/takaa04/tugas/blob/main/pages/dashboard.php): `pages/dashboard.php`
- [Daily logs](https://github.com/takaa04/tugas/blob/main/pages/log_harian.php): `pages/log_harian.php`
- [Log search](https://github.com/takaa04/tugas/blob/main/proses/filter_log_harian.php): `proses/filter_log_harian.php`
- [Log actions](https://github.com/takaa04/tugas/blob/main/proses/proses_log_harian.php): `proses/proses_log_harian.php`

### Coop management

- [Feed and water](https://github.com/takaa04/tugas/blob/main/pages/pakan_minum.php): `pages/pakan_minum.php`
- [Schedule actions](https://github.com/takaa04/tugas/blob/main/proses/proses_pakan_minum.php): `proses/proses_pakan_minum.php`
- [Lighting schedule](https://github.com/takaa04/tugas/blob/main/pages/pencahayaan.php): `pages/pencahayaan.php`
- [Lighting actions](https://github.com/takaa04/tugas/blob/main/proses/proses_pencahayaan.php): `proses/proses_pencahayaan.php`

### Runtime and storage

- [DB connection](https://github.com/takaa04/tugas/blob/main/config/koneksi.php): `config/koneksi.php`
- [Table and log helpers](https://github.com/takaa04/tugas/blob/main/proses/init_tables.php): `proses/init_tables.php`
- [MySQL database](https://github.com/takaa04/tugas/blob/main/database/chickguard.sql): `database/chickguard.sql`
- [Shared layout](https://github.com/takaa04/tugas/blob/main/components/sidebar.php): `components/sidebar.php`

### Other components

- **Admin**

## Connections

- Admin → Entry redirect: opens
- Entry redirect → Admin login: redirects unauthenticated
- Entry redirect → Dashboard: redirects authenticated
- Admin → Admin login: submits credentials
- Admin login → Login handler: submits
- Login handler → DB connection: uses connection
- Login handler → MySQL database: checks account
- Admin login → Password recovery: requests recovery
- Password reset → Reset handler: submits reset
- Reset handler → DB connection: uses connection
- Dashboard → Table and log helpers: initializes tables
- Dashboard → Shared layout: includes navigation
- Daily logs → Shared layout: includes navigation
- Admin → Feed and water: manages schedules
- Feed and water → Schedule actions: submits schedule changes
- Schedule actions → DB connection: uses connection
- Schedule actions → Table and log helpers: initializes tables
- Admin → Lighting schedule: manages lighting
- Lighting schedule → Lighting actions: submits schedule changes
- Lighting actions → DB connection: uses connection
- Lighting actions → Table and log helpers: initializes tables
- Daily logs → Log search: requests filtering
- Daily logs → Log actions: submits log actions
- Log search → DB connection: uses connection
- Log actions → DB connection: uses connection
- DB connection → MySQL database: connects
- Table and log helpers → MySQL database: creates and updates tables
