# bestaria/uas_224520011 architecture

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

## Overview

#### Purpose and Runtime
This is a Laravel/PHP server-rendered application for managing sports fields (“lapangan”) and reservations (“reservasi”), with login and role-based access control. The README is the stock Laravel README; application intent is inferred from controllers and Blade views.

HTTP requests enter through `public/index.php`, bootstrap Laravel via `bootstrap/app.php`, and are dispatched from `routes/web.php`. The CLI entry point is `artisan`.

#### Route and Request Layer
Web routes likely map authentication, field-management, and reservation workflows to three controllers:
- `app/Http/Controllers/LoginController.php`
- `app/Http/Controllers/LapanganController.php`
- `app/Http/Controllers/ReservasiController.php`

`routes/api.php` exists but no API-specific controllers are present in the tree, so the primary interface is browser-oriented rather than an external API.

#### Authentication and Authorization Boundary
Authentication is handled by the login controller and Laravel’s auth configuration:
- `app/Http/Controllers/LoginController.php`
- `app/Http/Middleware/LoginMiddleware.php`
- `config/auth.php`

`LoginMiddleware` protects authenticated flows, while `app/Http/Middleware/RoleMiddleware.php` separates permissions by role. These middleware form the critical boundary before administrative field operations or reservation actions execute.

#### Field Management Domain
`LapanganController` is the field catalog/administration boundary, supporting list, detail, create, edit, and PDF-oriented views:
- `app/Http/Controllers/LapanganController.php`
- `resources/views/lapangan/index.blade.php`
- `resources/views/lapangan/pdf.blade.php`

Field images or other public media are expected under `public/gambar`. The absence of a visible Lapangan model or corresponding migration suggests this domain may use direct database access, an omitted schema, or incomplete repository content.

#### Reservation Workflow
Reservations are controlled through:
- `app/Http/Controllers/ReservasiController.php`
- `resources/views/reservasi/create.blade.php`
- `resources/views/reservasi/pesanan.blade.php`

The likely flow is: authenticated user selects a field, submits reservation data, then views reservation/order status. `resources/views/reservasi/index.blade.php` provides a listing surface. Reservation persistence schema/model is not present in the supplied tree, which is a material implementation gap to verify before extending the feature.

#### Persistence, Sessions, and Background Infrastructure
Laravel database configuration is centralized in `config/database.php`; credentials are expected through `.env` based on `.env.example`. User identity is the only explicit application model and migration:
- `app/Models/User.php`
- `database/migrations/0001_01_01_000000_create_users_table.php`
- `database/seeders/DatabaseSeeder.php`

Framework migrations provision cache and queued-job tables, enabling database-backed cache/queue if configured:
- `database/migrations/0001_01_01_000001_create_cache_table.php`
- `database/migrations/0001_01_01_000002_create_jobs_table.php`
- `config/queue.php`

Session, cache, filesystem, mail, logging, and third-party service adapters remain Laravel-configurable boundaries in `config/`.

#### Presentation and Assets
Controllers render Blade templates from `resources/views`, including the dashboard and login pages:
- `resources/views/dashboard.blade.php`
- `resources/views/auth/login.blade.php`
- `resources/views/welcome.blade.php`

Frontend assets are built with Vite from `resources/css/app.css` and `resources/js/app.js`, configured by `vite.config.js`. Generated/publicly served assets and uploads are exposed from `public/`; private filesystem content remains under `storage/app/private`.

