# lshrsmatmpbln/uasprakpweblashi architecture

> Architecture diagram of the GitHub repository lshrsmatmpbln/uasprakpweblashi, 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/lshrsmatmpbln/uasprakpweblashi
- Repository: https://github.com/lshrsmatmpbln/uasprakpweblashi

## Overview

#### Purpose and Runtime
This is a Laravel/PHP application for managing sports-field (`Lapangan`) reservations (`Reservasi`). It serves server-rendered admin and member workflows, authentication/profile management, API endpoints, and PDF-oriented reservation reporting/receipts. The README is Laravel boilerplate; the domain is inferred from application structure.

HTTP enters through `public/index.php`, Laravel boots via `bootstrap/app.php`, and route definitions are split between `routes/web.php` and `routes/api.php`.

#### Routing, Access, and Session Identity
Web routes dispatch to MVC controllers, with Laravel’s auth stack handling registration, login, password reset, email verification, and password confirmation. Role-based authorization is a distinct boundary, likely separating admin management functions from member booking functions.

Key paths:
- `routes/web.php`
- `app/Http/Controllers/AuthController.php`
- `app/Http/Middleware/RoleMiddleware.php`

#### Reservation Domain Core
The central persisted entities are users, fields, and reservations. Eloquent models represent their relationships and controllers coordinate CRUD, booking/history, and administrative verification. Request objects isolate input validation before domain writes.

Key paths:
- `app/Models/Lapangan.php`
- `app/Models/Reservasi.php`
- `app/Http/Controllers/ReservasiController.php`

Schema ownership is in `database/migrations/2026_07_16_070628_create_lapangans_table.php` and `database/migrations/2026_07_16_070634_create_reservasis_table.php`; database configuration is selected through `config/database.php`.

#### Admin Operations
Administrators have dedicated dashboard, field-management, reservation-listing, and reservation-verification surfaces. `LapanganController` is the administrative inventory/catalog boundary; `ReservasiController` supports operational handling of bookings. Admin Blade templates render the resulting server-side state.

Key paths:
- `app/Http/Controllers/LapanganController.php`
- `resources/views/admin/lapangan/index.blade.php`
- `resources/views/admin/reservasi/verifikasi.blade.php`

#### Member Booking Flow
Authenticated members access a dedicated dashboard, create reservations against available fields, and review reservation history. The expected control flow is: web request → auth/role middleware → validated `ReservasiRequest` → reservation persistence → redirect/rendered member view.

Key paths:
- `app/Http/Requests/ReservasiRequest.php`
- `resources/views/member/reservasi/create.blade.php`
- `resources/views/member/reservasi/history.blade.php`

#### APIs and Representation Boundary
The application also exposes an API route surface. `ApiController` provides API orchestration, while `LapanganResource` defines a deliberate serialized representation for field data, keeping API payload formatting separate from the Eloquent model and Blade views.

Key paths:
- `routes/api.php`
- `app/Http/Controllers/ApiController.php`
- `app/Http/Resources/LapanganResource.php`

#### Reporting and Presentation
`PdfController` is the reporting/export boundary for reservation receipts (`kwitansi`) and reports (`laporan`). Standard web presentation uses Blade layouts/components and Vite-built CSS/JS, rather than a standalone frontend runtime.

Key paths:
- `app/Http/Controllers/PdfController.php`
- `resources/views/admin/pdf/kwitansi.blade.php`
- `resources/views/layouts/app.blade.php`

#### Infrastructure and External Boundaries
Laravel configuration supports database, session, cache, mail, filesystem storage, logging, and queues; concrete drivers and service credentials come from environment configuration. Database-backed cache and job migrations are present, so these facilities are provisionable even if domain code shown does not establish active usage. Local/public/private storage roots are under `storage/app`; frontend assets are built through Vite.

Key paths:
- `config/database.php`
- `config/queue.php`
- `config/filesystems.php`

