# gregoryusambarita-creator/uasgre0067 architecture

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

## Overview

#### Purpose and entry points
This is a Laravel application for managing sports-field (“lapangan”) inventory and reservations (“reservasi”), including payment-proof upload and reservation reporting. HTTP enters through `public/index.php`, is bootstrapped by `bootstrap/app.php`, and is dispatched through `routes/web.php` for Blade pages or `routes/api.php` for programmatic clients.

#### Routing and delivery surfaces
The application exposes two delivery surfaces:
- Server-rendered browser workflows backed by `app/Http/Controllers/LapanganController.php`, `app/Http/Controllers/ReservasiController.php`, and `app/Http/Controllers/LaporanController.php`.
- API workflows backed by `app/Http/Controllers/Api/AuthController.php` and `app/Http/Controllers/Api/LapanganController.php`.

Web controllers render views under `resources/views/lapangans`, `resources/views/reservasis`, and `resources/views/laporan`; API responses are likely shaped through `app/Http/Resources/LapanganResource.php`.

#### Identity, authorization, and API access
Users are represented by `app/Models/User.php`. Browser authentication is handled by `app/Http/Controllers/AuthController.php`; API authentication has a separate controller at `app/Http/Controllers/Api/AuthController.php`. Role-based access is a distinct boundary enforced by `app/Http/Middleware/CheckRole.php`. Sanctum configuration and the personal-access-token migration indicate token-based API authentication: `config/sanctum.php` and `database/migrations/2026_07_16_074008_create_personal_access_tokens_table.php`.

#### Core domain and persistence
The principal domain records are fields and reservations, modeled in `app/Models/Lapangan.php` and `app/Models/Reservasi.php`. Their schema is owned by `database/migrations/2026_07_16_074117_create_lapangans_table.php` and `database/migrations/2026_07_16_074117_create_reservasis_table.php`. Controllers should be treated as the orchestration layer between authenticated requests, these Eloquent models, and rendered/API output.

#### Reservation workflow and evidence handling
Reservation creation and validation are separated from controller logic via `app/Http/Requests/StoreReservasiRequest.php`. Payment or reservation evidence is handled through the dedicated `app/Http/Requests/UploadBuktiRequest.php` and the reservation controller, with persistent file storage available under `storage/app/public`. The user-facing stages are represented by `resources/views/reservasis/create.blade.php`, `resources/views/reservasis/upload-bukti.blade.php`, and `resources/views/reservasis/index.blade.php`.

#### Field administration and reporting
Field CRUD is concentrated in `app/Http/Controllers/LapanganController.php`, with explicit create/update request contracts in `app/Http/Requests/StoreLapanganRequest.php` and `app/Http/Requests/UpdateLapanganRequest.php`. Reservation reporting is isolated in `app/Http/Controllers/LaporanController.php`, with a PDF-oriented report template at `resources/views/laporan/reservasi-pdf.blade.php`. This separates operational booking screens from export/report generation.

#### Runtime and infrastructure boundaries
The runtime is PHP/Laravel, managed through `composer.json` and the `artisan` CLI. Database, filesystem, session, cache, mail, logging, and queue adapters are environment-configurable through `config/database.php`, `config/filesystems.php`, `config/queue.php`, and related Laravel configuration. Front-end assets use Vite via `vite.config.js`, `resources/js/app.js`, and `resources/css/app.css`. No concrete external provider is identifiable from the supplied README; `.env.example` is the deployment-time boundary for service credentials and adapter selection.