Main entry points: [`routes/web.php`](https://github.com/bestaria/uas_224520011/blob/main/routes/web.php) (Web routes), [`app/Http/Middleware/LoginMiddleware.php`](https://github.com/bestaria/uas_224520011/blob/main/app/Http/Middleware/LoginMiddleware.php) (Auth & role boundary), [`app/Http/Controllers/LoginController.php`](https://github.com/bestaria/uas_224520011/blob/main/app/Http/Controllers/LoginController.php) (Login controller), [`app/Http/Controllers/LapanganController.php`](https://github.com/bestaria/uas_224520011/blob/main/app/Http/Controllers/LapanganController.php) (Field management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Laravel Runtime"]
  node_public_index["HTTP entry point<br/>PHP entry<br/>[index.php]"]
  node_laravel_bootstrap["Laravel bootstrap<br/>framework bootstrap<br/>[app.php]"]
  node_web_routes["Web routes<br/>route definitions<br/>[web.php]"]
end

subgraph group_access["Access Control"]
  node_auth_boundary{{"Auth &amp; role boundary<br/>middleware"}}
  node_role_middleware{{"Role middleware<br/>authorization middleware<br/>[RoleMiddleware.php]"}}
  node_login_controller["Login controller"]
  node_auth_config["Auth configuration<br/>Laravel config<br/>[auth.php]"]
end

subgraph group_domains["Application Domains"]
  node_lapangan_controller["Field management<br/>controller"]
  node_reservasi_controller["Reservation workflow<br/>controller"]
end

subgraph group_data["Persistence &amp; Infrastructure"]
  node_user_model["User identity<br/>Eloquent model<br/>[User.php]"]
  node_database_config[("Database connection<br/>Laravel config<br/>[database.php]")]
  node_users_migration["Users schema<br/>migration"]
  node_queue_infrastructure["Cache &amp; job tables<br/>framework migrations"]
end

subgraph group_presentation["Presentation"]
  node_field_views["Field Blade views<br/>Blade templates<br/>[index.blade.php]"]
  node_reservation_views["Reservation Blade views<br/>Blade templates<br/>[create.blade.php]"]
  node_shared_views["Dashboard &amp; login views<br/>Blade templates"]
  node_public_media["Public field media<br/>uploads"]
  node_vite_assets["Vite frontend assets<br/>asset pipeline<br/>[app.js]"]
end

node_browser(("Browser<br/>client"))

node_browser -->|"HTTP request"| node_public_index
node_public_index -->|"bootstraps"| node_laravel_bootstrap
node_laravel_bootstrap -->|"dispatches"| node_web_routes
node_web_routes -->|"protected routes"| node_auth_boundary
node_auth_boundary -->|"applies roles"| node_role_middleware
node_web_routes -->|"login routes"| node_login_controller
node_web_routes -->|"field routes"| node_lapangan_controller
node_web_routes -->|"reservation routes"| node_reservasi_controller
node_auth_boundary -->|"uses"| node_auth_config
node_login_controller -->|"authenticates"| node_user_model
node_lapangan_controller -->|"renders"| node_field_views
node_lapangan_controller -->|"serves field media"| node_public_media
node_reservasi_controller -->|"renders"| node_reservation_views
node_login_controller -->|"renders login"| node_shared_views
node_web_routes -->|"dashboard route"| node_shared_views
node_user_model -->|"persists through"| node_database_config
node_users_migration -->|"provisions"| node_database_config
node_queue_infrastructure -.->|"provisions tables in"| node_database_config
node_vite_assets -.->|"built assets served from public"| node_public_media

click node_public_index "https://github.com/bestaria/uas_224520011/blob/main/public/index.php"
click node_laravel_bootstrap "https://github.com/bestaria/uas_224520011/blob/main/bootstrap/app.php"
click node_web_routes "https://github.com/bestaria/uas_224520011/blob/main/routes/web.php"
click node_auth_boundary "https://github.com/bestaria/uas_224520011/blob/main/app/Http/Middleware/LoginMiddleware.php"
click node_role_middleware "https://github.com/bestaria/uas_224520011/blob/main/app/Http/Middleware/RoleMiddleware.php"
click node_login_controller "https://github.com/bestaria/uas_224520011/blob/main/app/Http/Controllers/LoginController.php"
click node_auth_config "https://github.com/bestaria/uas_224520011/blob/main/config/auth.php"
click node_lapangan_controller "https://github.com/bestaria/uas_224520011/blob/main/app/Http/Controllers/LapanganController.php"
click node_reservasi_controller "https://github.com/bestaria/uas_224520011/blob/main/app/Http/Controllers/ReservasiController.php"
click node_field_views "https://github.com/bestaria/uas_224520011/blob/main/resources/views/lapangan/index.blade.php"
click node_reservation_views "https://github.com/bestaria/uas_224520011/blob/main/resources/views/reservasi/create.blade.php"
click node_shared_views "https://github.com/bestaria/uas_224520011/blob/main/resources/views/dashboard.blade.php"
click node_public_media "https://github.com/bestaria/uas_224520011/tree/main/public/gambar"
click node_vite_assets "https://github.com/bestaria/uas_224520011/blob/main/resources/js/app.js"
click node_user_model "https://github.com/bestaria/uas_224520011/blob/main/app/Models/User.php"
click node_database_config "https://github.com/bestaria/uas_224520011/blob/main/config/database.php"
click node_users_migration "https://github.com/bestaria/uas_224520011/blob/main/database/migrations/0001_01_01_000000_create_users_table.php"
click node_queue_infrastructure "https://github.com/bestaria/uas_224520011/blob/main/database/migrations/0001_01_01_000002_create_jobs_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_public_index,node_laravel_bootstrap,node_web_routes toneBlue
class node_auth_boundary,node_role_middleware,node_login_controller,node_auth_config toneAmber
class node_lapangan_controller,node_reservasi_controller toneMint
class node_user_model,node_database_config,node_users_migration,node_queue_infrastructure toneRose
class node_field_views,node_reservation_views,node_shared_views,node_public_media,node_vite_assets toneIndigo
class node_browser toneNeutral
```

## Components

### Laravel Runtime

- [HTTP entry point](https://github.com/bestaria/uas_224520011/blob/main/public/index.php): PHP entry · `public/index.php`
- [Laravel bootstrap](https://github.com/bestaria/uas_224520011/blob/main/bootstrap/app.php): framework bootstrap · `bootstrap/app.php`
- [Web routes](https://github.com/bestaria/uas_224520011/blob/main/routes/web.php): route definitions · Primary browser interface and workflow dispatch. · `routes/web.php`

### Access Control

- [Auth & role boundary](https://github.com/bestaria/uas_224520011/blob/main/app/Http/Middleware/LoginMiddleware.php): middleware · Guards authenticated flows and role-specific actions. · `app/Http/Middleware/LoginMiddleware.php`
- [Role middleware](https://github.com/bestaria/uas_224520011/blob/main/app/Http/Middleware/RoleMiddleware.php): authorization middleware · `app/Http/Middleware/RoleMiddleware.php`
- [Login controller](https://github.com/bestaria/uas_224520011/blob/main/app/Http/Controllers/LoginController.php): controller · `app/Http/Controllers/LoginController.php`
- [Auth configuration](https://github.com/bestaria/uas_224520011/blob/main/config/auth.php): Laravel config · `config/auth.php`

### Application Domains

- [Field management](https://github.com/bestaria/uas_224520011/blob/main/app/Http/Controllers/LapanganController.php): controller · Lists, edits, details, and PDF-oriented field views. · `app/Http/Controllers/LapanganController.php`
- [Reservation workflow](https://github.com/bestaria/uas_224520011/blob/main/app/Http/Controllers/ReservasiController.php): controller · Creates reservations and exposes order/listing views. · `app/Http/Controllers/ReservasiController.php`

### Persistence & Infrastructure

- [User identity](https://github.com/bestaria/uas_224520011/blob/main/app/Models/User.php): Eloquent model · Only explicit application model in the repository. · `app/Models/User.php`
- [Database connection](https://github.com/bestaria/uas_224520011/blob/main/config/database.php): Laravel config · Credentials are supplied through environment configuration. · `config/database.php`
- [Users schema](https://github.com/bestaria/uas_224520011/blob/main/database/migrations/0001_01_01_000000_create_users_table.php): migration · `database/migrations/0001_01_01_000000_create_users_table.php`
- [Cache & job tables](https://github.com/bestaria/uas_224520011/blob/main/database/migrations/0001_01_01_000002_create_jobs_table.php): framework migrations · Enables database-backed cache and queue when configured. · `database/migrations/0001_01_01_000002_create_jobs_table.php`

### Presentation

- [Field Blade views](https://github.com/bestaria/uas_224520011/blob/main/resources/views/lapangan/index.blade.php): Blade templates · `resources/views/lapangan/index.blade.php`
- [Reservation Blade views](https://github.com/bestaria/uas_224520011/blob/main/resources/views/reservasi/create.blade.php): Blade templates · `resources/views/reservasi/create.blade.php`
- [Dashboard & login views](https://github.com/bestaria/uas_224520011/blob/main/resources/views/dashboard.blade.php): Blade templates · `resources/views/dashboard.blade.php`
- [Public field media](https://github.com/bestaria/uas_224520011/tree/main/public/gambar): uploads · `public/gambar`
- [Vite frontend assets](https://github.com/bestaria/uas_224520011/blob/main/resources/js/app.js): asset pipeline · Builds CSS and JavaScript served from public assets. · `resources/js/app.js`

### Other components

- **Browser**: client

## Connections

- Browser → HTTP entry point: HTTP request
- HTTP entry point → Laravel bootstrap: bootstraps
- Laravel bootstrap → Web routes: dispatches
- Web routes → Auth & role boundary: protected routes
- Auth & role boundary → Role middleware: applies roles
- Web routes → Login controller: login routes
- Web routes → Field management: field routes
- Web routes → Reservation workflow: reservation routes
- Auth & role boundary → Auth configuration: uses
- Login controller → User identity: authenticates
- Field management → Field Blade views: renders
- Field management → Public field media: serves field media
- Reservation workflow → Reservation Blade views: renders
- Login controller → Dashboard & login views: renders login
- Web routes → Dashboard & login views: dashboard route
- User identity → Database connection: persists through
- Users schema → Database connection: provisions
- Cache & job tables → Database connection: provisions tables in
- Vite frontend assets → Public field media: built assets served from public