Main entry points: [`app/Http/Controllers/ReservasiController.php`](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Controllers/ReservasiController.php) (Reservation operations), [`app/Models/Lapangan.php`](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Models/Lapangan.php) (Field model), [`app/Models/Reservasi.php`](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Models/Reservasi.php) (Reservation model), [`config/database.php`](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/config/database.php) (Application database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP &amp; Access"]
  node_client(("Admin &amp; member users<br/>actors"))
  node_entry{{"Laravel entry point<br/>PHP runtime<br/>[index.php]"}}
  node_web_routes["Web routes<br/>route definitions<br/>[web.php]"]
  node_auth_role["Auth &amp; role access<br/>middleware<br/>[RoleMiddleware.php]"]
  node_lapangan_controller["Field administration<br/>MVC controller"]
  node_api_routes["API routes<br/>route definitions<br/>[api.php]"]
  node_api_controller["Field API<br/>API controller<br/>[ApiController.php]"]
  node_lapangan_resource["Field API representation<br/>JSON resource"]
end

subgraph group_domain["Reservation Domain"]
  node_reservasi_controller["Reservation operations<br/>MVC controller"]
  node_reservation_request["Reservation validation<br/>form request"]
  node_lapangan_model["Field model<br/>Eloquent model<br/>[Lapangan.php]"]
  node_reservasi_model["Reservation model<br/>Eloquent model<br/>[Reservasi.php]"]
end

subgraph group_presentation["Presentation &amp; Exports"]
  node_admin_views["Admin field &amp; verification views<br/>Blade views<br/>[index.blade.php]"]
  node_member_booking["Member booking view<br/>Blade view<br/>[create.blade.php]"]
  node_member_history["Member reservation history<br/>Blade view<br/>[history.blade.php]"]
  node_pdf_controller["Reservation PDFs<br/>report controller<br/>[PdfController.php]"]
  node_receipt_view["Receipt template<br/>Blade PDF view<br/>[kwitansi.blade.php]"]
end

subgraph group_data["Persistence"]
  node_database[("Application database<br/>[database.php]")]
  node_field_schema["Field schema<br/>migration"]
  node_reservation_schema["Reservation schema<br/>migration"]
end

node_client -->|"HTTP requests"| node_entry
node_entry -->|"boots and dispatches"| node_web_routes
node_web_routes -->|"protected routes"| node_auth_role
node_auth_role -->|"admin actions"| node_lapangan_controller
node_auth_role -->|"member and admin actions"| node_reservasi_controller
node_lapangan_controller -->|"field CRUD"| node_lapangan_model
node_lapangan_controller -->|"renders"| node_admin_views
node_reservasi_controller -->|"validates booking input"| node_reservation_request
node_reservation_request -->|"permits persistence"| node_reservasi_model
node_reservasi_controller -->|"checks available fields"| node_lapangan_model
node_reservasi_controller -->|"creates and manages"| node_reservasi_model
node_reservasi_controller -->|"renders booking"| node_member_booking
node_reservasi_controller -->|"renders history"| node_member_history
node_entry -->|"API dispatch"| node_api_routes
node_api_routes -->|"routes requests"| node_api_controller
node_api_controller -->|"queries fields"| node_lapangan_model
node_api_controller -->|"serializes"| node_lapangan_resource
node_web_routes -->|"report routes"| node_pdf_controller
node_pdf_controller -->|"loads reservations"| node_reservasi_model
node_pdf_controller -->|"renders receipt"| node_receipt_view
node_lapangan_model -->|"persists fields"| node_database
node_reservasi_model -->|"persists reservations"| node_database
node_field_schema -->|"creates field table"| node_database
node_reservation_schema -->|"creates reservation table"| node_database

click node_entry "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/public/index.php"
click node_web_routes "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/routes/web.php"
click node_auth_role "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Middleware/RoleMiddleware.php"
click node_lapangan_controller "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Controllers/LapanganController.php"
click node_reservasi_controller "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Controllers/ReservasiController.php"
click node_reservation_request "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Requests/ReservasiRequest.php"
click node_lapangan_model "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Models/Lapangan.php"
click node_reservasi_model "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Models/Reservasi.php"
click node_admin_views "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/resources/views/admin/lapangan/index.blade.php"
click node_member_booking "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/resources/views/member/reservasi/create.blade.php"
click node_member_history "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/resources/views/member/reservasi/history.blade.php"
click node_api_routes "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/routes/api.php"
click node_api_controller "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Controllers/ApiController.php"
click node_lapangan_resource "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Resources/LapanganResource.php"
click node_pdf_controller "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Controllers/PdfController.php"
click node_receipt_view "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/resources/views/admin/pdf/kwitansi.blade.php"
click node_database "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/config/database.php"
click node_field_schema "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/database/migrations/2026_07_16_070628_create_lapangans_table.php"
click node_reservation_schema "https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/database/migrations/2026_07_16_070634_create_reservasis_table.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_client,node_entry,node_web_routes,node_auth_role,node_lapangan_controller,node_api_routes,node_api_controller,node_lapangan_resource toneBlue
class node_reservasi_controller,node_reservation_request,node_lapangan_model,node_reservasi_model toneAmber
class node_admin_views,node_member_booking,node_member_history,node_pdf_controller,node_receipt_view toneMint
class node_database,node_field_schema,node_reservation_schema toneRose
```

## Components

### HTTP & Access

- **Admin & member users**: actors
- [Laravel entry point](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/public/index.php): PHP runtime · `public/index.php`
- [Web routes](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/routes/web.php): route definitions · `routes/web.php`
- [Auth & role access](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Middleware/RoleMiddleware.php): middleware · Authentication flows and role-based authorization gate web actions. · `app/Http/Middleware/RoleMiddleware.php`
- [Field administration](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Controllers/LapanganController.php): MVC controller · `app/Http/Controllers/LapanganController.php`
- [API routes](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/routes/api.php): route definitions · `routes/api.php`
- [Field API](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Controllers/ApiController.php): API controller · `app/Http/Controllers/ApiController.php`
- [Field API representation](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Resources/LapanganResource.php): JSON resource · Separates API payload formatting from Eloquent and Blade rendering. · `app/Http/Resources/LapanganResource.php`

### Reservation Domain

- [Reservation operations](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Controllers/ReservasiController.php): MVC controller · Handles booking, history, administration, and verification. · `app/Http/Controllers/ReservasiController.php`
- [Reservation validation](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Requests/ReservasiRequest.php): form request · `app/Http/Requests/ReservasiRequest.php`
- [Field model](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Models/Lapangan.php): Eloquent model · `app/Models/Lapangan.php`
- [Reservation model](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Models/Reservasi.php): Eloquent model · `app/Models/Reservasi.php`

### Presentation & Exports

- [Admin field & verification views](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/resources/views/admin/lapangan/index.blade.php): Blade views · `resources/views/admin/lapangan/index.blade.php`
- [Member booking view](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/resources/views/member/reservasi/create.blade.php): Blade view · `resources/views/member/reservasi/create.blade.php`
- [Member reservation history](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/resources/views/member/reservasi/history.blade.php): Blade view · `resources/views/member/reservasi/history.blade.php`
- [Reservation PDFs](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/app/Http/Controllers/PdfController.php): report controller · Generates receipts and reservation reports. · `app/Http/Controllers/PdfController.php`
- [Receipt template](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/resources/views/admin/pdf/kwitansi.blade.php): Blade PDF view · `resources/views/admin/pdf/kwitansi.blade.php`

### Persistence

- [Application database](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/config/database.php): database · Stores users, fields, and reservations through configured Laravel connections. · `config/database.php`
- [Field schema](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/database/migrations/2026_07_16_070628_create_lapangans_table.php): migration · `database/migrations/2026_07_16_070628_create_lapangans_table.php`
- [Reservation schema](https://github.com/lshrsmatmpbln/uasprakpweblashi/blob/master/database/migrations/2026_07_16_070634_create_reservasis_table.php): migration · `database/migrations/2026_07_16_070634_create_reservasis_table.php`

## Connections

- Admin & member users → Laravel entry point: HTTP requests
- Laravel entry point → Web routes: boots and dispatches
- Web routes → Auth & role access: protected routes
- Auth & role access → Field administration: admin actions
- Auth & role access → Reservation operations: member and admin actions
- Field administration → Field model: field CRUD
- Field administration → Admin field & verification views: renders
- Reservation operations → Reservation validation: validates booking input
- Reservation validation → Reservation model: permits persistence
- Reservation operations → Field model: checks available fields
- Reservation operations → Reservation model: creates and manages
- Reservation operations → Member booking view: renders booking
- Reservation operations → Member reservation history: renders history
- Laravel entry point → API routes: API dispatch
- API routes → Field API: routes requests
- Field API → Field model: queries fields
- Field API → Field API representation: serializes
- Web routes → Reservation PDFs: report routes
- Reservation PDFs → Reservation model: loads reservations
- Reservation PDFs → Receipt template: renders receipt
- Field model → Application database: persists fields
- Reservation model → Application database: persists reservations
- Field schema → Application database: creates field table
- Reservation schema → Application database: creates reservation table
