# seprycode17/uas4sia architecture

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

## Overview

#### Purpose and Entry Points
This is a Laravel/PHP application for managing sports fields (“lapangan”) and their reservations, including transfer-proof handling. The project README is Laravel boilerplate; the domain is inferred from application code structure. HTTP enters through `public/index.php`, bootstraps in `bootstrap/app.php`, and is dispatched by `routes/web.php` or `routes/api.php`. CLI maintenance and migrations enter through `artisan`.

#### Web Authentication and Authorization
Browser authentication is handled by `app/Http/Controllers/AuthController.php`. Role-based access control is a dedicated HTTP boundary in `app/Http/Middleware/RoleMiddleware.php`, likely separating administrative field management from regular reservation actions. Laravel auth/session behavior is configured in `config/auth.php` and `config/session.php`.

#### Field Management Domain
`Lapangan` is the inventory/resource aggregate represented by `app/Models/Lapangan.php`. Server-rendered CRUD flows are implemented in `app/Http/Controllers/LapanganController.php`, with input validation isolated in `app/Http/Requests/LapanganRequest.php`. Admin-facing UI is Blade-based under `resources/views/lapangan/index.blade.php`, `resources/views/lapangan/create.blade.php`, and `resources/views/lapangan/edit.blade.php`.

#### Reservation Workflow
Reservations are represented by `app/Models/Reservasi.php` and handled by `app/Http/Controllers/ReservasiController.php`. The reservation creation UI is `resources/views/reservasi/create.blade.php`. The schema explicitly includes reservation records and later adds payment-transfer evidence, establishing a flow from selecting a field through reservation submission and proof upload/storage: `database/migrations/2026_07_16_065958_create_reservasis_table.php` and `database/migrations/2026_07_16_073352_add_bukti_transfer_to_reservasis_table.php`.

#### API Boundary
A separate API surface exposes field data via `routes/api.php` and `app/Http/Controllers/Api/LapanganApiController.php`. `app/Http/Resources/LapanganResource.php` is the response-shaping boundary, keeping API serialization independent of the Eloquent model and web views.

#### Persistence and File Storage
Laravel Eloquent models persist users, fields, and reservations through migrations in `database/migrations/0001_01_01_000000_create_users_table.php`, `database/migrations/2026_07_16_065958_create_lapangans_table.php`, and `database/migrations/2026_07_16_065958_create_reservasis_table.php`. Database connectivity is environment-configured in `config/database.php`. Transfer-proof files are expected to use Laravel filesystem storage, configured by `config/filesystems.php`, with local public/private roots under `storage/app/public` and `storage/app/private`.

#### Runtime and Delivery Boundaries
The primary runtime is Laravel on PHP with Composer dependencies (`composer.json`), backed by a configurable relational database, cache, sessions, mail, and queue infrastructure (`config/cache.php`, `config/queue.php`, `config/mail.php`). The browser layer uses Blade templates plus Vite-built CSS/JavaScript from `resources/css/app.css` and `resources/js/app.js`; Vite configuration is `vite.config.js`. No concrete external SaaS integration is evidenced in the tree beyond Laravel’s configurable service hooks in `config/services.php`.

