# alberttobing0311-web/uasalbert24 architecture

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

- Interactive diagram: https://gitdiagram.com/alberttobing0311-web/uasalbert24
- Repository: https://github.com/alberttobing0311-web/uasalbert24

## Overview

#### Purpose and Entry Points
This is a Laravel application for managing sports-field (`Lapangan`) inventory and customer reservations (`Reservasi`), including payment-proof upload and reservation reporting. HTTP traffic enters through `public/index.php`, boots via `bootstrap/app.php`, and is divided between browser routes in `routes/web.php` and token-oriented API routes in `routes/api.php`.

#### Web Application Flow
Server-rendered workflows are handled by MVC controllers:
- Authentication: `app/Http/Controllers/AuthController.php`
- Field management: `app/Http/Controllers/LapanganController.php`
- Reservation creation/listing and proof upload: `app/Http/Controllers/ReservasiController.php`
- Reservation reports/PDF view: `app/Http/Controllers/LaporanController.php`

Controllers render Blade views under `resources/views/`, notably field screens in `resources/views/lapangans/`, reservation screens in `resources/views/reservasis/`, and the report template `resources/views/laporan/reservasi-pdf.blade.php`.

#### API Boundary
A parallel API surface is implemented separately from the browser controllers:
- `app/Http/Controllers/Api/AuthController.php`
- `app/Http/Controllers/Api/LapanganController.php`
- `routes/api.php`

Laravel Sanctum is configured at `config/sanctum.php`, and personal-access-token schema support is present in `database/migrations/2026_07_16_074008_create_personal_access_tokens_table.php`. `app/Http/Resources/LapanganResource.php` defines an explicit API representation boundary for field records.

#### Domain and Persistence
The core domain is represented by Eloquent models:
- `app/Models/User.php`
- `app/Models/Lapangan.php`
- `app/Models/Reservasi.php`

Database structure is managed through migrations, especially `database/migrations/2026_07_16_074117_create_lapangans_table.php` and `database/migrations/2026_07_16_074117_create_reservasis_table.php`. The primary data flow is user/authentication context → field selection and reservation submission → persisted reservation/payment evidence → listing or report output.

#### Validation and Authorization
Request-level validation is separated from controllers for state-changing operations:
- `app/Http/Requests/StoreLapanganRequest.php`
- `app/Http/Requests/UpdateLapanganRequest.php`
- `app/Http/Requests/StoreReservasiRequest.php`
- `app/Http/Requests/UploadBuktiRequest.php`

Role enforcement is centralized in `app/Http/Middleware/CheckRole.php`, forming the authorization boundary for administrative or role-specific routes. Authentication behavior is configured in `config/auth.php`.

#### Files, Reports, and Runtime Services
Payment-proof upload is a material storage boundary, with Laravel filesystem configuration in `config/filesystems.php` and storage roots under `storage/app/private/` and `storage/app/public/`. Reporting is represented by `LaporanController` and a dedicated PDF-oriented Blade template rather than a separate reporting service.

The runtime is PHP/Laravel (`artisan`, `composer.json`) with configurable database, cache, session, queue, mail, logging, and filesystem backends in `config/database.php`, `config/cache.php`, `config/queue.php`, and related configuration. Queue/cache/job migrations are included, but no application-specific job classes are present in the tree.

#### Front-End Delivery
The browser UI is Blade-first, with a shared layout at `resources/views/layouts/app.blade.php`. Vite-managed client assets originate from `resources/js/app.js` and `resources/css/app.css`, configured by `vite.config.js`; these support the server-rendered reservation and management workflows rather than indicating a separate SPA.

