# tim-it-lamsel/sistem-sppg architecture

> Architecture diagram of the GitHub repository tim-it-lamsel/sistem-sppg, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tim-it-lamsel/sistem-sppg
- Repository: https://github.com/tim-it-lamsel/sistem-sppg

## Overview

SPPG is a school-meals operations platform: public users browse school, kitchen, and ingredient information, while administrators and SPPG staff manage resources, partner schools, menus, and daily distribution reports. The backend exposes Laravel API routes and persists domain records through Eloquent models; the Next.js frontend provides public and role-oriented screens. The README is empty, and frontend API wiring was not shown, so those connections are marked unverified rather than inferred from page names.

Main entry points: [`sppg-backend/routes/api.php`](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/routes/api.php) (API routing), [`sppg-backend/app/Http/Controllers/Api/LaporanHarianSppgController.php`](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/LaporanHarianSppgController.php) (Daily report API), [`sppg-backend/app/Http/Controllers/Api/SekolahController.php`](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/SekolahController.php) (School API), [`sppg-backend/app/Http/Controllers/Api/BahanBakuController.php`](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/BahanBakuController.php) (Ingredient API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web experience"]
  node_public_pages["Public pages"]
  node_admin_pages["Admin pages"]
  node_sppg_pages["SPPG pages"]
  node_maps_reports["Maps and reports UI"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["API and access"]
  node_api_routes["API routing<br/>[api.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_role_access["Role access<br/>[RoleMiddleware.php]"]
  node_school_api["School API"]
  node_ingredients_api["Ingredient API"]
  node_kitchen_api["Kitchen API"]
  node_menu_api["Menu API"]
  node_report_api["Daily report API"]
  node_response_format["API response format<br/>[ApiResponse.php]"]
  node_report_validation["Report validation"]
end

subgraph group_operations["SPPG operations"]
  node_school_partnership["School partnerships"]
  node_daily_distribution["Distribution reporting"]
  node_ingredients_ops["Ingredient management"]
end

subgraph group_domain["Domain data"]
  node_schools[("Schools<br/>[Sekolah.php]")]
  node_kitchens[("SPPG kitchens<br/>[DapurMbg.php]")]
  node_ingredients[("Raw ingredients<br/>[BahanBaku.php]")]
  node_reports[("Daily reports")]
  node_users[("Users<br/>[User.php]")]
end

node_public_users(("Public users"))
node_admin_staff(("Admin staff"))
node_sppg_staff(("SPPG staff"))

node_api_routes -->|"routes to"| node_auth
node_api_routes -->|"routes to"| node_school_api
node_api_routes -->|"routes to"| node_ingredients_api
node_api_routes -->|"routes to"| node_kitchen_api
node_api_routes -->|"routes to"| node_menu_api
node_api_routes -->|"routes to"| node_report_api
node_api_routes -->|"aliases middleware"| node_role_access
node_school_api -->|"queries and writes"| node_schools
node_ingredients_api -->|"queries and writes"| node_ingredients
node_kitchen_api -->|"queries"| node_kitchens
node_report_api -->|"queries and writes"| node_reports
node_report_api -->|"validates through"| node_report_validation
node_school_api -->|"formats responses"| node_response_format
node_ingredients_api -->|"formats responses"| node_response_format
node_report_api -->|"formats responses"| node_response_format
node_reports -->|"belongs to"| node_kitchens
node_reports -->|"belongs to"| node_schools
node_public_users -.->|"browses"| node_public_pages
node_admin_staff -.->|"uses"| node_admin_pages
node_sppg_staff -.->|"uses"| node_sppg_pages
node_public_pages -.->|"requests data"| node_api_client
node_admin_pages -.->|"requests data"| node_api_client
node_sppg_pages -.->|"requests data"| node_api_client
node_api_client -.->|"calls API"| node_api_routes
node_school_api -->|"handles claims"| node_school_partnership
node_report_api -->|"handles reports"| node_daily_distribution
node_ingredients_api -->|"handles inventory"| node_ingredients_ops

click node_public_pages "https://github.com/tim-it-lamsel/sistem-sppg/tree/main/sppg-frontend/app"
click node_admin_pages "https://github.com/tim-it-lamsel/sistem-sppg/tree/main/sppg-frontend/app/admin"
click node_sppg_pages "https://github.com/tim-it-lamsel/sistem-sppg/tree/main/sppg-frontend/app/sppg"
click node_maps_reports "https://github.com/tim-it-lamsel/sistem-sppg/tree/main/sppg-frontend/components"
click node_api_client "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-frontend/lib/api.ts"
click node_api_routes "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/routes/api.php"
click node_auth "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/AuthController.php"
click node_role_access "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Middleware/RoleMiddleware.php"
click node_school_api "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/SekolahController.php"
click node_ingredients_api "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/BahanBakuController.php"
click node_kitchen_api "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/DapurMbgController.php"
click node_menu_api "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/MakananController.php"
click node_report_api "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/LaporanHarianSppgController.php"
click node_school_partnership "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/SekolahController.php"
click node_daily_distribution "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/LaporanHarianSppgController.php"
click node_ingredients_ops "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/BahanBakuController.php"
click node_schools "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Models/Sekolah.php"
click node_kitchens "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Models/DapurMbg.php"
click node_ingredients "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Models/BahanBaku.php"
click node_reports "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Models/LaporanHarianSppg.php"
click node_users "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Models/User.php"
click node_response_format "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Traits/ApiResponse.php"
click node_report_validation "https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Requests/StoreLaporanHarianSppgRequest.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_pages,node_admin_pages,node_sppg_pages,node_maps_reports,node_api_client,node_public_users toneBlue
class node_api_routes,node_auth,node_role_access,node_school_api,node_ingredients_api,node_kitchen_api,node_menu_api,node_report_api,node_response_format,node_report_validation toneAmber
class node_school_partnership,node_daily_distribution,node_ingredients_ops toneMint
class node_schools,node_kitchens,node_ingredients,node_reports,node_users toneRose
class node_admin_staff,node_sppg_staff toneIndigo
```

## Components

### Web experience

- [Public pages](https://github.com/tim-it-lamsel/sistem-sppg/tree/main/sppg-frontend/app): `sppg-frontend/app`
- [Admin pages](https://github.com/tim-it-lamsel/sistem-sppg/tree/main/sppg-frontend/app/admin): `sppg-frontend/app/admin`
- [SPPG pages](https://github.com/tim-it-lamsel/sistem-sppg/tree/main/sppg-frontend/app/sppg): `sppg-frontend/app/sppg`
- [Maps and reports UI](https://github.com/tim-it-lamsel/sistem-sppg/tree/main/sppg-frontend/components): `sppg-frontend/components`
- [API client](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-frontend/lib/api.ts): `sppg-frontend/lib/api.ts`

### API and access

- [API routing](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/routes/api.php): `sppg-backend/routes/api.php`
- [Authentication](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/AuthController.php): `sppg-backend/app/Http/Controllers/Api/AuthController.php`
- [Role access](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Middleware/RoleMiddleware.php): `sppg-backend/app/Http/Middleware/RoleMiddleware.php`
- [School API](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/SekolahController.php): `sppg-backend/app/Http/Controllers/Api/SekolahController.php`
- [Ingredient API](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/BahanBakuController.php): `sppg-backend/app/Http/Controllers/Api/BahanBakuController.php`
- [Kitchen API](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/DapurMbgController.php): `sppg-backend/app/Http/Controllers/Api/DapurMbgController.php`
- [Menu API](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/MakananController.php): `sppg-backend/app/Http/Controllers/Api/MakananController.php`
- [Daily report API](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/LaporanHarianSppgController.php): `sppg-backend/app/Http/Controllers/Api/LaporanHarianSppgController.php`
- [API response format](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Traits/ApiResponse.php): `sppg-backend/app/Traits/ApiResponse.php`
- [Report validation](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Requests/StoreLaporanHarianSppgRequest.php): `sppg-backend/app/Http/Requests/StoreLaporanHarianSppgRequest.php`

### SPPG operations

- [School partnerships](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/SekolahController.php): `sppg-backend/app/Http/Controllers/Api/SekolahController.php`
- [Distribution reporting](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/LaporanHarianSppgController.php): `sppg-backend/app/Http/Controllers/Api/LaporanHarianSppgController.php`
- [Ingredient management](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Http/Controllers/Api/BahanBakuController.php): `sppg-backend/app/Http/Controllers/Api/BahanBakuController.php`

### Domain data

- [Schools](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Models/Sekolah.php): `sppg-backend/app/Models/Sekolah.php`
- [SPPG kitchens](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Models/DapurMbg.php): `sppg-backend/app/Models/DapurMbg.php`
- [Raw ingredients](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Models/BahanBaku.php): `sppg-backend/app/Models/BahanBaku.php`
- [Daily reports](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Models/LaporanHarianSppg.php): `sppg-backend/app/Models/LaporanHarianSppg.php`
- [Users](https://github.com/tim-it-lamsel/sistem-sppg/blob/main/sppg-backend/app/Models/User.php): `sppg-backend/app/Models/User.php`

### Other components

- **Public users**
- **Admin staff**
- **SPPG staff**

## Connections

- API routing → Authentication: routes to (evidence: `sppg-backend/routes/api.php`)
- API routing → School API: routes to (evidence: `sppg-backend/routes/api.php`)
- API routing → Ingredient API: routes to (evidence: `sppg-backend/routes/api.php`)
- API routing → Kitchen API: routes to (evidence: `sppg-backend/routes/api.php`)
- API routing → Menu API: routes to (evidence: `sppg-backend/routes/api.php`)
- API routing → Daily report API: routes to (evidence: `sppg-backend/routes/api.php`)
- API routing → Role access: aliases middleware
- School API → Schools: queries and writes (evidence: `sppg-backend/app/Http/Controllers/Api/SekolahController.php`)
- Ingredient API → Raw ingredients: queries and writes (evidence: `sppg-backend/app/Http/Controllers/Api/BahanBakuController.php`)
- Kitchen API → SPPG kitchens: queries
- Daily report API → Daily reports: queries and writes (evidence: `sppg-backend/app/Http/Controllers/Api/LaporanHarianSppgController.php`)
- Daily report API → Report validation: validates through (evidence: `sppg-backend/app/Http/Controllers/Api/LaporanHarianSppgController.php`)
- School API → API response format: formats responses (evidence: `sppg-backend/app/Http/Controllers/Api/SekolahController.php`)
- Ingredient API → API response format: formats responses (evidence: `sppg-backend/app/Http/Controllers/Api/BahanBakuController.php`)
- Daily report API → API response format: formats responses (evidence: `sppg-backend/app/Http/Controllers/Api/LaporanHarianSppgController.php`)
- Daily reports → SPPG kitchens: belongs to (evidence: `sppg-backend/app/Models/LaporanHarianSppg.php`)
- Daily reports → Schools: belongs to (evidence: `sppg-backend/app/Models/LaporanHarianSppg.php`)
- Public users → Public pages: browses
- Admin staff → Admin pages: uses
- SPPG staff → SPPG pages: uses
- Public pages → API client: requests data
- Admin pages → API client: requests data
- SPPG pages → API client: requests data
- API client → API routing: calls API
- School API → School partnerships: handles claims (evidence: `sppg-backend/app/Http/Controllers/Api/SekolahController.php`)
- Daily report API → Distribution reporting: handles reports (evidence: `sppg-backend/app/Http/Controllers/Api/LaporanHarianSppgController.php`)
- Ingredient API → Ingredient management: handles inventory (evidence: `sppg-backend/app/Http/Controllers/Api/BahanBakuController.php`)
