# dwaryarr/simpleposcrud-ci4 architecture

> Architecture diagram of the GitHub repository dwaryarr/simpleposcrud-ci4, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dwaryarr/simpleposcrud-ci4
- Repository: https://github.com/dwaryarr/simpleposcrud-ci4

## Overview

This is a CodeIgniter 4 point-of-sale application for managing inventory, customers, cashiers, and transactions, with transaction receipt printing. The documented workflow is a browser request into the public application, route dispatch to a domain controller, and CRUD interaction with the corresponding data model and screens. The README documents MySQL setup and the application’s main features. Several domain controllers and models were not sampled, so their internal calls and view wiring are not asserted; dashed links mark those unverified relationships.

Main entry points: [`app/Config/Routes.php`](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Config/Routes.php) (POS Routes), [`app/Controllers/Transaksi.php`](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Controllers/Transaksi.php) (Transaction CRUD), [`app/Controllers/Barang.php`](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Controllers/Barang.php) (Barang CRUD), [`app/Controllers/Konsumen.php`](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Controllers/Konsumen.php) (Konsumen CRUD)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Web Runtime"]
  node_entry["HTTP Entry<br/>[index.php]"]
  node_engine["Request Engine<br/>[CodeIgniter.php]"]
  node_routes["POS Routes<br/>[Routes.php]"]
  node_router["Router<br/>[Router.php]"]
end

subgraph group_catalog["POS Records"]
  node_barang["Barang CRUD<br/>[Barang.php]"]
  node_barangmodel["Barang Model<br/>[BarangModel.php]"]
  node_barangviews["Barang Screens<br/>[index.php]"]
  node_konsumen["Konsumen CRUD<br/>[Konsumen.php]"]
  node_konsumenmodel["Konsumen Model<br/>[KonsumenModel.php]"]
  node_konsumenv["Konsumen Screens<br/>[index.php]"]
  node_kasir["Kasir CRUD<br/>[Kasir.php]"]
  node_kasirmodel["Kasir Model<br/>[KasirModel.php]"]
  node_kasirviews["Kasir Screens<br/>[index.php]"]
end

subgraph group_sales["Sales Workflow"]
  node_transaksi["Transaction CRUD<br/>[Transaksi.php]"]
  node_transaksimodel["Transaction Model<br/>[TransaksiModel.php]"]
  node_transaksiviews["Transaction Screens<br/>[index.php]"]
  node_receipt["Receipt View<br/>[struk.php]"]
end

subgraph group_data["Persistence"]
  node_database[("MySQL Database")]
end

node_user(("Browser User"))

node_user -->|"requests page"| node_entry
node_entry -.->|"starts runtime"| node_engine
node_engine -.->|"dispatches request"| node_router
node_routes -->|"routes CRUD"| node_barang
node_routes -->|"routes CRUD"| node_konsumen
node_routes -->|"routes CRUD"| node_kasir
node_routes -->|"routes sales"| node_transaksi
node_barang -->|"uses model"| node_barangmodel
node_barang -.->|"renders screens"| node_barangviews
node_konsumen -.->|"uses model"| node_konsumenmodel
node_konsumen -.->|"renders screens"| node_konsumenv
node_kasir -.->|"uses model"| node_kasirmodel
node_kasir -.->|"renders screens"| node_kasirviews
node_transaksi -.->|"uses model"| node_transaksimodel
node_transaksi -.->|"renders screens"| node_transaksiviews
node_transaksi -.->|"prints receipt"| node_receipt
node_barangmodel -.->|"reads and writes"| node_database
node_konsumenmodel -.->|"reads and writes"| node_database
node_kasirmodel -.->|"reads and writes"| node_database
node_transaksimodel -.->|"reads and writes"| node_database

