# papi0404/eight-canteen architecture

> Architecture diagram of the GitHub repository papi0404/eight-canteen, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/papi0404/eight-canteen
- Repository: https://github.com/papi0404/eight-canteen

## Overview

Eight Canteen is an Android app for school canteen ordering, payments, and stand operations. Students authenticate, browse stands and menus (including QR scanning), build a cart, check out using QRIS or cash, and follow receipt/order status; sellers manage menus and order fulfillment, while admins manage stands and users. MainActivity routes Compose screens; the repository mediates API operations, Retrofit provides backend calls, and SessionManager keeps local session state. Connections for unsampled features are documented at the capability level; only source-supported calls are drawn as solid edges.

Main entry points: [`app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt`](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt) (Compose navigation), [`app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/repository/CanteenRepository.kt`](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/repository/CanteenRepository.kt) (Canteen repository), [`app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/dashboard/StudentDashboardScreen.kt`](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/dashboard/StudentDashboardScreen.kt) (Student dashboard), [`app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/stand/StandMenuScreen.kt`](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/stand/StandMenuScreen.kt) (Stand menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_nav["Compose navigation<br/>[MainActivity.kt]"]
  node_auth["Authentication<br/>[AuthViewModel.kt]"]
  node_register["Student registration"]
  node_otp["OTP verification"]
end

subgraph group_student["Student ordering"]
  node_home["Student dashboard"]
  node_scan["Stand QR scanner<br/>[QrScannerScreen.kt]"]
  node_stands["Stand catalog<br/>[AllStandsScreen.kt]"]
  node_menu["Stand menu<br/>[StandMenuScreen.kt]"]
end

subgraph group_commerce["Orders and rewards"]
  node_checkout["Cart and checkout<br/>[CheckoutScreen.kt]"]
  node_payment["Payment selection"]
  node_qris["QRIS payment"]
  node_cash["Counter payment"]
  node_receipt["Receipt and status"]
  node_history["Order history"]
  node_rewards["Reward points"]
end

subgraph group_operations["Stand operations"]
  node_seller["Seller dashboard"]
  node_admin["Admin dashboard"]
  node_addstand["Admin stand setup"]
  node_standreg["Stand registration"]
  node_notifications["Order notifications"]
end

subgraph group_data["Data and session"]
  node_repository["Canteen repository"]
  node_api["API service<br/>[ApiService.kt]"]
  node_config["API client config<br/>[ApiConfig.kt]"]
  node_session[("Session storage<br/>[SessionManager.kt]")]
end

node_user(("Student / seller"))
node_backend["Canteen backend"]

node_user -->|"uses app"| node_nav
node_nav -->|"routes to"| node_auth
node_nav -->|"routes to"| node_home
node_nav -->|"routes to"| node_stands
node_nav -->|"routes to"| node_menu
node_nav -->|"routes to"| node_seller
node_nav -->|"routes to"| node_admin
node_nav -->|"routes to"| node_otp
node_nav -->|"routes to"| node_register
node_nav -->|"routes to"| node_checkout
node_nav -->|"routes to"| node_receipt
node_home -->|"loads catalog"| node_repository
node_home -->|"selects stand"| node_stands
node_scan -.->|"opens stand"| node_menu
node_menu -->|"loads menu"| node_repository
node_menu -.->|"adds to cart"| node_checkout
node_checkout -.->|"continues checkout"| node_payment
node_payment -.->|"chooses QRIS"| node_qris
node_payment -.->|"chooses cash"| node_cash
node_receipt -->|"refreshes status"| node_repository
node_home -->|"opens history"| node_history
node_user -->|"views rewards"| node_rewards
node_seller -->|"manages orders"| node_repository
node_seller -->|"uploads images"| node_repository
node_admin -->|"manages users"| node_repository
node_admin -.->|"opens setup"| node_addstand
node_user -->|"registers stand"| node_standreg
node_user -->|"checks updates"| node_notifications
node_auth -.->|"stores session"| node_session
node_register -->|"registers account"| node_repository
node_otp -->|"verifies code"| node_repository
node_repository -->|"calls endpoints"| node_api
node_api -->|"sends requests"| node_backend
node_config -->|"creates client"| node_api
node_session -->|"sets token"| node_config
node_nav -->|"checks session"| node_session

click node_nav "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt"
click node_auth "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/login/AuthViewModel.kt"
click node_register "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/register/StudentRegisterScreen.kt"
click node_otp "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/otp/OtpVerificationScreen.kt"
click node_home "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/dashboard/StudentDashboardScreen.kt"
click node_scan "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/components/QrScannerScreen.kt"
click node_stands "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/stand/AllStandsScreen.kt"
click node_menu "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/stand/StandMenuScreen.kt"
click node_checkout "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/checkout/CheckoutScreen.kt"
click node_payment "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/checkout/CheckoutPaymentScreen.kt"
click node_qris "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/payment/QrisPaymentScreen.kt"
click node_cash "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/payment/PayAtCounterScreen.kt"
click node_receipt "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/payment/StrukLunasScreen.kt"
click node_history "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/dashboard/StudentOrderHistoryScreen.kt"
click node_rewards "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/points/PointsRewardScreen.kt"
click node_seller "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/seller/SellerDashboardScreen.kt"
click node_admin "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/admin/AdminDashboardScreen.kt"
click node_addstand "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/admin/AdminAddStandScreen.kt"
click node_standreg "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/stand/StandRegisterScreen.kt"
click node_notifications "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/components/NotificationScreen.kt"
click node_repository "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/repository/CanteenRepository.kt"
click node_api "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/remote/ApiService.kt"
click node_config "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/remote/ApiConfig.kt"
click node_session "https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/local/SessionManager.kt"

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_nav,node_auth,node_register,node_otp toneBlue
class node_home,node_scan,node_stands,node_menu toneAmber
class node_checkout,node_payment,node_qris,node_cash,node_receipt,node_history,node_rewards toneMint
class node_seller,node_admin,node_addstand,node_standreg,node_notifications toneRose
class node_repository,node_api,node_config,node_session,node_user,node_backend toneIndigo
```

## Components

### App navigation

- [Compose navigation](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt`
- [Authentication](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/login/AuthViewModel.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/login/AuthViewModel.kt`
- [Student registration](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/register/StudentRegisterScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/register/StudentRegisterScreen.kt`
- [OTP verification](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/otp/OtpVerificationScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/otp/OtpVerificationScreen.kt`

### Student ordering

- [Student dashboard](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/dashboard/StudentDashboardScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/dashboard/StudentDashboardScreen.kt`
- [Stand QR scanner](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/components/QrScannerScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/components/QrScannerScreen.kt`
- [Stand catalog](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/stand/AllStandsScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/stand/AllStandsScreen.kt`
- [Stand menu](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/stand/StandMenuScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/stand/StandMenuScreen.kt`

### Orders and rewards

- [Cart and checkout](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/checkout/CheckoutScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/checkout/CheckoutScreen.kt`
- [Payment selection](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/checkout/CheckoutPaymentScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/checkout/CheckoutPaymentScreen.kt`
- [QRIS payment](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/payment/QrisPaymentScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/payment/QrisPaymentScreen.kt`
- [Counter payment](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/payment/PayAtCounterScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/payment/PayAtCounterScreen.kt`
- [Receipt and status](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/payment/StrukLunasScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/payment/StrukLunasScreen.kt`
- [Order history](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/dashboard/StudentOrderHistoryScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/dashboard/StudentOrderHistoryScreen.kt`
- [Reward points](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/points/PointsRewardScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/points/PointsRewardScreen.kt`

### Stand operations

- [Seller dashboard](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/seller/SellerDashboardScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/seller/SellerDashboardScreen.kt`
- [Admin dashboard](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/admin/AdminDashboardScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/admin/AdminDashboardScreen.kt`
- [Admin stand setup](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/admin/AdminAddStandScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/admin/AdminAddStandScreen.kt`
- [Stand registration](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/stand/StandRegisterScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/stand/StandRegisterScreen.kt`
- [Order notifications](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/components/NotificationScreen.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/components/NotificationScreen.kt`

### Data and session

- [Canteen repository](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/repository/CanteenRepository.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/repository/CanteenRepository.kt`
- [API service](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/remote/ApiService.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/remote/ApiService.kt`
- [API client config](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/remote/ApiConfig.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/remote/ApiConfig.kt`
- [Session storage](https://github.com/papi0404/eight-canteen/blob/main/app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/local/SessionManager.kt): `app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/local/SessionManager.kt`

### Other components

- **Student / seller**
- **Canteen backend**

## Connections

- Student / seller → Compose navigation: uses app (evidence: `README.md`)
- Compose navigation → Authentication: routes to (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt`)
- Compose navigation → Student dashboard: routes to (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt`)
- Compose navigation → Stand catalog: routes to (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt`)
- Compose navigation → Stand menu: routes to (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt`)
- Compose navigation → Seller dashboard: routes to (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt`)
- Compose navigation → Admin dashboard: routes to (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt`)
- Compose navigation → OTP verification: routes to (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt`)
- Compose navigation → Student registration: routes to (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt`)
- Compose navigation → Cart and checkout: routes to (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt`)
- Compose navigation → Receipt and status: routes to (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt`)
- Student dashboard → Canteen repository: loads catalog (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/dashboard/StudentDashboardScreen.kt`)
- Student dashboard → Stand catalog: selects stand (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt`)
- Stand QR scanner → Stand menu: opens stand
- Stand menu → Canteen repository: loads menu (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/stand/StandMenuScreen.kt`)
- Stand menu → Cart and checkout: adds to cart
- Cart and checkout → Payment selection: continues checkout
- Payment selection → QRIS payment: chooses QRIS
- Payment selection → Counter payment: chooses cash
- Receipt and status → Canteen repository: refreshes status (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/payment/StrukLunasScreen.kt`)
- Student dashboard → Order history: opens history (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/dashboard/StudentDashboardScreen.kt`)
- Student / seller → Reward points: views rewards (evidence: `README.md`)
- Seller dashboard → Canteen repository: manages orders (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/seller/SellerDashboardScreen.kt`)
- Seller dashboard → Canteen repository: uploads images (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/seller/SellerDashboardScreen.kt`)
- Admin dashboard → Canteen repository: manages users (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/admin/AdminDashboardScreen.kt`)
- Admin dashboard → Admin stand setup: opens setup
- Student / seller → Stand registration: registers stand (evidence: `README.md`)
- Student / seller → Order notifications: checks updates (evidence: `README.md`)
- Authentication → Session storage: stores session (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/login/AuthViewModel.kt`)
- Student registration → Canteen repository: registers account (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/register/StudentRegisterScreen.kt`)
- OTP verification → Canteen repository: verifies code (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/ui/otp/OtpVerificationScreen.kt`)
- Canteen repository → API service: calls endpoints (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/repository/CanteenRepository.kt`)
- API service → Canteen backend: sends requests (evidence: `README.md`)
- API client config → API service: creates client (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/remote/ApiConfig.kt`)
- Session storage → API client config: sets token (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/data/local/SessionManager.kt`)
- Compose navigation → Session storage: checks session (evidence: `app/src/main/java/com/januarzidanetinendeng/eightcanteen/MainActivity.kt`)
