# fauzan1892/pos-kasir-php architecture

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

- Interactive diagram: https://gitdiagram.com/fauzan1892/pos-kasir-php
- Repository: https://github.com/fauzan1892/pos-kasir-php

## Overview

POS Codekop is a PHP/MySQL point-of-sale application for a small retailer. An admin signs in, enters the routed dashboard, manages products and categories, then uses the AJAX cashier to build a cart and complete a transaction; the result is stored as a numbered sale and can be printed. Separate admin pages support reporting, store settings, and user-profile management, with Excel/PDF exports. The graph follows the README and sampled entry points; several subsystem connections are documented but their implementation was not sampled, so uncertain call wiring is omitted.

Main entry points: [`index.php`](https://github.com/fauzan1892/pos-kasir-php/blob/master/index.php) (Admin router), [`admin/module/barang/index.php`](https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/barang/index.php) (Product management), [`fungsi/edit/edit.php`](https://github.com/fauzan1892/pos-kasir-php/blob/master/fungsi/edit/edit.php) (Edit operations), [`admin/module/kategori/index.php`](https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/kategori/index.php) (Category management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shell"]
  node_login["Sign in<br/>[login.php]"]
  node_router["Admin router<br/>[index.php]"]
  node_session["Session and CSRF<br/>[csrf.php]"]
  node_config["DB configuration<br/>[config.php]"]
  node_dashboard["Dashboard shell<br/>[home.php]"]
  node_logout["Sign out<br/>[logout.php]"]
end

subgraph group_catalog["Retail catalog"]
  node_products["Product management<br/>[index.php]"]
  node_productdetail["Product details<br/>[index.php]"]
  node_productedit["Product editing<br/>[index.php]"]
  node_categories["Category management<br/>[index.php]"]
  node_catalogdata["Catalog queries<br/>[view.php]"]
  node_mutations["Data mutations<br/>[tambah.php]"]
  node_editing["Edit operations<br/>[edit.php]"]
  node_deletion["Delete operations<br/>[hapus.php]"]
end

subgraph group_sales["Sales and reports"]
  node_saleui["Cashier screen<br/>[index.php]"]
  node_saleapi["Cashier actions<br/>[kasir.php]"]
  node_reports["Sales reports<br/>[index.php]"]
  node_excel["Excel export<br/>[excel.php]"]
  node_pdf["PDF export<br/>[pdf.php]"]
  node_receipt["Receipt printing<br/>[print.php]"]
  node_thermal["Thermal printing<br/>[print_thermal.php]"]
end

subgraph group_admin["Store administration"]
  node_settings["Store settings<br/>[index.php]"]
  node_profile["User profile<br/>[index.php]"]
end

node_cashier(("Cashier"))
node_db[("POS database")]

node_cashier -->|"signs in"| node_login
node_login -->|"manages session"| node_session
node_login -->|"checks account"| node_db
node_login -->|"redirects"| node_router
node_router -->|"checks session"| node_session
node_router -->|"loads config"| node_config
node_config -->|"connects"| node_db
node_router -->|"renders shell"| node_dashboard
node_router -->|"routes page"| node_products
node_router -->|"routes page"| node_productdetail
node_router -->|"routes page"| node_productedit
node_router -->|"routes page"| node_categories
node_router -->|"routes page"| node_reports
node_router -->|"routes page"| node_settings
node_router -->|"routes page"| node_profile
node_products -->|"queries inventory"| node_db
node_products -->|"loads catalog data"| node_catalogdata
node_categories -->|"loads categories"| node_catalogdata
node_catalogdata -->|"queries"| node_db
node_products -->|"adds records"| node_mutations
node_categories -->|"adds records"| node_mutations
node_products -->|"updates stock"| node_editing
node_productedit -->|"submits changes"| node_editing
node_categories -->|"submits changes"| node_editing
node_products -->|"deletes records"| node_deletion
node_categories -->|"deletes records"| node_deletion
node_mutations -->|"writes"| node_db
node_editing -->|"updates"| node_db
node_deletion -->|"deletes"| node_db
node_cashier -->|"runs checkout"| node_saleui
node_saleui -->|"posts actions"| node_saleapi
node_saleapi -->|"reads and writes"| node_db
node_saleui -->|"opens receipt"| node_receipt
node_receipt -->|"loads transaction"| node_db
node_reports -->|"loads sales data"| node_catalogdata
node_reports -->|"requests export"| node_excel
node_reports -->|"requests export"| node_pdf
node_excel -->|"reads sales"| node_db
node_pdf -->|"reads sales"| node_db
node_thermal -.->|"prints receipt data"| node_db
node_settings -->|"saves settings"| node_editing
node_profile -->|"updates profile"| node_editing
node_profile -->|"loads profile"| node_db
node_cashier -->|"ends session"| node_logout
node_logout -->|"clears session"| node_session

click node_login "https://github.com/fauzan1892/pos-kasir-php/blob/master/login.php"
click node_router "https://github.com/fauzan1892/pos-kasir-php/blob/master/index.php"
click node_session "https://github.com/fauzan1892/pos-kasir-php/blob/master/fungsi/csrf.php"
click node_config "https://github.com/fauzan1892/pos-kasir-php/blob/master/config.php"
click node_dashboard "https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/template/home.php"
click node_products "https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/barang/index.php"
click node_productdetail "https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/barang/details/index.php"
click node_productedit "https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/barang/edit/index.php"
click node_categories "https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/kategori/index.php"
click node_catalogdata "https://github.com/fauzan1892/pos-kasir-php/blob/master/fungsi/view/view.php"
click node_mutations "https://github.com/fauzan1892/pos-kasir-php/blob/master/fungsi/tambah/tambah.php"
click node_editing "https://github.com/fauzan1892/pos-kasir-php/blob/master/fungsi/edit/edit.php"
click node_deletion "https://github.com/fauzan1892/pos-kasir-php/blob/master/fungsi/hapus/hapus.php"
click node_saleui "https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/jual/index.php"
click node_saleapi "https://github.com/fauzan1892/pos-kasir-php/blob/master/fungsi/kasir/kasir.php"
click node_reports "https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/laporan/index.php"
click node_excel "https://github.com/fauzan1892/pos-kasir-php/blob/master/excel.php"
click node_pdf "https://github.com/fauzan1892/pos-kasir-php/blob/master/pdf.php"
click node_receipt "https://github.com/fauzan1892/pos-kasir-php/blob/master/print.php"
click node_thermal "https://github.com/fauzan1892/pos-kasir-php/blob/master/print_thermal.php"
click node_settings "https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/pengaturan/index.php"
click node_profile "https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/user/index.php"
click node_logout "https://github.com/fauzan1892/pos-kasir-php/blob/master/logout.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_login,node_router,node_session,node_config,node_dashboard,node_logout toneBlue
class node_products,node_productdetail,node_productedit,node_categories,node_catalogdata,node_mutations,node_editing,node_deletion,node_db toneAmber
class node_saleui,node_saleapi,node_reports,node_excel,node_pdf,node_receipt,node_thermal toneMint
class node_settings,node_profile toneRose
class node_cashier toneIndigo
```

## Components

### Access and shell

- [Sign in](https://github.com/fauzan1892/pos-kasir-php/blob/master/login.php): `login.php`
- [Admin router](https://github.com/fauzan1892/pos-kasir-php/blob/master/index.php): `index.php`
- [Session and CSRF](https://github.com/fauzan1892/pos-kasir-php/blob/master/fungsi/csrf.php): `fungsi/csrf.php`
- [DB configuration](https://github.com/fauzan1892/pos-kasir-php/blob/master/config.php): `config.php`
- [Dashboard shell](https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/template/home.php): `admin/template/home.php`
- [Sign out](https://github.com/fauzan1892/pos-kasir-php/blob/master/logout.php): `logout.php`

### Retail catalog

- [Product management](https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/barang/index.php): `admin/module/barang/index.php`
- [Product details](https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/barang/details/index.php): `admin/module/barang/details/index.php`
- [Product editing](https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/barang/edit/index.php): `admin/module/barang/edit/index.php`
- [Category management](https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/kategori/index.php): `admin/module/kategori/index.php`
- [Catalog queries](https://github.com/fauzan1892/pos-kasir-php/blob/master/fungsi/view/view.php): `fungsi/view/view.php`
- [Data mutations](https://github.com/fauzan1892/pos-kasir-php/blob/master/fungsi/tambah/tambah.php): `fungsi/tambah/tambah.php`
- [Edit operations](https://github.com/fauzan1892/pos-kasir-php/blob/master/fungsi/edit/edit.php): `fungsi/edit/edit.php`
- [Delete operations](https://github.com/fauzan1892/pos-kasir-php/blob/master/fungsi/hapus/hapus.php): `fungsi/hapus/hapus.php`

### Sales and reports

- [Cashier screen](https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/jual/index.php): `admin/module/jual/index.php`
- [Cashier actions](https://github.com/fauzan1892/pos-kasir-php/blob/master/fungsi/kasir/kasir.php): `fungsi/kasir/kasir.php`
- [Sales reports](https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/laporan/index.php): `admin/module/laporan/index.php`
- [Excel export](https://github.com/fauzan1892/pos-kasir-php/blob/master/excel.php): `excel.php`
- [PDF export](https://github.com/fauzan1892/pos-kasir-php/blob/master/pdf.php): `pdf.php`
- [Receipt printing](https://github.com/fauzan1892/pos-kasir-php/blob/master/print.php): `print.php`
- [Thermal printing](https://github.com/fauzan1892/pos-kasir-php/blob/master/print_thermal.php): `print_thermal.php`

### Store administration

- [Store settings](https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/pengaturan/index.php): `admin/module/pengaturan/index.php`
- [User profile](https://github.com/fauzan1892/pos-kasir-php/blob/master/admin/module/user/index.php): `admin/module/user/index.php`

### Other components

- **Cashier**
- **POS database**

## Connections

- Cashier → Sign in: signs in
- Sign in → Session and CSRF: manages session
- Sign in → POS database: checks account
- Sign in → Admin router: redirects
- Admin router → Session and CSRF: checks session
- Admin router → DB configuration: loads config
- DB configuration → POS database: connects
- Admin router → Dashboard shell: renders shell
- Admin router → Product management: routes page
- Admin router → Product details: routes page
- Admin router → Product editing: routes page
- Admin router → Category management: routes page
- Admin router → Sales reports: routes page
- Admin router → Store settings: routes page
- Admin router → User profile: routes page
- Product management → POS database: queries inventory
- Product management → Catalog queries: loads catalog data
- Category management → Catalog queries: loads categories
- Catalog queries → POS database: queries
- Product management → Data mutations: adds records
- Category management → Data mutations: adds records
- Product management → Edit operations: updates stock
- Product editing → Edit operations: submits changes
- Category management → Edit operations: submits changes
- Product management → Delete operations: deletes records
- Category management → Delete operations: deletes records
- Data mutations → POS database: writes
- Edit operations → POS database: updates
- Delete operations → POS database: deletes
- Cashier → Cashier screen: runs checkout
- Cashier screen → Cashier actions: posts actions
- Cashier actions → POS database: reads and writes
- Cashier screen → Receipt printing: opens receipt
- Receipt printing → POS database: loads transaction
- Sales reports → Catalog queries: loads sales data
- Sales reports → Excel export: requests export
- Sales reports → PDF export: requests export
- Excel export → POS database: reads sales
- PDF export → POS database: reads sales
- Thermal printing → POS database: prints receipt data
- Store settings → Edit operations: saves settings
- User profile → Edit operations: updates profile
- User profile → POS database: loads profile
- Cashier → Sign out: ends session
- Sign out → Session and CSRF: clears session
