# siyusup/web-aplikasi-parkir architecture

> Architecture diagram of the GitHub repository siyusup/web-aplikasi-parkir, 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/siyusup/web-aplikasi-parkir
- Repository: https://github.com/siyusup/web-aplikasi-parkir

## Overview

Web Aplikasi Parkir is a PHP/MySQL parking-management app. Staff requests enter through the public front controller and router; the controllers handle login, vehicle entry/exit, dashboard and report requests, using services and repositories for authentication, fee calculation and parking data. Reports are viewable and exportable as PDF, Excel or CSV. The graph preserves the documented export capability, though its individual export implementations are grouped in the sampled controller. Evidence is limited to the README and indexed or excerpted files; unsampled route details are not inferred.

Main entry points: [`public/index.php`](https://github.com/siyusup/web-aplikasi-parkir/blob/main/public/index.php) (Front controller), [`app/Controller/ParkirController.php`](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Controller/ParkirController.php) (Parking controller), [`app/Controller/UserController.php`](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Controller/UserController.php) (User controller), [`app/Repository/ParkirRepository.php`](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Repository/ParkirRepository.php) (Parking repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_front["Front controller<br/>[index.php]"]
  node_router["Router<br/>[Router.php]"]
  node_middleware["Login middleware"]
end

subgraph group_access["Login and access"]
  node_userctl["User controller<br/>[UserController.php]"]
  node_usersvc["Authentication<br/>[UserService.php]"]
  node_session["Cookie and flash<br/>[SessionService.php]"]
end

subgraph group_parking["Parking operations"]
  node_parkctl["Parking controller"]
  node_parkservice["Parking and fees<br/>[ParkirService.php]"]
  node_parkmodel["Parking record<br/>[Parkir.php]"]
end

subgraph group_data["Persistence"]
  node_parkrepo["Parking repository"]
  node_userrepo["User repository<br/>[UserRepository.php]"]
  node_dbconfig["Database connection<br/>[Database.php]"]
  node_mysql[("MySQL database")]
end

subgraph group_presentation["Views and reports"]
  node_view["View renderer<br/>[View.php]"]
  node_templates["Page templates"]
  node_exports["Parking reports and exports"]
end

node_staff(("Staff"))

node_staff -->|"sends requests"| node_front
node_front -->|"hands off"| node_router
node_front -->|"configures"| node_userctl
node_front -->|"configures"| node_parkctl
node_front -->|"configures"| node_middleware
node_userctl -->|"authenticates"| node_usersvc
node_userctl -->|"sets session"| node_session
node_usersvc -->|"checks credentials"| node_userrepo
node_session -->|"loads user"| node_userrepo
node_parkctl -->|"processes entry and exit"| node_parkservice
node_parkctl -->|"queries parking"| node_parkrepo
node_parkservice -->|"reads and updates"| node_parkrepo
node_parkservice -->|"creates and updates"| node_parkmodel
node_parkrepo -->|"gets connection"| node_dbconfig
node_userrepo -->|"gets connection"| node_dbconfig
node_dbconfig -->|"connects"| node_mysql
node_parkctl -->|"renders pages"| node_view
node_userctl -->|"renders pages"| node_view
node_view -->|"includes templates"| node_templates
node_parkctl -->|"generates PDF, Excel, CSV"| node_exports
node_exports -->|"fetches report rows"| node_parkrepo

click node_front "https://github.com/siyusup/web-aplikasi-parkir/blob/main/public/index.php"
click node_router "https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/App/Router.php"
click node_middleware "https://github.com/siyusup/web-aplikasi-parkir/tree/main/app/Middleware"
click node_userctl "https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Controller/UserController.php"
click node_usersvc "https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Service/UserService.php"
click node_session "https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Service/SessionService.php"
click node_parkctl "https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Controller/ParkirController.php"
click node_parkservice "https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Service/ParkirService.php"
click node_parkmodel "https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Domain/Parkir.php"
click node_parkrepo "https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Repository/ParkirRepository.php"
click node_userrepo "https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Repository/UserRepository.php"
click node_dbconfig "https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Config/Database.php"
click node_view "https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/App/View.php"
click node_templates "https://github.com/siyusup/web-aplikasi-parkir/tree/main/app/View"
click node_exports "https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Controller/ParkirController.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_front,node_router,node_middleware toneBlue
class node_userctl,node_usersvc,node_session toneAmber
class node_parkctl,node_parkservice,node_parkmodel toneMint
class node_parkrepo,node_userrepo,node_dbconfig,node_mysql toneRose
class node_view,node_templates,node_exports,node_staff toneIndigo
```

## Components

### Web entry

- [Front controller](https://github.com/siyusup/web-aplikasi-parkir/blob/main/public/index.php): `public/index.php`
- [Router](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/App/Router.php): `app/App/Router.php`
- [Login middleware](https://github.com/siyusup/web-aplikasi-parkir/tree/main/app/Middleware): `app/Middleware`

### Login and access

- [User controller](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Controller/UserController.php): `app/Controller/UserController.php`
- [Authentication](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Service/UserService.php): `app/Service/UserService.php`
- [Cookie and flash](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Service/SessionService.php): `app/Service/SessionService.php`

### Parking operations

- [Parking controller](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Controller/ParkirController.php): `app/Controller/ParkirController.php`
- [Parking and fees](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Service/ParkirService.php): `app/Service/ParkirService.php`
- [Parking record](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Domain/Parkir.php): `app/Domain/Parkir.php`

### Persistence

- [Parking repository](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Repository/ParkirRepository.php): `app/Repository/ParkirRepository.php`
- [User repository](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Repository/UserRepository.php): `app/Repository/UserRepository.php`
- [Database connection](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Config/Database.php): `app/Config/Database.php`
- **MySQL database**

### Views and reports

- [View renderer](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/App/View.php): `app/App/View.php`
- [Page templates](https://github.com/siyusup/web-aplikasi-parkir/tree/main/app/View): `app/View`
- [Parking reports and exports](https://github.com/siyusup/web-aplikasi-parkir/blob/main/app/Controller/ParkirController.php): `app/Controller/ParkirController.php`

### Other components

- **Staff**

## Connections

- Staff → Front controller: sends requests (evidence: `README.md`)
- Front controller → Router: hands off (evidence: `public/index.php`)
- Front controller → User controller: configures (evidence: `public/index.php`)
- Front controller → Parking controller: configures (evidence: `public/index.php`)
- Front controller → Login middleware: configures (evidence: `public/index.php`)
- User controller → Authentication: authenticates (evidence: `app/Controller/UserController.php`)
- User controller → Cookie and flash: sets session (evidence: `app/Controller/UserController.php`)
- Authentication → User repository: checks credentials (evidence: `app/Service/UserService.php`)
- Cookie and flash → User repository: loads user (evidence: `app/Service/SessionService.php`)
- Parking controller → Parking and fees: processes entry and exit (evidence: `app/Controller/ParkirController.php`)
- Parking controller → Parking repository: queries parking (evidence: `app/Controller/ParkirController.php`)
- Parking and fees → Parking repository: reads and updates (evidence: `app/Service/ParkirService.php`)
- Parking and fees → Parking record: creates and updates (evidence: `app/Service/ParkirService.php`)
- Parking repository → Database connection: gets connection (evidence: `app/Repository/ParkirRepository.php`)
- User repository → Database connection: gets connection (evidence: `app/Repository/UserRepository.php`)
- Database connection → MySQL database: connects (evidence: `app/Config/Database.php`)
- Parking controller → View renderer: renders pages (evidence: `app/Controller/ParkirController.php`)
- User controller → View renderer: renders pages (evidence: `app/Controller/UserController.php`)
- View renderer → Page templates: includes templates (evidence: `app/App/View.php`)
- Parking controller → Parking reports and exports: generates PDF, Excel, CSV (evidence: `README.md`)
- Parking reports and exports → Parking repository: fetches report rows (evidence: `app/Controller/ParkirController.php`)
