# zenhosta/niagakita-toko-online architecture

> Architecture diagram of the GitHub repository zenhosta/niagakita-toko-online, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zenhosta/niagakita-toko-online
- Repository: https://github.com/zenhosta/niagakita-toko-online

## Overview

NiagaKita is a PHP online store. Shoppers browse products, manage a cart, and reach checkout; checkout supports manual or RajaOngkir shipping and a WhatsApp-based order flow documented in the README. Admins manage the catalog, discounts, stock, orders, and storefront appearance. Installation initializes the database and locks the installer. The sampled code supports the main request, catalog, cart, shipping, admin, and setup links; unsampled order, authentication, and stock-opname details are represented only at their documented subsystem paths.

Main entry points: [`app/Core/Router.php`](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Core/Router.php) (Router), [`app/Controllers/StoreController.php`](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/StoreController.php) (Store actions), [`app/Core/Database.php`](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Core/Database.php) (Database access), [`app/Controllers/AdminController.php`](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/AdminController.php) (Admin actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Request runtime"]
  node_entry["Web entry<br/>[index.php]"]
  node_bootstrap["Bootstrap<br/>[app.php]"]
  node_application["Application<br/>[Application.php]"]
  node_router["Router<br/>[Router.php]"]
  node_routes["Web routes<br/>[web.php]"]
  node_database[("Database access<br/>[Database.php]")]
end

subgraph group_storefront["Storefront shopping"]
  node_store["Store actions"]
  node_storeviews["Store pages"]
  node_cart["Session cart"]
  node_checkout["Checkout and orders"]
end

subgraph group_admin["Store management"]
  node_admin["Admin actions"]
  node_appearance["Appearance settings"]
  node_adminviews["Admin pages"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_throttle["Login throttling<br/>[LoginThrottle.php]"]
end

subgraph group_setup["Setup and integrations"]
  node_installer["Web installer"]
  node_raja["Shipping service"]
end

node_shopper(("Shopper"))
node_whatsapp(("WhatsApp ordering"))
node_rajaapi{{"RajaOngkir API"}}
node_storedb[("MySQL store")]

node_shopper -->|"requests pages"| node_entry
node_entry -->|"loads app"| node_bootstrap
node_bootstrap -->|"creates"| node_application
node_bootstrap -->|"registers routes"| node_routes
node_application -->|"dispatches"| node_router
node_router -->|"dispatches store routes"| node_store
node_router -->|"dispatches admin routes"| node_admin
node_router -->|"dispatches appearance routes"| node_appearance
node_router -->|"dispatches auth routes"| node_auth
node_router -->|"dispatches install routes"| node_installer
node_store -->|"queries catalog"| node_database
node_store -->|"updates cart"| node_cart
node_cart -->|"loads cart items"| node_database
node_store -->|"starts checkout"| node_checkout
node_checkout -.->|"requests rates"| node_raja
node_raja -.->|"calls API"| node_rajaapi
node_checkout -.->|"continues order"| node_whatsapp
node_store -->|"renders pages"| node_storeviews
node_admin -->|"reads and writes"| node_database
node_appearance -->|"saves settings"| node_database
node_admin -->|"renders pages"| node_adminviews
node_appearance -->|"renders settings"| node_adminviews
node_auth -->|"checks attempts"| node_throttle
node_auth -->|"checks credentials"| node_database
node_installer -->|"creates schema and data"| node_database
node_store -->|"reads product data"| node_storedb
node_admin -->|"manages store data"| node_storedb

click node_entry "https://github.com/zenhosta/niagakita-toko-online/blob/main/public/index.php"
click node_bootstrap "https://github.com/zenhosta/niagakita-toko-online/blob/main/bootstrap/app.php"
click node_application "https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Core/Application.php"
click node_router "https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Core/Router.php"
click node_routes "https://github.com/zenhosta/niagakita-toko-online/blob/main/routes/web.php"
click node_database "https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Core/Database.php"
click node_store "https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/StoreController.php"
click node_storeviews "https://github.com/zenhosta/niagakita-toko-online/tree/main/app/Views/storefront"
click node_cart "https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/StoreController.php"
click node_checkout "https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/StoreController.php"
click node_admin "https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/AdminController.php"
click node_appearance "https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/AppearanceController.php"
click node_adminviews "https://github.com/zenhosta/niagakita-toko-online/tree/main/app/Views/admin"
click node_auth "https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/AuthController.php"
click node_throttle "https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Services/LoginThrottle.php"
click node_installer "https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/InstallController.php"
click node_raja "https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Services/RajaOngkirService.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_application,node_router,node_routes,node_database toneBlue
class node_store,node_storeviews,node_cart,node_checkout,node_storedb toneAmber
class node_admin,node_appearance,node_adminviews,node_auth,node_throttle,node_rajaapi toneMint
class node_installer,node_raja toneRose
class node_shopper,node_whatsapp toneIndigo
```

## Components

### Request runtime

- [Web entry](https://github.com/zenhosta/niagakita-toko-online/blob/main/public/index.php): `public/index.php`
- [Bootstrap](https://github.com/zenhosta/niagakita-toko-online/blob/main/bootstrap/app.php): `bootstrap/app.php`
- [Application](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Core/Application.php): `app/Core/Application.php`
- [Router](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Core/Router.php): `app/Core/Router.php`
- [Web routes](https://github.com/zenhosta/niagakita-toko-online/blob/main/routes/web.php): `routes/web.php`
- [Database access](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Core/Database.php): `app/Core/Database.php`

### Storefront shopping

- [Store actions](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/StoreController.php): `app/Controllers/StoreController.php`
- [Store pages](https://github.com/zenhosta/niagakita-toko-online/tree/main/app/Views/storefront): `app/Views/storefront`
- [Session cart](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/StoreController.php): `app/Controllers/StoreController.php`
- [Checkout and orders](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/StoreController.php): `app/Controllers/StoreController.php`

### Store management

- [Admin actions](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/AdminController.php): `app/Controllers/AdminController.php`
- [Appearance settings](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/AppearanceController.php): `app/Controllers/AppearanceController.php`
- [Admin pages](https://github.com/zenhosta/niagakita-toko-online/tree/main/app/Views/admin): `app/Views/admin`
- [Authentication](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/AuthController.php): `app/Controllers/AuthController.php`
- [Login throttling](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Services/LoginThrottle.php): `app/Services/LoginThrottle.php`

### Setup and integrations

- [Web installer](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Controllers/InstallController.php): `app/Controllers/InstallController.php`
- [Shipping service](https://github.com/zenhosta/niagakita-toko-online/blob/main/app/Services/RajaOngkirService.php): `app/Services/RajaOngkirService.php`

### Other components

- **Shopper**
- **WhatsApp ordering**
- **RajaOngkir API**
- **MySQL store**

## Connections

- Shopper → Web entry: requests pages
- Web entry → Bootstrap: loads app
- Bootstrap → Application: creates
- Bootstrap → Web routes: registers routes
- Application → Router: dispatches
- Router → Store actions: dispatches store routes
- Router → Admin actions: dispatches admin routes
- Router → Appearance settings: dispatches appearance routes
- Router → Authentication: dispatches auth routes
- Router → Web installer: dispatches install routes
- Store actions → Database access: queries catalog
- Store actions → Session cart: updates cart
- Session cart → Database access: loads cart items
- Store actions → Checkout and orders: starts checkout
- Checkout and orders → Shipping service: requests rates
- Shipping service → RajaOngkir API: calls API
- Checkout and orders → WhatsApp ordering: continues order
- Store actions → Store pages: renders pages
- Admin actions → Database access: reads and writes
- Appearance settings → Database access: saves settings
- Admin actions → Admin pages: renders pages
- Appearance settings → Admin pages: renders settings
- Authentication → Login throttling: checks attempts
- Authentication → Database access: checks credentials
- Web installer → Database access: creates schema and data
- Store actions → MySQL store: reads product data
- Admin actions → MySQL store: manages store data
