# sitohangagnesia086-svg/uas_224520002 architecture

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

## Overview

#### Purpose and Entry Points
This is a Laravel/PHP application for managing sports fields (“lapangan”) and reservations (“reservasi”), with separate administrator/member dashboards, browser pages, 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 Layer
Server-rendered browser workflows are organized around controllers and Blade templates:
- Authentication: `app/Http/Controllers/AuthController.php`, `resources/views/auth/login.blade.php`, `resources/views/auth/register.blade.php`
- Dashboards: `app/Http/Controllers/DashboardController.php`, `resources/views/dashboard/admin.blade.php`, `resources/views/dashboard/member.blade.php`
- Field and reservation pages: `app/Http/Controllers/LapanganController.php`, `app/Http/Controllers/ReservasiController.php`, `resources/views/reservasi/index.blade.php`

The shared layout boundary is `resources/views/layouts/app.blade.php`.

#### API Boundary
A separate API route surface is defined in `routes/api.php`, with dedicated API controllers:
- `app/Http/Controllers/Api/AuthController.php`
- `app/Http/Controllers/Api/LapanganController.php`

Sanctum configuration at `config/sanctum.php` and the personal-access-token migration at `database/migrations/2026_07_16_072718_create_personal_access_tokens_table.php` indicate token-based API authentication capability, distinct from browser session flows.

#### Identity, Authorization, and Roles
Users are represented by `app/Models/User.php` and persisted through `database/migrations/0001_01_01_000000_create_users_table.php`. A role extension is introduced in `database/migrations/2026_07_16_070214_add_role_to_users_table.php`; role enforcement is centralized in `app/Http/Middleware/RoleMiddleware.php`. This is the principal authorization boundary separating administrative field-management/dashboard capabilities from member reservation use.

#### Core Domain and Persistence
The main relational domain is:
- Fields: `app/Models/Lapangan.php`, `database/migrations/2026_07_16_070213_create_lapangans_table.php`
- Reservations: `app/Models/Reservasi.php`, `database/migrations/2026_07_16_070214_create_reservasis_table.php`
- Transfer-proof support: `database/migrations/2026_07_16_075626_add_bukti_transfer_to_reservasis_table.php`

Controllers coordinate request-to-model operations; migrations define the durable schema boundary. Development/bootstrap data is supplied by `database/seeders/DatabaseSeeder.php` and `database/seeders/UserSeeder.php`.

#### Reservation and Payment-Document Flow
Reservation creation and listing are handled by `app/Http/Controllers/ReservasiController.php` and rendered through `resources/views/reservasi/create.blade.php` and `resources/views/reservasi/index.blade.php`. The `bukti_transfer` schema addition suggests reservation records can carry transfer-proof evidence. The dedicated `resources/views/reservasi/pdf.blade.php` is a document-rendering boundary for reservation output, likely intended for PDF generation.

#### Validation, Storage, and Runtime Infrastructure
Field write operations use dedicated validation requests: `app/Http/Requests/StoreLapanganRequest.php` and `app/Http/Requests/UpdateLapanganRequest.php`. Laravel filesystem configuration lives in `config/filesystems.php`; managed storage roots include `storage/app/private` and `storage/app/public`, relevant for uploaded transfer proofs or generated documents.

The runtime is Laravel with Composer-managed PHP dependencies (`composer.json`) and Vite-managed frontend assets (`package.json`, `vite.config.js`). Database, sessions, cache, queues, mail, logging, and authentication are environment-configurable through `config/database.php`, `config/session.php`, `config/queue.php`, `config/mail.php`, and `config/auth.php`; no concrete external provider is identified in the supplied repository metadata.

Main entry points: [`routes/web.php`](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/routes/web.php) (Web routes), [`app/Models/Reservasi.php`](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Models/Reservasi.php) (Reservations), [`app/Models/User.php`](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Models/User.php) (Users and roles), [`app/Models/Lapangan.php`](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Models/Lapangan.php) (Sports fields)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP entry and surfaces"]
  node_entry{{"Laravel entrypoint<br/>PHP entrypoint<br/>[index.php]"}}
  node_bootstrap["Application bootstrap<br/>Laravel bootstrap<br/>[app.php]"]
  node_web_routes["Web routes<br/>route surface<br/>[web.php]"]
  node_api_routes["API routes<br/>route surface<br/>[api.php]"]
end