click node_entry "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/public/index.php"
click node_engine "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/system/CodeIgniter.php"
click node_routes "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Config/Routes.php"
click node_router "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/system/Router/Router.php"
click node_barang "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Controllers/Barang.php"
click node_barangmodel "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Models/BarangModel.php"
click node_barangviews "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Views/barang/index.php"
click node_konsumen "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Controllers/Konsumen.php"
click node_konsumenmodel "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Models/KonsumenModel.php"
click node_konsumenv "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Views/konsumen/index.php"
click node_kasir "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Controllers/Kasir.php"
click node_kasirmodel "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Models/KasirModel.php"
click node_kasirviews "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Views/kasir/index.php"
click node_transaksi "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Controllers/Transaksi.php"
click node_transaksimodel "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Models/TransaksiModel.php"
click node_transaksiviews "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Views/transaksi/index.php"
click node_receipt "https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Views/transaksi/struk.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_engine,node_routes,node_router,node_user toneBlue
class node_barang,node_barangmodel,node_barangviews,node_konsumen,node_konsumenmodel,node_konsumenv,node_kasir,node_kasirmodel,node_kasirviews toneAmber
class node_transaksi,node_transaksimodel,node_transaksiviews,node_receipt toneMint
class node_database toneRose
```

## Components

### Web Runtime

- [HTTP Entry](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/public/index.php): `public/index.php`
- [Request Engine](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/system/CodeIgniter.php): `system/CodeIgniter.php`
- [POS Routes](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Config/Routes.php): `app/Config/Routes.php`
- [Router](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/system/Router/Router.php): `system/Router/Router.php`

### POS Records

- [Barang CRUD](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Controllers/Barang.php): `app/Controllers/Barang.php`
- [Barang Model](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Models/BarangModel.php): `app/Models/BarangModel.php`
- [Barang Screens](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Views/barang/index.php): `app/Views/barang/index.php`
- [Konsumen CRUD](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Controllers/Konsumen.php): `app/Controllers/Konsumen.php`
- [Konsumen Model](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Models/KonsumenModel.php): `app/Models/KonsumenModel.php`
- [Konsumen Screens](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Views/konsumen/index.php): `app/Views/konsumen/index.php`
- [Kasir CRUD](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Controllers/Kasir.php): `app/Controllers/Kasir.php`
- [Kasir Model](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Models/KasirModel.php): `app/Models/KasirModel.php`
- [Kasir Screens](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Views/kasir/index.php): `app/Views/kasir/index.php`

### Sales Workflow

- [Transaction CRUD](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Controllers/Transaksi.php): `app/Controllers/Transaksi.php`
- [Transaction Model](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Models/TransaksiModel.php): `app/Models/TransaksiModel.php`
- [Transaction Screens](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Views/transaksi/index.php): `app/Views/transaksi/index.php`
- [Receipt View](https://github.com/dwaryarr/simpleposcrud-ci4/blob/main/app/Views/transaksi/struk.php): `app/Views/transaksi/struk.php`

### Persistence

- **MySQL Database**

### Other components

- **Browser User**

## Connections

- Browser User → HTTP Entry: requests page
- HTTP Entry → Request Engine: starts runtime
- Request Engine → Router: dispatches request (evidence: `system/Router/Router.php`)
- POS Routes → Barang CRUD: routes CRUD (evidence: `app/Config/Routes.php`)
- POS Routes → Konsumen CRUD: routes CRUD (evidence: `app/Config/Routes.php`)
- POS Routes → Kasir CRUD: routes CRUD (evidence: `app/Config/Routes.php`)
- POS Routes → Transaction CRUD: routes sales (evidence: `app/Config/Routes.php`)
- Barang CRUD → Barang Model: uses model (evidence: `app/Controllers/Barang.php`)
- Barang CRUD → Barang Screens: renders screens
- Konsumen CRUD → Konsumen Model: uses model
- Konsumen CRUD → Konsumen Screens: renders screens
- Kasir CRUD → Kasir Model: uses model
- Kasir CRUD → Kasir Screens: renders screens
- Transaction CRUD → Transaction Model: uses model
- Transaction CRUD → Transaction Screens: renders screens
- Transaction CRUD → Receipt View: prints receipt
- Barang Model → MySQL Database: reads and writes
- Konsumen Model → MySQL Database: reads and writes
- Kasir Model → MySQL Database: reads and writes
- Transaction Model → MySQL Database: reads and writes