Main entry points: [`app/Http/Controllers/ReservasiController.php`](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Controllers/ReservasiController.php) (Booking and admin controllers), [`routes/web.php`](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/routes/web.php) (Web routes), [`bootstrap/app.php`](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/bootstrap/app.php) (Application bootstrap), [`routes/api.php`](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/routes/api.php) (API routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

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

subgraph group_web["Browser Surface"]
  node_web_routes["Web routes<br/>route definitions<br/>[web.php]"]
  node_browser_auth["Browser auth<br/>controller<br/>[AuthController.php]"]
  node_web_controllers["Booking and admin controllers<br/>controller layer"]
  node_blade_views["Blade workflows<br/>server-rendered views<br/>[index.blade.php]"]
  node_report_template["Reservation PDF template<br/>report view"]
  node_frontend["Vite assets<br/>frontend bundle<br/>[app.js]"]
end

subgraph group_api["API Surface"]
  node_api_routes["API routes<br/>route definitions<br/>[api.php]"]
  node_api_auth["API auth<br/>controller<br/>[AuthController.php]"]
  node_api_fields["Field API<br/>controller"]
  node_field_resource["Field API resource<br/>response transformer"]
  node_sanctum{{"Sanctum tokens<br/>API authentication<br/>[sanctum.php]"}}
end

subgraph group_domain["Reservation Domain"]
  node_role_guard{{"Role guard<br/>middleware<br/>[CheckRole.php]"}}
  node_reservation_requests["Reservation contracts<br/>form requests"]
  node_field_requests["Field CRUD contracts<br/>form requests"]
  node_user["User<br/>Eloquent model<br/>[User.php]"]
  node_lapangan["Sports field<br/>Eloquent model<br/>[Lapangan.php]"]
  node_reservasi["Reservation<br/>Eloquent model<br/>[Reservasi.php]"]
  node_database[("Application database<br/>configured persistence<br/>[database.php]")]
  node_file_storage[("Public file storage<br/>filesystem storage")]
end

node_http -->|"boots"| node_bootstrap
node_bootstrap -->|"loads"| node_web_routes
node_bootstrap -->|"loads"| node_api_routes
node_web_routes -->|"auth endpoints"| node_browser_auth
node_web_routes -->|"protected routes"| node_role_guard
node_web_routes -->|"dispatches"| node_web_controllers
node_web_controllers -->|"validates reservations"| node_reservation_requests
node_web_controllers -->|"validates field CRUD"| node_field_requests
node_web_controllers -->|"manages"| node_lapangan
node_web_controllers -->|"manages"| node_reservasi
node_web_controllers -->|"renders"| node_blade_views
node_web_controllers -->|"renders export"| node_report_template
node_web_controllers -->|"stores evidence"| node_file_storage
node_api_routes -->|"auth endpoints"| node_api_auth
node_api_routes -->|"dispatches"| node_api_fields
node_api_auth -->|"issues tokens"| node_sanctum
node_sanctum -->|"authenticates"| node_user
node_api_fields -->|"queries fields"| node_lapangan
node_api_fields -->|"formats responses"| node_field_resource
node_user -->|"persists"| node_database
node_lapangan -->|"persists"| node_database
node_reservasi -->|"persists"| node_database
node_blade_views -.->|"uses assets"| node_frontend

click node_http "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/public/index.php"
click node_bootstrap "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/bootstrap/app.php"
click node_web_routes "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/routes/web.php"
click node_api_routes "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/routes/api.php"
click node_browser_auth "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Controllers/AuthController.php"
click node_web_controllers "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Controllers/ReservasiController.php"
click node_blade_views "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/resources/views/reservasis/index.blade.php"
click node_report_template "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/resources/views/laporan/reservasi-pdf.blade.php"
click node_api_auth "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Controllers/Api/AuthController.php"
click node_api_fields "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Controllers/Api/LapanganController.php"
click node_field_resource "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Resources/LapanganResource.php"
click node_role_guard "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Middleware/CheckRole.php"
click node_reservation_requests "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Requests/StoreReservasiRequest.php"
click node_field_requests "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Requests/StoreLapanganRequest.php"
click node_user "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Models/User.php"
click node_lapangan "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Models/Lapangan.php"
click node_reservasi "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Models/Reservasi.php"
click node_database "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/config/database.php"
click node_file_storage "https://github.com/gregoryusambarita-creator/uasgre0067/tree/master/storage/app/public"
click node_sanctum "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/config/sanctum.php"
click node_frontend "https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/resources/js/app.js"

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_http,node_bootstrap toneBlue
class node_web_routes,node_browser_auth,node_web_controllers,node_blade_views,node_report_template,node_frontend toneAmber
class node_api_routes,node_api_auth,node_api_fields,node_field_resource,node_sanctum toneMint
class node_role_guard,node_reservation_requests,node_field_requests,node_user,node_lapangan,node_reservasi,node_database,node_file_storage toneRose
```

## Components

### Laravel Runtime

- [HTTP entry](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/public/index.php): PHP entry point · `public/index.php`
- [Application bootstrap](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/bootstrap/app.php): Laravel bootstrap · `bootstrap/app.php`

### Browser Surface

- [Web routes](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/routes/web.php): route definitions · `routes/web.php`
- [Browser auth](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Controllers/AuthController.php): controller · `app/Http/Controllers/AuthController.php`
- [Booking and admin controllers](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Controllers/ReservasiController.php): controller layer · Handles fields, reservations, and reports. · `app/Http/Controllers/ReservasiController.php`
- [Blade workflows](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/resources/views/reservasis/index.blade.php): server-rendered views · Field, reservation, and report screens. · `resources/views/reservasis/index.blade.php`
- [Reservation PDF template](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/resources/views/laporan/reservasi-pdf.blade.php): report view · `resources/views/laporan/reservasi-pdf.blade.php`
- [Vite assets](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/resources/js/app.js): frontend bundle · `resources/js/app.js`

### API Surface

- [API routes](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/routes/api.php): route definitions · `routes/api.php`
- [API auth](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Controllers/Api/AuthController.php): controller · `app/Http/Controllers/Api/AuthController.php`
- [Field API](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Controllers/Api/LapanganController.php): controller · `app/Http/Controllers/Api/LapanganController.php`
- [Field API resource](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Resources/LapanganResource.php): response transformer · `app/Http/Resources/LapanganResource.php`
- [Sanctum tokens](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/config/sanctum.php): API authentication · `config/sanctum.php`

### Reservation Domain

- [Role guard](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Middleware/CheckRole.php): middleware · Enforces role-based access. · `app/Http/Middleware/CheckRole.php`
- [Reservation contracts](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Requests/StoreReservasiRequest.php): form requests · Validates booking creation and evidence upload. · `app/Http/Requests/StoreReservasiRequest.php`
- [Field CRUD contracts](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Http/Requests/StoreLapanganRequest.php): form requests · Validates field create and update operations. · `app/Http/Requests/StoreLapanganRequest.php`
- [User](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Models/User.php): Eloquent model · `app/Models/User.php`
- [Sports field](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Models/Lapangan.php): Eloquent model · `app/Models/Lapangan.php`
- [Reservation](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/app/Models/Reservasi.php): Eloquent model · Stores bookings and payment evidence references. · `app/Models/Reservasi.php`
- [Application database](https://github.com/gregoryusambarita-creator/uasgre0067/blob/master/config/database.php): configured persistence · Schema includes users, fields, reservations, and API tokens. · `config/database.php`
- [Public file storage](https://github.com/gregoryusambarita-creator/uasgre0067/tree/master/storage/app/public): filesystem storage · Stores uploaded payment or reservation evidence. · `storage/app/public`

## Connections

- HTTP entry → Application bootstrap: boots
- Application bootstrap → Web routes: loads
- Application bootstrap → API routes: loads
- Web routes → Browser auth: auth endpoints
- Web routes → Role guard: protected routes
- Web routes → Booking and admin controllers: dispatches
- Booking and admin controllers → Reservation contracts: validates reservations
- Booking and admin controllers → Field CRUD contracts: validates field CRUD
- Booking and admin controllers → Sports field: manages
- Booking and admin controllers → Reservation: manages
- Booking and admin controllers → Blade workflows: renders
- Booking and admin controllers → Reservation PDF template: renders export
- Booking and admin controllers → Public file storage: stores evidence
- API routes → API auth: auth endpoints
- API routes → Field API: dispatches
- API auth → Sanctum tokens: issues tokens
- Sanctum tokens → User: authenticates
- Field API → Sports field: queries fields
- Field API → Field API resource: formats responses
- User → Application database: persists
- Sports field → Application database: persists
- Reservation → Application database: persists
- Blade workflows → Vite assets: uses assets