subgraph group_web["Browser application"]
  node_auth_controller["Browser auth<br/>web controller<br/>[AuthController.php]"]
  node_dashboard_controller["Role dashboards<br/>web controller"]
  node_lapangan_controller["Field management<br/>web controller"]
  node_reservasi_controller["Reservations<br/>web controller"]
  node_blade_layout["Shared Blade layout<br/>view layout<br/>[app.blade.php]"]
  node_reservation_views["Reservation pages<br/>Blade views<br/>[create.blade.php]"]
  node_role_middleware["Role enforcement<br/>HTTP middleware<br/>[RoleMiddleware.php]"]
  node_field_requests["Field validation<br/>form requests"]
end

subgraph group_api["Token API"]
  node_api_auth["API authentication<br/>API controller<br/>[AuthController.php]"]
  node_api_lapangan["Field API<br/>API controller"]
  node_sanctum["Sanctum tokens<br/>token auth config<br/>[sanctum.php]"]
end

subgraph group_domain["Domain and persistence"]
  node_user["Users and roles<br/>Eloquent model<br/>[User.php]"]
  node_lapangan["Sports fields<br/>Eloquent model<br/>[Lapangan.php]"]
  node_reservasi["Reservations<br/>Eloquent model<br/>[Reservasi.php]"]
  node_schema[("Relational schema<br/>migrations")]
  node_storage["Managed file storage<br/>Laravel filesystem<br/>[filesystems.php]"]
  node_seeders["Bootstrap data<br/>database seeders<br/>[DatabaseSeeder.php]"]
end

node_entry -->|"boots"| node_bootstrap
node_bootstrap -->|"loads"| node_web_routes
node_bootstrap -->|"loads"| node_api_routes
node_web_routes -->|"dispatches"| node_auth_controller
node_web_routes -->|"dispatches"| node_dashboard_controller
node_web_routes -->|"dispatches"| node_lapangan_controller
node_web_routes -->|"dispatches"| node_reservasi_controller
node_web_routes -->|"protects routes with"| node_role_middleware
node_role_middleware -->|"checks role on"| node_user
node_auth_controller -->|"authenticates"| node_user
node_dashboard_controller -->|"renders within"| node_blade_layout
node_lapangan_controller -->|"validates through"| node_field_requests
node_field_requests -->|"guards writes to"| node_lapangan
node_lapangan_controller -->|"manages"| node_lapangan
node_reservasi_controller -->|"creates and lists"| node_reservasi
node_reservasi_controller -->|"renders"| node_reservation_views
node_reservation_views -->|"uses"| node_blade_layout
node_reservasi -->|"books"| node_lapangan
node_reservasi -->|"belongs to"| node_user
node_reservasi -.->|"stores transfer proof in"| node_storage
node_api_routes -->|"dispatches"| node_api_auth
node_api_routes -->|"dispatches"| node_api_lapangan
node_api_auth -->|"issues tokens via"| node_sanctum
node_api_lapangan -->|"serves"| node_lapangan
node_user -->|"persists in"| node_schema
node_lapangan -->|"persists in"| node_schema
node_reservasi -->|"persists in"| node_schema
node_sanctum -->|"uses token table"| node_schema
node_seeders -->|"seeds"| node_user

