# robbytarigan327/uas224520003 architecture

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

## Overview

#### Purpose and Entry Points
This is a Laravel application for managing **lapangan** (venues/courts) and their reservations, with both server-rendered web workflows and an API surface. HTTP requests enter through `public/index.php`, bootstrap via `bootstrap/app.php`, and are dispatched by `routes/web.php` or `routes/api.php`.

#### Web Application Flow
Browser-facing controllers implement authentication, venue management, reservation creation/listing, payment-proof upload, and reservation reporting:
- `app/Http/Controllers/AuthController.php`
- `app/Http/Controllers/LapanganController.php`
- `app/Http/Controllers/ReservasiController.php`
- `app/Http/Controllers/LaporanController.php`

These controllers render Blade pages under `resources/views/`, including venue and reservation CRUD screens plus a PDF-oriented reservation report at `resources/views/laporan/reservasi-pdf.blade.php`.

#### API Boundary
A parallel API controller layer exposes authentication and venue operations independently of the Blade UI:
- `routes/api.php`
- `app/Http/Controllers/Api/AuthController.php`
- `app/Http/Controllers/Api/LapanganController.php`

`app/Http/Resources/LapanganResource.php` is the response-shaping boundary for venue API payloads. Sanctum is materially present for token authentication through `config/sanctum.php` and `database/migrations/2026_07_16_074008_create_personal_access_tokens_table.php`.

#### Domain and Persistence
The core relational domain is users, venues, and reservations:
- `app/Models/User.php`
- `app/Models/Lapangan.php`
- `app/Models/Reservasi.php`

Schema ownership is captured in `database/migrations/0001_01_01_000000_create_users_table.php`, `database/migrations/2026_07_16_074117_create_lapangans_table.php`, and `database/migrations/2026_07_16_074117_create_reservasis_table.php`. Eloquent models form the application/data-store boundary; the database backend is environment-configured in `config/database.php`.

#### Authorization and Request Validation
Role-based access is enforced by custom middleware:
- `app/Http/Middleware/CheckRole.php`
- `routes/web.php`
- `routes/api.php`

Mutation inputs are separated into Form Requests, establishing validation boundaries before controller/domain handling:
- `app/Http/Requests/StoreLapanganRequest.php`
- `app/Http/Requests/StoreReservasiRequest.php`
- `app/Http/Requests/UploadBuktiRequest.php`

The upload request indicates reservations can carry uploaded proof (`bukti`), with filesystem behavior controlled by `config/filesystems.php` and storage rooted at `storage/app/`.

#### Reporting and Output
Reservation reporting is a distinct output path rather than ordinary CRUD, coordinated by `app/Http/Controllers/LaporanController.php` and the report template `resources/views/laporan/reservasi-pdf.blade.php`. This is the likely boundary for generating a printable/PDF reservation report; the concrete PDF library is not identifiable from the provided tree.

#### Runtime and Infrastructure
The runtime is PHP/Laravel, managed through `artisan` and Composer (`composer.json`). Laravel’s configured infrastructure includes database, cache, sessions, mail, logging, queueing, and filesystems under `config/`. Database migrations also provision cache and jobs tables, making database-backed cache/queue operation available:
- `database/migrations/0001_01_01_000001_create_cache_table.php`
- `database/migrations/0001_01_01_000002_create_jobs_table.php`

Frontend assets are built with Vite from `resources/js/` and `resources/css/`, configured by `vite.config.js`.