Main entry points: [`routes/web.php`](https://github.com/seprycode17/uas4sia/blob/main/routes/web.php) (Web routes), [`app/Http/Controllers/ReservasiController.php`](https://github.com/seprycode17/uas4sia/blob/main/app/Http/Controllers/ReservasiController.php) (Reservation workflow), [`app/Http/Controllers/LapanganController.php`](https://github.com/seprycode17/uas4sia/blob/main/app/Http/Controllers/LapanganController.php) (Field management), [`app/Models/Lapangan.php`](https://github.com/seprycode17/uas4sia/blob/main/app/Models/Lapangan.php) (Field inventory)

## Diagram (Mermaid)

```mermaid
flowchart TD

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

subgraph group_web["Web Application"]
  node_web_routes["Web routes<br/>route definitions<br/>[web.php]"]
  node_auth["Authentication<br/>web controller<br/>[AuthController.php]"]
  node_role_middleware{{"Role authorization<br/>HTTP middleware<br/>[RoleMiddleware.php]"}}
  node_lapangan_controller["Field management<br/>web controller"]
  node_lapangan_request["Field validation<br/>form request"]
  node_lapangan_views["Field admin views<br/>Blade views<br/>[index.blade.php]"]
  node_reservasi_controller["Reservation workflow<br/>web controller"]
  node_reservasi_view["Reservation form<br/>Blade view<br/>[create.blade.php]"]
  node_frontend_assets["Browser assets<br/>Vite bundle<br/>[vite.config.js]"]
end

subgraph group_api["API Surface"]
  node_api_routes["API routes<br/>route definitions<br/>[api.php]"]
  node_lapangan_api["Field API<br/>API controller"]
  node_lapangan_resource["Field response mapping<br/>API resource"]
end

subgraph group_domain["Domain &amp; Persistence"]
  node_lapangan["Field inventory<br/>Eloquent model<br/>[Lapangan.php]"]
  node_reservasi["Reservations<br/>Eloquent model<br/>[Reservasi.php]"]
  node_database[("Relational database<br/>persistence<br/>[database.php]")]
  node_migrations["Database schema<br/>migrations"]
  node_proof_storage[("Transfer-proof storage<br/>Laravel filesystem<br/>[filesystems.php]")]
end

node_http_entry -->|"boots"| node_bootstrap
node_bootstrap -->|"loads"| node_web_routes
node_bootstrap -->|"loads"| node_api_routes
node_artisan -->|"runs"| node_migrations
node_web_routes -->|"dispatches"| node_auth
node_web_routes -->|"guards with"| node_role_middleware
node_role_middleware -->|"authorizes"| node_lapangan_controller
node_web_routes -->|"dispatches"| node_lapangan_controller
node_lapangan_controller -->|"validates via"| node_lapangan_request
node_lapangan_controller -->|"manages"| node_lapangan
node_lapangan_controller -->|"renders"| node_lapangan_views
node_web_routes -->|"dispatches"| node_reservasi_controller
node_reservasi_controller -->|"renders"| node_reservasi_view
node_reservasi_controller -->|"selects"| node_lapangan
node_reservasi_controller -->|"creates"| node_reservasi
node_reservasi_controller -->|"stores proof"| node_proof_storage
node_api_routes -->|"dispatches"| node_lapangan_api
node_lapangan_api -->|"reads"| node_lapangan
node_lapangan_api -->|"serializes with"| node_lapangan_resource
node_lapangan -->|"persists to"| node_database
node_reservasi -->|"persists to"| node_database
node_migrations -->|"provisions"| node_database
node_frontend_assets -.->|"supports"| node_lapangan_views
node_frontend_assets -.->|"supports"| node_reservasi_view

click node_http_entry "https://github.com/seprycode17/uas4sia/blob/main/public/index.php"
click node_bootstrap "https://github.com/seprycode17/uas4sia/blob/main/bootstrap/app.php"
click node_artisan "https://github.com/seprycode17/uas4sia/blob/main/artisan"
click node_web_routes "https://github.com/seprycode17/uas4sia/blob/main/routes/web.php"
click node_auth "https://github.com/seprycode17/uas4sia/blob/main/app/Http/Controllers/AuthController.php"
click node_role_middleware "https://github.com/seprycode17/uas4sia/blob/main/app/Http/Middleware/RoleMiddleware.php"
click node_lapangan_controller "https://github.com/seprycode17/uas4sia/blob/main/app/Http/Controllers/LapanganController.php"
click node_lapangan_request "https://github.com/seprycode17/uas4sia/blob/main/app/Http/Requests/LapanganRequest.php"
click node_lapangan_views "https://github.com/seprycode17/uas4sia/blob/main/resources/views/lapangan/index.blade.php"
click node_reservasi_controller "https://github.com/seprycode17/uas4sia/blob/main/app/Http/Controllers/ReservasiController.php"
click node_reservasi_view "https://github.com/seprycode17/uas4sia/blob/main/resources/views/reservasi/create.blade.php"
click node_api_routes "https://github.com/seprycode17/uas4sia/blob/main/routes/api.php"
click node_lapangan_api "https://github.com/seprycode17/uas4sia/blob/main/app/Http/Controllers/Api/LapanganApiController.php"
click node_lapangan_resource "https://github.com/seprycode17/uas4sia/blob/main/app/Http/Resources/LapanganResource.php"
click node_lapangan "https://github.com/seprycode17/uas4sia/blob/main/app/Models/Lapangan.php"
click node_reservasi "https://github.com/seprycode17/uas4sia/blob/main/app/Models/Reservasi.php"
click node_database "https://github.com/seprycode17/uas4sia/blob/main/config/database.php"
click node_migrations "https://github.com/seprycode17/uas4sia/blob/main/database/migrations/2026_07_16_065958_create_reservasis_table.php"
click node_proof_storage "https://github.com/seprycode17/uas4sia/blob/main/config/filesystems.php"
click node_frontend_assets "https://github.com/seprycode17/uas4sia/blob/main/vite.config.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_entry,node_bootstrap,node_artisan toneBlue
class node_web_routes,node_auth,node_role_middleware,node_lapangan_controller,node_lapangan_request,node_lapangan_views,node_reservasi_controller,node_reservasi_view,node_frontend_assets toneAmber
class node_api_routes,node_lapangan_api,node_lapangan_resource toneMint
class node_lapangan,node_reservasi,node_database,node_migrations,node_proof_storage toneRose
```

## Components

### Laravel Runtime

- [HTTP entry](https://github.com/seprycode17/uas4sia/blob/main/public/index.php): PHP entry point · `public/index.php`
- [Application bootstrap](https://github.com/seprycode17/uas4sia/blob/main/bootstrap/app.php): Laravel bootstrap · `bootstrap/app.php`
- [Artisan CLI](https://github.com/seprycode17/uas4sia/blob/main/artisan): CLI entry point · Runs maintenance commands and migrations. · `artisan`

### Web Application

- [Web routes](https://github.com/seprycode17/uas4sia/blob/main/routes/web.php): route definitions · `routes/web.php`
- [Authentication](https://github.com/seprycode17/uas4sia/blob/main/app/Http/Controllers/AuthController.php): web controller · `app/Http/Controllers/AuthController.php`
- [Role authorization](https://github.com/seprycode17/uas4sia/blob/main/app/Http/Middleware/RoleMiddleware.php): HTTP middleware · Separates administrative and regular actions. · `app/Http/Middleware/RoleMiddleware.php`
- [Field management](https://github.com/seprycode17/uas4sia/blob/main/app/Http/Controllers/LapanganController.php): web controller · `app/Http/Controllers/LapanganController.php`
- [Field validation](https://github.com/seprycode17/uas4sia/blob/main/app/Http/Requests/LapanganRequest.php): form request · `app/Http/Requests/LapanganRequest.php`
- [Field admin views](https://github.com/seprycode17/uas4sia/blob/main/resources/views/lapangan/index.blade.php): Blade views · `resources/views/lapangan/index.blade.php`
- [Reservation workflow](https://github.com/seprycode17/uas4sia/blob/main/app/Http/Controllers/ReservasiController.php): web controller · Creates reservations and accepts transfer proof. · `app/Http/Controllers/ReservasiController.php`
- [Reservation form](https://github.com/seprycode17/uas4sia/blob/main/resources/views/reservasi/create.blade.php): Blade view · `resources/views/reservasi/create.blade.php`
- [Browser assets](https://github.com/seprycode17/uas4sia/blob/main/vite.config.js): Vite bundle · Builds shared CSS and JavaScript for Blade pages. · `vite.config.js`

### API Surface

- [API routes](https://github.com/seprycode17/uas4sia/blob/main/routes/api.php): route definitions · `routes/api.php`
- [Field API](https://github.com/seprycode17/uas4sia/blob/main/app/Http/Controllers/Api/LapanganApiController.php): API controller · `app/Http/Controllers/Api/LapanganApiController.php`
- [Field response mapping](https://github.com/seprycode17/uas4sia/blob/main/app/Http/Resources/LapanganResource.php): API resource · Decouples API serialization from the model. · `app/Http/Resources/LapanganResource.php`

### Domain & Persistence

- [Field inventory](https://github.com/seprycode17/uas4sia/blob/main/app/Models/Lapangan.php): Eloquent model · `app/Models/Lapangan.php`
- [Reservations](https://github.com/seprycode17/uas4sia/blob/main/app/Models/Reservasi.php): Eloquent model · Includes transfer-proof evidence. · `app/Models/Reservasi.php`
- [Relational database](https://github.com/seprycode17/uas4sia/blob/main/config/database.php): persistence · Connection is environment-configured. · `config/database.php`
- [Database schema](https://github.com/seprycode17/uas4sia/blob/main/database/migrations/2026_07_16_065958_create_reservasis_table.php): migrations · Defines users, fields, reservations, and transfer-proof column. · `database/migrations/2026_07_16_065958_create_reservasis_table.php`
- [Transfer-proof storage](https://github.com/seprycode17/uas4sia/blob/main/config/filesystems.php): Laravel filesystem · Stores uploaded proof in public or private roots. · `config/filesystems.php`

## Connections

- HTTP entry → Application bootstrap: boots
- Application bootstrap → Web routes: loads
- Application bootstrap → API routes: loads
- Artisan CLI → Database schema: runs
- Web routes → Authentication: dispatches
- Web routes → Role authorization: guards with
- Role authorization → Field management: authorizes
- Web routes → Field management: dispatches
- Field management → Field validation: validates via
- Field management → Field inventory: manages
- Field management → Field admin views: renders
- Web routes → Reservation workflow: dispatches
- Reservation workflow → Reservation form: renders
- Reservation workflow → Field inventory: selects
- Reservation workflow → Reservations: creates
- Reservation workflow → Transfer-proof storage: stores proof
- API routes → Field API: dispatches
- Field API → Field inventory: reads
- Field API → Field response mapping: serializes with
- Field inventory → Relational database: persists to
- Reservations → Relational database: persists to
- Database schema → Relational database: provisions
- Browser assets → Field admin views: supports
- Browser assets → Reservation form: supports