click node_entry "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/public/index.php"
click node_bootstrap "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/bootstrap/app.php"
click node_web_routes "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/routes/web.php"
click node_api_routes "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/routes/api.php"
click node_auth_controller "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Controllers/AuthController.php"
click node_dashboard_controller "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Controllers/DashboardController.php"
click node_lapangan_controller "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Controllers/LapanganController.php"
click node_reservasi_controller "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Controllers/ReservasiController.php"
click node_blade_layout "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/resources/views/layouts/app.blade.php"
click node_reservation_views "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/resources/views/reservasi/create.blade.php"
click node_role_middleware "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Middleware/RoleMiddleware.php"
click node_field_requests "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Requests/StoreLapanganRequest.php"
click node_api_auth "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Controllers/Api/AuthController.php"
click node_api_lapangan "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Controllers/Api/LapanganController.php"
click node_sanctum "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/config/sanctum.php"
click node_user "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Models/User.php"
click node_lapangan "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Models/Lapangan.php"
click node_reservasi "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Models/Reservasi.php"
click node_schema "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/database/migrations/2026_07_16_070213_create_lapangans_table.php"
click node_storage "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/config/filesystems.php"
click node_seeders "https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/database/seeders/DatabaseSeeder.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_entry,node_bootstrap,node_web_routes,node_api_routes toneBlue
class node_auth_controller,node_dashboard_controller,node_lapangan_controller,node_reservasi_controller,node_blade_layout,node_reservation_views,node_role_middleware,node_field_requests toneAmber
class node_api_auth,node_api_lapangan,node_sanctum toneMint
class node_user,node_lapangan,node_reservasi,node_schema,node_storage,node_seeders toneRose
```

## Components

### HTTP entry and surfaces

- [Laravel entrypoint](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/public/index.php): PHP entrypoint · `public/index.php`
- [Application bootstrap](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/bootstrap/app.php): Laravel bootstrap · `bootstrap/app.php`
- [Web routes](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/routes/web.php): route surface · `routes/web.php`
- [API routes](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/routes/api.php): route surface · `routes/api.php`

### Browser application

- [Browser auth](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Controllers/AuthController.php): web controller · `app/Http/Controllers/AuthController.php`
- [Role dashboards](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Controllers/DashboardController.php): web controller · `app/Http/Controllers/DashboardController.php`
- [Field management](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Controllers/LapanganController.php): web controller · `app/Http/Controllers/LapanganController.php`
- [Reservations](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Controllers/ReservasiController.php): web controller · Creates and lists reservations. · `app/Http/Controllers/ReservasiController.php`
- [Shared Blade layout](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/resources/views/layouts/app.blade.php): view layout · `resources/views/layouts/app.blade.php`
- [Reservation pages](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/resources/views/reservasi/create.blade.php): Blade views · Creation, listing, and PDF document rendering. · `resources/views/reservasi/create.blade.php`
- [Role enforcement](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Middleware/RoleMiddleware.php): HTTP middleware · Separates administrator and member capabilities. · `app/Http/Middleware/RoleMiddleware.php`
- [Field validation](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Requests/StoreLapanganRequest.php): form requests · Validates field create and update writes. · `app/Http/Requests/StoreLapanganRequest.php`

### Token API

- [API authentication](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Controllers/Api/AuthController.php): API controller · `app/Http/Controllers/Api/AuthController.php`
- [Field API](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Http/Controllers/Api/LapanganController.php): API controller · `app/Http/Controllers/Api/LapanganController.php`
- [Sanctum tokens](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/config/sanctum.php): token auth config · Supports personal-access-token API authentication. · `config/sanctum.php`

### Domain and persistence

- [Users and roles](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Models/User.php): Eloquent model · `app/Models/User.php`
- [Sports fields](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Models/Lapangan.php): Eloquent model · `app/Models/Lapangan.php`
- [Reservations](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/app/Models/Reservasi.php): Eloquent model · Can carry transfer-proof evidence. · `app/Models/Reservasi.php`
- [Relational schema](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/database/migrations/2026_07_16_070213_create_lapangans_table.php): migrations · Users, roles, fields, reservations, transfer proofs, and API tokens. · `database/migrations/2026_07_16_070213_create_lapangans_table.php`
- [Managed file storage](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/config/filesystems.php): Laravel filesystem · Stores uploaded proofs or generated documents. · `config/filesystems.php`
- [Bootstrap data](https://github.com/sitohangagnesia086-svg/uas_224520002/blob/main/database/seeders/DatabaseSeeder.php): database seeders · `database/seeders/DatabaseSeeder.php`

## Connections

- Laravel entrypoint → Application bootstrap: boots
- Application bootstrap → Web routes: loads
- Application bootstrap → API routes: loads
- Web routes → Browser auth: dispatches
- Web routes → Role dashboards: dispatches
- Web routes → Field management: dispatches
- Web routes → Reservations: dispatches
- Web routes → Role enforcement: protects routes with
- Role enforcement → Users and roles: checks role on
- Browser auth → Users and roles: authenticates
- Role dashboards → Shared Blade layout: renders within
- Field management → Field validation: validates through
- Field validation → Sports fields: guards writes to
- Field management → Sports fields: manages
- Reservations → Reservations: creates and lists
- Reservations → Reservation pages: renders
- Reservation pages → Shared Blade layout: uses
- Reservations → Sports fields: books
- Reservations → Users and roles: belongs to
- Reservations → Managed file storage: stores transfer proof in
- API routes → API authentication: dispatches
- API routes → Field API: dispatches
- API authentication → Sanctum tokens: issues tokens via
- Field API → Sports fields: serves
- Users and roles → Relational schema: persists in
- Sports fields → Relational schema: persists in
- Reservations → Relational schema: persists in
- Sanctum tokens → Relational schema: uses token table
- Bootstrap data → Users and roles: seeds
