# bernatzx/ass-1911107 architecture

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

- Interactive diagram: https://gitdiagram.com/bernatzx/ass-1911107
- Repository: https://github.com/bernatzx/ass-1911107

## Overview

This is a PHP geographic information system for mapping clove-tree locations. Its user-facing stages include browsing the home page and interactive map, and (for administrators) managing tree types and mapped locations; authentication controls administrator access. API endpoints dispatch requests to handlers, handlers apply domain checks and operations through models, and models use the MySQL connection. The excerpts show location-list API use and shared-layout wiring; map data-loading details are not shown, so no map-to-data flow is asserted.

Main entry points: [`src/layout/header.php`](https://github.com/bernatzx/ass-1911107/blob/main/src/layout/header.php) (Page header), [`src/layout/footer.php`](https://github.com/bernatzx/ass-1911107/blob/main/src/layout/footer.php) (Shared footer), [`app/db.php`](https://github.com/bernatzx/ass-1911107/blob/main/app/db.php) (Database connection), [`src/views/lokasi/index.php`](https://github.com/bernatzx/ass-1911107/blob/main/src/views/lokasi/index.php) (Location list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web interface"]
  node_entry["Application entry<br/>[index.php]"]
  node_shell["Page header<br/>[header.php]"]
  node_navigation["Role navigation<br/>[navbar.php]"]
  node_branding["Site branding<br/>[logo.php]"]
  node_footer["Shared footer<br/>[footer.php]"]
  node_home["Home dashboard<br/>[index.php]"]
  node_map["Interactive map<br/>[index.php]"]
  node_location_list["Location list<br/>[index.php]"]
  node_location_form["Location editor<br/>[form.php]"]
  node_type_list["Tree-type list<br/>[index.php]"]
  node_type_form["Tree-type editor<br/>[form.php]"]
  node_login["Admin login<br/>[login.php]"]
end

subgraph group_api["API and domain"]
  node_auth_api["Authentication API<br/>[auth.php]"]
  node_location_api["Location API<br/>[lokasi.php]"]
  node_type_api["Tree-type API<br/>[jenis.php]"]
  node_admin_handler["Admin handler<br/>[AdminHandler.php]"]
  node_location_handler["Location handler<br/>[LokasiHandler.php]"]
  node_type_handler["Tree-type handler<br/>[JPohonHandler.php]"]
end

subgraph group_storage["Persistence"]
  node_admin_model["Admin model<br/>[AdminModel.php]"]
  node_location_model["Location model<br/>[LokasiModel.php]"]
  node_type_model["Tree-type model<br/>[JPohonModel.php]"]
  node_database[("Database connection<br/>[db.php]")]
end

node_visitor(("Visitor or admin"))
node_mysql[("MySQL database")]
node_leaflet["Leaflet library"]

node_visitor -->|"opens app"| node_entry
node_entry -->|"loads app setup"| node_shell
node_home -->|"renders header"| node_shell
node_home -->|"renders footer"| node_footer
node_map -->|"renders header"| node_shell
node_map -->|"renders footer"| node_footer
node_location_list -->|"renders header"| node_shell
node_location_list -->|"renders footer"| node_footer
node_location_list -->|"fetches data"| node_location_api
node_location_form -->|"renders header"| node_shell
node_location_form -->|"renders footer"| node_footer
node_type_list -->|"renders header"| node_shell
node_type_list -->|"renders footer"| node_footer
node_type_form -->|"renders header"| node_shell
node_type_form -->|"renders footer"| node_footer
node_login -->|"uses setup"| node_shell
node_shell -->|"includes"| node_branding
node_shell -->|"includes"| node_navigation
node_shell -.->|"loads library"| node_leaflet
node_footer -->|"checks session"| node_auth_api
node_footer -->|"requests logout"| node_auth_api
node_footer -->|"counts locations"| node_location_api
node_footer -->|"counts types"| node_type_api
node_auth_api -->|"dispatches actions"| node_admin_handler
node_location_api -->|"dispatches requests"| node_location_handler
node_type_api -->|"dispatches requests"| node_type_handler
node_admin_handler -->|"queries admin"| node_admin_model
node_location_handler -->|"uses model"| node_location_model
node_type_handler -->|"uses model"| node_type_model
node_admin_model -->|"queries through"| node_database
node_location_model -->|"queries through"| node_database
node_type_model -->|"queries through"| node_database
node_database -->|"connects to"| node_mysql

click node_entry "https://github.com/bernatzx/ass-1911107/blob/main/index.php"
click node_shell "https://github.com/bernatzx/ass-1911107/blob/main/src/layout/header.php"
click node_navigation "https://github.com/bernatzx/ass-1911107/blob/main/src/components/navbar.php"
click node_branding "https://github.com/bernatzx/ass-1911107/blob/main/src/components/logo.php"
click node_footer "https://github.com/bernatzx/ass-1911107/blob/main/src/layout/footer.php"
click node_home "https://github.com/bernatzx/ass-1911107/blob/main/src/views/beranda/index.php"
click node_map "https://github.com/bernatzx/ass-1911107/blob/main/src/views/peta/index.php"
click node_location_list "https://github.com/bernatzx/ass-1911107/blob/main/src/views/lokasi/index.php"
click node_location_form "https://github.com/bernatzx/ass-1911107/blob/main/src/views/lokasi/form.php"
click node_type_list "https://github.com/bernatzx/ass-1911107/blob/main/src/views/jenis-pohon/index.php"
click node_type_form "https://github.com/bernatzx/ass-1911107/blob/main/src/views/jenis-pohon/form.php"
click node_login "https://github.com/bernatzx/ass-1911107/blob/main/src/views/auth/login.php"
click node_auth_api "https://github.com/bernatzx/ass-1911107/blob/main/api/auth.php"
click node_location_api "https://github.com/bernatzx/ass-1911107/blob/main/api/lokasi.php"
click node_type_api "https://github.com/bernatzx/ass-1911107/blob/main/api/jenis.php"
click node_admin_handler "https://github.com/bernatzx/ass-1911107/blob/main/app/handlers/AdminHandler.php"
click node_location_handler "https://github.com/bernatzx/ass-1911107/blob/main/app/handlers/LokasiHandler.php"
click node_type_handler "https://github.com/bernatzx/ass-1911107/blob/main/app/handlers/JPohonHandler.php"
click node_admin_model "https://github.com/bernatzx/ass-1911107/blob/main/app/models/AdminModel.php"
click node_location_model "https://github.com/bernatzx/ass-1911107/blob/main/app/models/LokasiModel.php"
click node_type_model "https://github.com/bernatzx/ass-1911107/blob/main/app/models/JPohonModel.php"
click node_database "https://github.com/bernatzx/ass-1911107/blob/main/app/db.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_entry,node_shell,node_navigation,node_branding,node_footer,node_home,node_map,node_location_list,node_location_form,node_type_list,node_type_form,node_login toneBlue
class node_auth_api,node_location_api,node_type_api,node_admin_handler,node_location_handler,node_type_handler,node_mysql toneAmber
class node_admin_model,node_location_model,node_type_model,node_database toneMint
class node_visitor,node_leaflet toneIndigo
```

## Components

### Web interface

- [Application entry](https://github.com/bernatzx/ass-1911107/blob/main/index.php): `index.php`
- [Page header](https://github.com/bernatzx/ass-1911107/blob/main/src/layout/header.php): `src/layout/header.php`
- [Role navigation](https://github.com/bernatzx/ass-1911107/blob/main/src/components/navbar.php): `src/components/navbar.php`
- [Site branding](https://github.com/bernatzx/ass-1911107/blob/main/src/components/logo.php): `src/components/logo.php`
- [Shared footer](https://github.com/bernatzx/ass-1911107/blob/main/src/layout/footer.php): `src/layout/footer.php`
- [Home dashboard](https://github.com/bernatzx/ass-1911107/blob/main/src/views/beranda/index.php): `src/views/beranda/index.php`
- [Interactive map](https://github.com/bernatzx/ass-1911107/blob/main/src/views/peta/index.php): `src/views/peta/index.php`
- [Location list](https://github.com/bernatzx/ass-1911107/blob/main/src/views/lokasi/index.php): `src/views/lokasi/index.php`
- [Location editor](https://github.com/bernatzx/ass-1911107/blob/main/src/views/lokasi/form.php): `src/views/lokasi/form.php`
- [Tree-type list](https://github.com/bernatzx/ass-1911107/blob/main/src/views/jenis-pohon/index.php): `src/views/jenis-pohon/index.php`
- [Tree-type editor](https://github.com/bernatzx/ass-1911107/blob/main/src/views/jenis-pohon/form.php): `src/views/jenis-pohon/form.php`
- [Admin login](https://github.com/bernatzx/ass-1911107/blob/main/src/views/auth/login.php): `src/views/auth/login.php`

### API and domain

- [Authentication API](https://github.com/bernatzx/ass-1911107/blob/main/api/auth.php): `api/auth.php`
- [Location API](https://github.com/bernatzx/ass-1911107/blob/main/api/lokasi.php): `api/lokasi.php`
- [Tree-type API](https://github.com/bernatzx/ass-1911107/blob/main/api/jenis.php): `api/jenis.php`
- [Admin handler](https://github.com/bernatzx/ass-1911107/blob/main/app/handlers/AdminHandler.php): `app/handlers/AdminHandler.php`
- [Location handler](https://github.com/bernatzx/ass-1911107/blob/main/app/handlers/LokasiHandler.php): `app/handlers/LokasiHandler.php`
- [Tree-type handler](https://github.com/bernatzx/ass-1911107/blob/main/app/handlers/JPohonHandler.php): `app/handlers/JPohonHandler.php`

### Persistence

- [Admin model](https://github.com/bernatzx/ass-1911107/blob/main/app/models/AdminModel.php): `app/models/AdminModel.php`
- [Location model](https://github.com/bernatzx/ass-1911107/blob/main/app/models/LokasiModel.php): `app/models/LokasiModel.php`
- [Tree-type model](https://github.com/bernatzx/ass-1911107/blob/main/app/models/JPohonModel.php): `app/models/JPohonModel.php`
- [Database connection](https://github.com/bernatzx/ass-1911107/blob/main/app/db.php): `app/db.php`

### Other components

- **Visitor or admin**
- **MySQL database**
- **Leaflet library**

## Connections

- Visitor or admin → Application entry: opens app
- Application entry → Page header: loads app setup (evidence: `index.php`)
- Home dashboard → Page header: renders header (evidence: `src/views/beranda/index.php`)
- Home dashboard → Shared footer: renders footer (evidence: `src/views/beranda/index.php`)
- Interactive map → Page header: renders header (evidence: `src/views/peta/index.php`)
- Interactive map → Shared footer: renders footer (evidence: `src/views/peta/index.php`)
- Location list → Page header: renders header (evidence: `src/views/lokasi/index.php`)
- Location list → Shared footer: renders footer (evidence: `src/views/lokasi/index.php`)
- Location list → Location API: fetches data (evidence: `src/views/lokasi/index.php`)
- Location editor → Page header: renders header (evidence: `src/views/lokasi/form.php`)
- Location editor → Shared footer: renders footer (evidence: `src/views/lokasi/form.php`)
- Tree-type list → Page header: renders header (evidence: `src/views/jenis-pohon/index.php`)
- Tree-type list → Shared footer: renders footer (evidence: `src/views/jenis-pohon/index.php`)
- Tree-type editor → Page header: renders header (evidence: `src/views/jenis-pohon/form.php`)
- Tree-type editor → Shared footer: renders footer (evidence: `src/views/jenis-pohon/form.php`)
- Admin login → Page header: uses setup (evidence: `src/views/auth/login.php`)
- Page header → Site branding: includes (evidence: `src/layout/header.php`)
- Page header → Role navigation: includes (evidence: `src/layout/header.php`)
- Page header → Leaflet library: loads library (evidence: `src/layout/header.php`)
- Shared footer → Authentication API: checks session (evidence: `src/layout/footer.php`)
- Shared footer → Authentication API: requests logout (evidence: `src/layout/footer.php`)
- Shared footer → Location API: counts locations (evidence: `src/layout/footer.php`)
- Shared footer → Tree-type API: counts types (evidence: `src/layout/footer.php`)
- Authentication API → Admin handler: dispatches actions (evidence: `api/auth.php`)
- Location API → Location handler: dispatches requests (evidence: `api/lokasi.php`)
- Tree-type API → Tree-type handler: dispatches requests (evidence: `api/jenis.php`)
- Admin handler → Admin model: queries admin (evidence: `app/handlers/AdminHandler.php`)
- Location handler → Location model: uses model (evidence: `app/handlers/LokasiHandler.php`)
- Tree-type handler → Tree-type model: uses model (evidence: `app/handlers/JPohonHandler.php`)
- Admin model → Database connection: queries through (evidence: `app/models/AdminModel.php`)
- Location model → Database connection: queries through (evidence: `app/models/LokasiModel.php`)
- Tree-type model → Database connection: queries through (evidence: `app/models/JPohonModel.php`)
- Database connection → MySQL database: connects to (evidence: `app/db.php`)
