# orenji2/enchantedpos architecture

> Architecture diagram of the GitHub repository orenji2/enchantedpos, 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/orenji2/enchantedpos
- Repository: https://github.com/orenji2/enchantedpos

## Overview

EnchantedPOS is a Windows Forms retail POS and inventory application backed, according to the README, by networked MySQL. The principal workflow is cashier sign-in, shift setup, checkout and payment, with receipts and shift reporting; suspended-cart recovery and pricing tiers are checkout capabilities. Back-office branches maintain products, suppliers, users and customers, receive invoices, adjust stock, and produce reports. The excerpts show startup, navigation, database access, invoice stock updates and inventory adjustment transactions. Other feature-to-screen mappings are inferred from names and documentation, so those links are omitted or marked unverified.

Main entry points: [`EnchantedPOS/DatabaseConfig.cs`](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/DatabaseConfig.cs) (Connection factory), [`EnchantedPOS/Form1.cs`](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/Form1.cs) (Sign-in and launcher), [`EnchantedPOS/formPOS.cs`](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formPOS.cs) (POS checkout), [`EnchantedPOS/ucSuppplierInvoice.cs`](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/ucSuppplierInvoice.cs) (Supplier invoicing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shifts"]
  node_program["Application startup<br/>[Program.cs]"]
  node_launcher["Sign-in and launcher<br/>[Form1.cs]"]
  node_login["Shift setup<br/>[formPosLogin.cs]"]
end

subgraph group_checkout["Checkout"]
  node_pos["POS checkout<br/>[formPOS.cs]"]
  node_payment["Payment dialog"]
  node_productrecord["Product record<br/>[ProductRecord.cs]"]
end

subgraph group_inventory["Inventory operations"]
  node_dbconfig["Connection factory<br/>[DatabaseConfig.cs]"]
  node_mysql[("MySQL database")]
  node_productmaster["Product master<br/>[ucProductMaster.cs]"]
  node_invoice["Supplier invoicing"]
  node_adjustment["Stock adjustments"]
  node_inventorymode["Inventory mode"]
end

subgraph group_admin["Administration and reports"]
  node_maintenance["File maintenance"]
  node_adminforms["Admin screens"]
  node_reports["Reports menu<br/>[formReports.cs]"]
  node_cashierreport["Cashier sales report"]
  node_profitreport["Profitability report"]
end

node_cashier(("Cashier"))

node_program -->|"starts"| node_launcher
node_cashier -->|"signs in"| node_launcher
node_launcher -->|"opens"| node_login
node_launcher -->|"opens"| node_pos
node_launcher -->|"opens"| node_inventorymode
node_login -->|"configures shift"| node_pos
node_pos -.->|"opens payment"| node_payment
node_pos -->|"opens connection"| node_dbconfig
node_productmaster -->|"opens connection"| node_dbconfig
node_invoice -->|"opens connection"| node_dbconfig
node_invoice -->|"updates stock"| node_mysql
node_adjustment -->|"logs and updates"| node_mysql
node_inventorymode -->|"updates stock"| node_mysql
node_maintenance -->|"opens connection"| node_dbconfig
node_cashierreport -->|"opens connection"| node_dbconfig
node_profitreport -->|"opens connection"| node_dbconfig
node_payment -->|"opens connection"| node_dbconfig
node_pos -->|"uses records"| node_productrecord

click node_program "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/Program.cs"
click node_launcher "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/Form1.cs"
click node_login "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formPosLogin.cs"
click node_pos "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formPOS.cs"
click node_payment "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formSaveTransaction.cs"
click node_productrecord "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/ProductRecord.cs"
click node_dbconfig "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/DatabaseConfig.cs"
click node_productmaster "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/ucProductMaster.cs"
click node_invoice "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/ucSuppplierInvoice.cs"
click node_adjustment "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/ucInventoryAdjustment.cs"
click node_inventorymode "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formInventoryMode.cs"
click node_maintenance "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/ucFileMaintenance.cs"
click node_adminforms "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formAdminDashboard.cs"
click node_reports "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formReports.cs"
click node_cashierreport "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formCashierSalesReport.cs"
click node_profitreport "https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formProfitabilityReport.cs"

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_program,node_launcher,node_login toneBlue
class node_pos,node_payment,node_productrecord toneAmber
class node_dbconfig,node_mysql,node_productmaster,node_invoice,node_adjustment,node_inventorymode toneMint
class node_maintenance,node_adminforms,node_reports,node_cashierreport,node_profitreport toneRose
class node_cashier toneIndigo
```

## Components

### Access and shifts

- [Application startup](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/Program.cs): `EnchantedPOS/Program.cs`
- [Sign-in and launcher](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/Form1.cs): `EnchantedPOS/Form1.cs`
- [Shift setup](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formPosLogin.cs): `EnchantedPOS/formPosLogin.cs`

### Checkout

- [POS checkout](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formPOS.cs): `EnchantedPOS/formPOS.cs`
- [Payment dialog](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formSaveTransaction.cs): `EnchantedPOS/formSaveTransaction.cs`
- [Product record](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/ProductRecord.cs): `EnchantedPOS/ProductRecord.cs`

### Inventory operations

- [Connection factory](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/DatabaseConfig.cs): `EnchantedPOS/DatabaseConfig.cs`
- **MySQL database**
- [Product master](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/ucProductMaster.cs): `EnchantedPOS/ucProductMaster.cs`
- [Supplier invoicing](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/ucSuppplierInvoice.cs): `EnchantedPOS/ucSuppplierInvoice.cs`
- [Stock adjustments](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/ucInventoryAdjustment.cs): `EnchantedPOS/ucInventoryAdjustment.cs`
- [Inventory mode](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formInventoryMode.cs): `EnchantedPOS/formInventoryMode.cs`

### Administration and reports

- [File maintenance](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/ucFileMaintenance.cs): `EnchantedPOS/ucFileMaintenance.cs`
- [Admin screens](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formAdminDashboard.cs): `EnchantedPOS/formAdminDashboard.cs`
- [Reports menu](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formReports.cs): `EnchantedPOS/formReports.cs`
- [Cashier sales report](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formCashierSalesReport.cs): `EnchantedPOS/formCashierSalesReport.cs`
- [Profitability report](https://github.com/orenji2/enchantedpos/blob/master/EnchantedPOS/formProfitabilityReport.cs): `EnchantedPOS/formProfitabilityReport.cs`

### Other components

- **Cashier**

## Connections

- Application startup → Sign-in and launcher: starts (evidence: `EnchantedPOS/Program.cs`)
- Cashier → Sign-in and launcher: signs in
- Sign-in and launcher → Shift setup: opens (evidence: `EnchantedPOS/Form1.cs`)
- Sign-in and launcher → POS checkout: opens (evidence: `EnchantedPOS/Form1.cs`)
- Sign-in and launcher → Inventory mode: opens (evidence: `EnchantedPOS/Form1.cs`)
- Shift setup → POS checkout: configures shift
- POS checkout → Payment dialog: opens payment
- POS checkout → Connection factory: opens connection (evidence: `EnchantedPOS/formPOS.cs`)
- Product master → Connection factory: opens connection (evidence: `EnchantedPOS/ucProductMaster.cs`)
- Supplier invoicing → Connection factory: opens connection (evidence: `EnchantedPOS/ucSuppplierInvoice.cs`)
- Supplier invoicing → MySQL database: updates stock (evidence: `EnchantedPOS/ucSuppplierInvoice.cs`)
- Stock adjustments → MySQL database: logs and updates (evidence: `EnchantedPOS/ucInventoryAdjustment.cs`)
- Inventory mode → MySQL database: updates stock (evidence: `EnchantedPOS/formInventoryMode.cs`)
- File maintenance → Connection factory: opens connection (evidence: `EnchantedPOS/ucFileMaintenance.cs`)
- Cashier sales report → Connection factory: opens connection (evidence: `EnchantedPOS/formCashierSalesReport.cs`)
- Profitability report → Connection factory: opens connection (evidence: `EnchantedPOS/formProfitabilityReport.cs`)
- Payment dialog → Connection factory: opens connection (evidence: `EnchantedPOS/formSaveTransaction.cs`)
- POS checkout → Product record: uses records (evidence: `EnchantedPOS/formPOS.cs`)