Main entry points: [`app/Http/Controllers/ReservasiController.php`](https://github.com/robbytarigan327/uas224520003/blob/main/app/Http/Controllers/ReservasiController.php) (Web Controllers), [`routes/api.php`](https://github.com/robbytarigan327/uas224520003/blob/main/routes/api.php) (API Routes), [`bootstrap/app.php`](https://github.com/robbytarigan327/uas224520003/blob/main/bootstrap/app.php) (Laravel Bootstrap), [`app/Http/Controllers/Api/LapanganController.php`](https://github.com/robbytarigan327/uas224520003/blob/main/app/Http/Controllers/Api/LapanganController.php) (API Controllers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Laravel Runtime"]
  node_public_index{{"HTTP Entry<br/>PHP entrypoint<br/>[index.php]"}}
  node_bootstrap["Laravel Bootstrap<br/>application bootstrap<br/>[app.php]"]
  node_vite_assets["Frontend Assets<br/>Vite build input<br/>[app.js]"]
end

subgraph group_web["Web Workflow"]
  node_browser(("Browser<br/>client"))
  node_web_routes["Web Routes<br/>route definitions<br/>[web.php]"]
  node_web_controllers["Web Controllers<br/>MVC controllers"]
  node_form_requests["Mutation Validation<br/>form requests"]
  node_role_middleware["Role Authorization<br/>middleware<br/>[CheckRole.php]"]
  node_blade_views["Blade UI<br/>server-rendered views<br/>[index.blade.php]"]
  node_report_template["Reservation Report<br/>PDF-oriented Blade template"]
end

subgraph group_api["API Surface"]
  node_api_routes["API Routes<br/>route definitions<br/>[api.php]"]
  node_api_controllers["API Controllers"]
  node_sanctum["Sanctum Tokens<br/>token authentication<br/>[sanctum.php]"]
  node_lapangan_resource["Venue API Resource<br/>response transformer"]
end

subgraph group_domain["Domain &amp; Storage"]
  node_eloquent_models["Eloquent Domain<br/>models<br/>[Reservasi.php]"]
  node_database[("Relational Database<br/>environment-configured datastore<br/>[database.php]")]
  node_migrations["Schema Migrations<br/>database schema"]
  node_proof_storage[("Proof Storage<br/>filesystem storage")]
end

node_browser -->|"HTTP requests"| node_public_index
node_public_index -->|"bootstraps"| node_bootstrap
node_bootstrap -->|"dispatches web"| node_web_routes
node_bootstrap -->|"dispatches API"| node_api_routes
node_web_routes -->|"enforces roles"| node_role_middleware
node_role_middleware -->|"authorizes"| node_web_controllers
node_web_controllers -->|"validates mutations"| node_form_requests
node_web_controllers -->|"manages domain"| node_eloquent_models
node_web_controllers -->|"renders"| node_blade_views
node_web_controllers -->|"generates report"| node_report_template
node_form_requests -->|"accepts bukti upload"| node_proof_storage
node_api_routes -->|"enforces roles"| node_role_middleware
node_api_routes -->|"authenticates tokens"| node_sanctum
node_api_routes -->|"dispatches"| node_api_controllers
node_api_controllers -->|"manages domain"| node_eloquent_models
node_api_controllers -->|"shapes responses"| node_lapangan_resource
node_sanctum -->|"stores tokens"| node_database
node_eloquent_models -->|"persists"| node_database
node_migrations -->|"defines schema"| node_database
node_vite_assets -.->|"built for UI"| node_blade_views

click node_public_index "https://github.com/robbytarigan327/uas224520003/blob/main/public/index.php"
click node_bootstrap "https://github.com/robbytarigan327/uas224520003/blob/main/bootstrap/app.php"
click node_web_routes "https://github.com/robbytarigan327/uas224520003/blob/main/routes/web.php"
click node_web_controllers "https://github.com/robbytarigan327/uas224520003/blob/main/app/Http/Controllers/ReservasiController.php"
click node_form_requests "https://github.com/robbytarigan327/uas224520003/blob/main/app/Http/Requests/StoreReservasiRequest.php"
click node_role_middleware "https://github.com/robbytarigan327/uas224520003/blob/main/app/Http/Middleware/CheckRole.php"
click node_blade_views "https://github.com/robbytarigan327/uas224520003/blob/main/resources/views/reservasis/index.blade.php"
click node_report_template "https://github.com/robbytarigan327/uas224520003/blob/main/resources/views/laporan/reservasi-pdf.blade.php"
click node_api_routes "https://github.com/robbytarigan327/uas224520003/blob/main/routes/api.php"
click node_api_controllers "https://github.com/robbytarigan327/uas224520003/blob/main/app/Http/Controllers/Api/LapanganController.php"
click node_sanctum "https://github.com/robbytarigan327/uas224520003/blob/main/config/sanctum.php"
click node_lapangan_resource "https://github.com/robbytarigan327/uas224520003/blob/main/app/Http/Resources/LapanganResource.php"
click node_eloquent_models "https://github.com/robbytarigan327/uas224520003/blob/main/app/Models/Reservasi.php"
click node_database "https://github.com/robbytarigan327/uas224520003/blob/main/config/database.php"
click node_migrations "https://github.com/robbytarigan327/uas224520003/blob/main/database/migrations/2026_07_16_074117_create_reservasis_table.php"
click node_proof_storage "https://github.com/robbytarigan327/uas224520003/tree/main/storage/app/public"
click node_vite_assets "https://github.com/robbytarigan327/uas224520003/blob/main/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_public_index,node_bootstrap,node_vite_assets toneBlue
class node_browser,node_web_routes,node_web_controllers,node_form_requests,node_role_middleware,node_blade_views,node_report_template toneAmber
class node_api_routes,node_api_controllers,node_sanctum,node_lapangan_resource toneMint
class node_eloquent_models,node_database,node_migrations,node_proof_storage toneRose
```

## Components

### Laravel Runtime

- [HTTP Entry](https://github.com/robbytarigan327/uas224520003/blob/main/public/index.php): PHP entrypoint · `public/index.php`
- [Laravel Bootstrap](https://github.com/robbytarigan327/uas224520003/blob/main/bootstrap/app.php): application bootstrap · `bootstrap/app.php`
- [Frontend Assets](https://github.com/robbytarigan327/uas224520003/blob/main/resources/js/app.js): Vite build input · `resources/js/app.js`

### Web Workflow

- **Browser**: client
- [Web Routes](https://github.com/robbytarigan327/uas224520003/blob/main/routes/web.php): route definitions · `routes/web.php`
- [Web Controllers](https://github.com/robbytarigan327/uas224520003/blob/main/app/Http/Controllers/ReservasiController.php): MVC controllers · Auth, venue, reservation, and reporting workflows. · `app/Http/Controllers/ReservasiController.php`
- [Mutation Validation](https://github.com/robbytarigan327/uas224520003/blob/main/app/Http/Requests/StoreReservasiRequest.php): form requests · Validates venue, reservation, and proof-upload inputs. · `app/Http/Requests/StoreReservasiRequest.php`
- [Role Authorization](https://github.com/robbytarigan327/uas224520003/blob/main/app/Http/Middleware/CheckRole.php): middleware · `app/Http/Middleware/CheckRole.php`
- [Blade UI](https://github.com/robbytarigan327/uas224520003/blob/main/resources/views/reservasis/index.blade.php): server-rendered views · Venue and reservation CRUD pages. · `resources/views/reservasis/index.blade.php`
- [Reservation Report](https://github.com/robbytarigan327/uas224520003/blob/main/resources/views/laporan/reservasi-pdf.blade.php): PDF-oriented Blade template · `resources/views/laporan/reservasi-pdf.blade.php`

### API Surface

- [API Routes](https://github.com/robbytarigan327/uas224520003/blob/main/routes/api.php): route definitions · `routes/api.php`
- [API Controllers](https://github.com/robbytarigan327/uas224520003/blob/main/app/Http/Controllers/Api/LapanganController.php): API controllers · Authentication and venue operations. · `app/Http/Controllers/Api/LapanganController.php`
- [Sanctum Tokens](https://github.com/robbytarigan327/uas224520003/blob/main/config/sanctum.php): token authentication · `config/sanctum.php`
- [Venue API Resource](https://github.com/robbytarigan327/uas224520003/blob/main/app/Http/Resources/LapanganResource.php): response transformer · `app/Http/Resources/LapanganResource.php`

### Domain & Storage

- [Eloquent Domain](https://github.com/robbytarigan327/uas224520003/blob/main/app/Models/Reservasi.php): models · Users, venues, and reservations. · `app/Models/Reservasi.php`
- [Relational Database](https://github.com/robbytarigan327/uas224520003/blob/main/config/database.php): environment-configured datastore · `config/database.php`
- [Schema Migrations](https://github.com/robbytarigan327/uas224520003/blob/main/database/migrations/2026_07_16_074117_create_reservasis_table.php): database schema · Provisions users, venues, reservations, cache, jobs, and token tables. · `database/migrations/2026_07_16_074117_create_reservasis_table.php`
- [Proof Storage](https://github.com/robbytarigan327/uas224520003/tree/main/storage/app/public): filesystem storage · Stores uploaded reservation proof files. · `storage/app/public`

## Connections

- Browser → HTTP Entry: HTTP requests
- HTTP Entry → Laravel Bootstrap: bootstraps
- Laravel Bootstrap → Web Routes: dispatches web
- Laravel Bootstrap → API Routes: dispatches API
- Web Routes → Role Authorization: enforces roles
- Role Authorization → Web Controllers: authorizes
- Web Controllers → Mutation Validation: validates mutations
- Web Controllers → Eloquent Domain: manages domain
- Web Controllers → Blade UI: renders
- Web Controllers → Reservation Report: generates report
- Mutation Validation → Proof Storage: accepts bukti upload
- API Routes → Role Authorization: enforces roles
- API Routes → Sanctum Tokens: authenticates tokens
- API Routes → API Controllers: dispatches
- API Controllers → Eloquent Domain: manages domain
- API Controllers → Venue API Resource: shapes responses
- Sanctum Tokens → Relational Database: stores tokens
- Eloquent Domain → Relational Database: persists
- Schema Migrations → Relational Database: defines schema
- Frontend Assets → Blade UI: built for UI