Main entry points: [`app/Http/Controllers/ReservasiController.php`](https://github.com/alberttobing0311-web/uasalbert24/blob/main/app/Http/Controllers/ReservasiController.php) (Reservation controllers), [`bootstrap/app.php`](https://github.com/alberttobing0311-web/uasalbert24/blob/main/bootstrap/app.php) (Application bootstrap), [`routes/web.php`](https://github.com/alberttobing0311-web/uasalbert24/blob/main/routes/web.php) (Web routes), [`routes/api.php`](https://github.com/alberttobing0311-web/uasalbert24/blob/main/routes/api.php) (API routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Laravel Runtime"]
  node_public["HTTP entry<br/>PHP entry point<br/>[index.php]"]
  node_bootstrap["Application bootstrap<br/>Laravel bootstrap<br/>[app.php]"]
end

subgraph group_web["Browser MVC"]
  node_web_routes["Web routes<br/>browser routing<br/>[web.php]"]
  node_role_middleware{{"Role enforcement<br/>middleware<br/>[CheckRole.php]"}}
  node_web_controllers["Reservation controllers<br/>MVC controllers"]
  node_requests["Validated requests<br/>form requests"]
  node_blade_views["Blade UI<br/>server-rendered views<br/>[app.blade.php]"]
  node_report_template["PDF report template<br/>Blade report view"]
  node_vite_assets["Client assets<br/>Vite entry<br/>[app.js]"]
end

subgraph group_api["Token API"]
  node_api_routes["API routes<br/>token routing<br/>[api.php]"]
  node_api_controllers["API controllers"]
  node_sanctum{{"Sanctum tokens<br/>API authentication<br/>[sanctum.php]"}}
  node_lapangan_resource["Field representation<br/>API resource"]
end

subgraph group_domain["Domain &amp; Persistence"]
  node_models["Core models<br/>Eloquent models<br/>[Reservasi.php]"]
  node_database[("Application database<br/>persistent data")]
  node_proof_storage[("Payment-proof storage<br/>filesystem storage")]
  node_filesystem_config["Filesystem config<br/>storage configuration<br/>[filesystems.php]"]
end

node_public -->|"boots"| node_bootstrap
node_bootstrap -->|"loads"| node_web_routes
node_bootstrap -->|"loads"| node_api_routes
node_web_routes -->|"applies"| node_role_middleware
node_role_middleware -->|"authorizes"| node_web_controllers
node_web_routes -->|"dispatches"| node_web_controllers
node_web_controllers -->|"uses"| node_requests
node_web_controllers -->|"reads and writes"| node_models
node_web_controllers -->|"renders"| node_blade_views
node_web_controllers -->|"renders report"| node_report_template
node_web_controllers -->|"uploads proof"| node_proof_storage
node_vite_assets -.->|"supports"| node_blade_views
node_api_routes -->|"authenticates with"| node_sanctum
node_api_routes -->|"dispatches"| node_api_controllers
node_sanctum -->|"stores tokens"| node_database
node_api_controllers -->|"queries"| node_models
node_api_controllers -->|"serializes"| node_lapangan_resource
node_models -->|"persists"| node_database
node_filesystem_config -.->|"configures"| node_proof_storage

click node_public "https://github.com/alberttobing0311-web/uasalbert24/blob/main/public/index.php"
click node_bootstrap "https://github.com/alberttobing0311-web/uasalbert24/blob/main/bootstrap/app.php"
click node_web_routes "https://github.com/alberttobing0311-web/uasalbert24/blob/main/routes/web.php"
click node_api_routes "https://github.com/alberttobing0311-web/uasalbert24/blob/main/routes/api.php"
click node_role_middleware "https://github.com/alberttobing0311-web/uasalbert24/blob/main/app/Http/Middleware/CheckRole.php"
click node_web_controllers "https://github.com/alberttobing0311-web/uasalbert24/blob/main/app/Http/Controllers/ReservasiController.php"
click node_requests "https://github.com/alberttobing0311-web/uasalbert24/blob/main/app/Http/Requests/StoreReservasiRequest.php"
click node_blade_views "https://github.com/alberttobing0311-web/uasalbert24/blob/main/resources/views/layouts/app.blade.php"
click node_report_template "https://github.com/alberttobing0311-web/uasalbert24/blob/main/resources/views/laporan/reservasi-pdf.blade.php"
click node_vite_assets "https://github.com/alberttobing0311-web/uasalbert24/blob/main/resources/js/app.js"
click node_api_controllers "https://github.com/alberttobing0311-web/uasalbert24/blob/main/app/Http/Controllers/Api/LapanganController.php"
click node_sanctum "https://github.com/alberttobing0311-web/uasalbert24/blob/main/config/sanctum.php"
click node_lapangan_resource "https://github.com/alberttobing0311-web/uasalbert24/blob/main/app/Http/Resources/LapanganResource.php"
click node_models "https://github.com/alberttobing0311-web/uasalbert24/blob/main/app/Models/Reservasi.php"
click node_database "https://github.com/alberttobing0311-web/uasalbert24/blob/main/database/migrations/2026_07_16_074117_create_reservasis_table.php"
click node_proof_storage "https://github.com/alberttobing0311-web/uasalbert24/tree/main/storage/app/private"
click node_filesystem_config "https://github.com/alberttobing0311-web/uasalbert24/blob/main/config/filesystems.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_public,node_bootstrap toneBlue
class node_web_routes,node_role_middleware,node_web_controllers,node_requests,node_blade_views,node_report_template,node_vite_assets toneAmber
class node_api_routes,node_api_controllers,node_sanctum,node_lapangan_resource toneMint
class node_models,node_database,node_proof_storage,node_filesystem_config toneRose
```

## Components

### Laravel Runtime

- [HTTP entry](https://github.com/alberttobing0311-web/uasalbert24/blob/main/public/index.php): PHP entry point · `public/index.php`
- [Application bootstrap](https://github.com/alberttobing0311-web/uasalbert24/blob/main/bootstrap/app.php): Laravel bootstrap · `bootstrap/app.php`

### Browser MVC

- [Web routes](https://github.com/alberttobing0311-web/uasalbert24/blob/main/routes/web.php): browser routing · `routes/web.php`
- [Role enforcement](https://github.com/alberttobing0311-web/uasalbert24/blob/main/app/Http/Middleware/CheckRole.php): middleware · Guards administrative and role-specific routes. · `app/Http/Middleware/CheckRole.php`
- [Reservation controllers](https://github.com/alberttobing0311-web/uasalbert24/blob/main/app/Http/Controllers/ReservasiController.php): MVC controllers · Handles authentication, fields, reservations, uploads, and reports. · `app/Http/Controllers/ReservasiController.php`
- [Validated requests](https://github.com/alberttobing0311-web/uasalbert24/blob/main/app/Http/Requests/StoreReservasiRequest.php): form requests · Validates field, reservation, and proof-upload mutations. · `app/Http/Requests/StoreReservasiRequest.php`
- [Blade UI](https://github.com/alberttobing0311-web/uasalbert24/blob/main/resources/views/layouts/app.blade.php): server-rendered views · Shared layout and field/reservation screens. · `resources/views/layouts/app.blade.php`
- [PDF report template](https://github.com/alberttobing0311-web/uasalbert24/blob/main/resources/views/laporan/reservasi-pdf.blade.php): Blade report view · `resources/views/laporan/reservasi-pdf.blade.php`
- [Client assets](https://github.com/alberttobing0311-web/uasalbert24/blob/main/resources/js/app.js): Vite entry · Enhances the Blade-first interface. · `resources/js/app.js`

### Token API

- [API routes](https://github.com/alberttobing0311-web/uasalbert24/blob/main/routes/api.php): token routing · `routes/api.php`
- [API controllers](https://github.com/alberttobing0311-web/uasalbert24/blob/main/app/Http/Controllers/Api/LapanganController.php): API controllers · Separate authentication and field API surface. · `app/Http/Controllers/Api/LapanganController.php`
- [Sanctum tokens](https://github.com/alberttobing0311-web/uasalbert24/blob/main/config/sanctum.php): API authentication · `config/sanctum.php`
- [Field representation](https://github.com/alberttobing0311-web/uasalbert24/blob/main/app/Http/Resources/LapanganResource.php): API resource · Explicit response boundary for field records. · `app/Http/Resources/LapanganResource.php`

### Domain & Persistence

- [Core models](https://github.com/alberttobing0311-web/uasalbert24/blob/main/app/Models/Reservasi.php): Eloquent models · Users, fields, and reservations. · `app/Models/Reservasi.php`
- [Application database](https://github.com/alberttobing0311-web/uasalbert24/blob/main/database/migrations/2026_07_16_074117_create_reservasis_table.php): persistent data · Stores users, fields, reservations, and access tokens. · `database/migrations/2026_07_16_074117_create_reservasis_table.php`
- [Payment-proof storage](https://github.com/alberttobing0311-web/uasalbert24/tree/main/storage/app/private): filesystem storage · Private and public storage roots hold uploaded evidence. · `storage/app/private`
- [Filesystem config](https://github.com/alberttobing0311-web/uasalbert24/blob/main/config/filesystems.php): storage configuration · `config/filesystems.php`

## Connections

- HTTP entry → Application bootstrap: boots
- Application bootstrap → Web routes: loads
- Application bootstrap → API routes: loads
- Web routes → Role enforcement: applies
- Role enforcement → Reservation controllers: authorizes
- Web routes → Reservation controllers: dispatches
- Reservation controllers → Validated requests: uses
- Reservation controllers → Core models: reads and writes
- Reservation controllers → Blade UI: renders
- Reservation controllers → PDF report template: renders report
- Reservation controllers → Payment-proof storage: uploads proof
- Client assets → Blade UI: supports
- API routes → Sanctum tokens: authenticates with
- API routes → API controllers: dispatches
- Sanctum tokens → Application database: stores tokens
- API controllers → Core models: queries
- API controllers → Field representation: serializes
- Core models → Application database: persists
- Filesystem config → Payment-proof storage: configures
