# tharumalx97/grocery_store architecture

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

- Interactive diagram: https://gitdiagram.com/tharumalx97/grocery_store
- Repository: https://github.com/tharumalx97/grocery_store

## Overview

This is a Windows grocery-store point-of-sale and back-office application. The principal workflow is staff login, opening the POS, recording a sale and persisting it; the back office provides product, category, customer, employee, and expense management. The tree also indicates inventory, attendance, payroll, returns, barcode printing, and messaging capabilities. Evidence is limited to the supplied excerpts and source index; links to unsampled features are omitted rather than inferred.

Main entry points: [`BackOffice.cs`](https://github.com/tharumalx97/grocery_store/blob/main/BackOffice.cs) (Back-office dashboard), [`frmPOS.cs`](https://github.com/tharumalx97/grocery_store/blob/main/frmPOS.cs) (Point of sale), [`Login.cs`](https://github.com/tharumalx97/grocery_store/blob/main/Login.cs) (User login), [`Program.cs`](https://github.com/tharumalx97/grocery_store/blob/main/Program.cs) (Application startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Startup and access"]
  node_program["Application startup<br/>[Program.cs]"]
  node_activation["License activation<br/>[ActivationForm.cs]"]
  node_license["License settings<br/>[LicenseSettings.cs]"]
  node_login["User login<br/>[Login.cs]"]
  node_session["Session tracking<br/>[SessionManager.cs]"]
  node_duration["Duration formatting<br/>[SessionDuration.cs]"]
end

subgraph group_sales["Point of sale"]
  node_pos["Point of sale<br/>[frmPOS.cs]"]
  node_sale["Sale and receipt<br/>[Sale.cs]"]
  node_returns["Item returns<br/>[ReturnItems.cs]"]
end

subgraph group_operations["Store operations"]
  node_backoffice["Back-office dashboard<br/>[BackOffice.cs]"]
  node_products["Product management<br/>[Products.cs]"]
  node_categories["Category management<br/>[Categories.cs]"]
  node_customers["Customer management<br/>[Customers.cs]"]
  node_stock["Stock management<br/>[AddStock.cs]"]
end

subgraph group_people["Staff and finance"]
  node_employees["Employee management<br/>[Employees.cs]"]
  node_attendance["Attendance processing"]
  node_payroll["Salary processing"]
  node_expenses["Expense management<br/>[Expenses.cs]"]
end

subgraph group_tools["Store utilities"]
  node_barcode["Barcode printing"]
  node_sms["SMS messaging<br/>[frmSendSMS.cs]"]
end

node_staff(("Store staff"))
node_database[("MySQL database")]

node_staff -->|"starts app"| node_program
node_program -->|"requests activation"| node_activation
node_program -->|"verifies license"| node_license
node_program -->|"shows login"| node_login
node_login -->|"starts session"| node_session
node_login -->|"opens POS"| node_pos
node_session -->|"formats duration"| node_duration
node_pos -->|"references"| node_categories
node_pos -->|"records sale"| node_sale
node_pos -->|"uses identity"| node_login
node_pos -->|"uses session"| node_session
node_pos -->|"writes sale"| node_database
node_backoffice -->|"opens module"| node_products
node_backoffice -->|"opens module"| node_categories
node_backoffice -->|"opens module"| node_employees
node_backoffice -->|"opens module"| node_expenses
node_backoffice -->|"opens module"| node_customers
node_products -->|"reads categories"| node_categories
node_products -->|"reads and writes"| node_database
node_categories -->|"reads and writes"| node_database
node_customers -->|"reads and writes"| node_database
node_sale -->|"reads sale data"| node_database
node_expenses -->|"reads expenses"| node_database
node_login -->|"checks credentials"| node_database
node_session -->|"stores sessions"| node_database
node_backoffice -->|"reads dashboard data"| node_database

click node_program "https://github.com/tharumalx97/grocery_store/blob/main/Program.cs"
click node_activation "https://github.com/tharumalx97/grocery_store/blob/main/ActivationForm.cs"
click node_license "https://github.com/tharumalx97/grocery_store/blob/main/LicenseSettings.cs"
click node_login "https://github.com/tharumalx97/grocery_store/blob/main/Login.cs"
click node_session "https://github.com/tharumalx97/grocery_store/blob/main/SessionManager.cs"
click node_duration "https://github.com/tharumalx97/grocery_store/blob/main/SessionDuration.cs"
click node_backoffice "https://github.com/tharumalx97/grocery_store/blob/main/BackOffice.cs"
click node_pos "https://github.com/tharumalx97/grocery_store/blob/main/frmPOS.cs"
click node_sale "https://github.com/tharumalx97/grocery_store/blob/main/Sale.cs"
click node_products "https://github.com/tharumalx97/grocery_store/blob/main/Products.cs"
click node_categories "https://github.com/tharumalx97/grocery_store/blob/main/Categories.cs"
click node_customers "https://github.com/tharumalx97/grocery_store/blob/main/Customers.cs"
click node_returns "https://github.com/tharumalx97/grocery_store/blob/main/ReturnItems.cs"
click node_stock "https://github.com/tharumalx97/grocery_store/blob/main/AddStock.cs"
click node_employees "https://github.com/tharumalx97/grocery_store/blob/main/Employees.cs"
click node_attendance "https://github.com/tharumalx97/grocery_store/blob/main/ProcessAttendance.cs"
click node_payroll "https://github.com/tharumalx97/grocery_store/blob/main/frmProcessSalary.cs"
click node_expenses "https://github.com/tharumalx97/grocery_store/blob/main/Expenses.cs"
click node_barcode "https://github.com/tharumalx97/grocery_store/blob/main/PrintBarcodeLabels.cs"
click node_sms "https://github.com/tharumalx97/grocery_store/blob/main/frmSendSMS.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_activation,node_license,node_login,node_session,node_duration toneBlue
class node_pos,node_sale,node_returns,node_database toneAmber
class node_backoffice,node_products,node_categories,node_customers,node_stock toneMint
class node_employees,node_attendance,node_payroll,node_expenses toneRose
class node_barcode,node_sms,node_staff toneIndigo
```

## Components

### Startup and access

- [Application startup](https://github.com/tharumalx97/grocery_store/blob/main/Program.cs): `Program.cs`
- [License activation](https://github.com/tharumalx97/grocery_store/blob/main/ActivationForm.cs): `ActivationForm.cs`
- [License settings](https://github.com/tharumalx97/grocery_store/blob/main/LicenseSettings.cs): `LicenseSettings.cs`
- [User login](https://github.com/tharumalx97/grocery_store/blob/main/Login.cs): `Login.cs`
- [Session tracking](https://github.com/tharumalx97/grocery_store/blob/main/SessionManager.cs): `SessionManager.cs`
- [Duration formatting](https://github.com/tharumalx97/grocery_store/blob/main/SessionDuration.cs): `SessionDuration.cs`

### Point of sale

- [Point of sale](https://github.com/tharumalx97/grocery_store/blob/main/frmPOS.cs): `frmPOS.cs`
- [Sale and receipt](https://github.com/tharumalx97/grocery_store/blob/main/Sale.cs): `Sale.cs`
- [Item returns](https://github.com/tharumalx97/grocery_store/blob/main/ReturnItems.cs): `ReturnItems.cs`

### Store operations

- [Back-office dashboard](https://github.com/tharumalx97/grocery_store/blob/main/BackOffice.cs): `BackOffice.cs`
- [Product management](https://github.com/tharumalx97/grocery_store/blob/main/Products.cs): `Products.cs`
- [Category management](https://github.com/tharumalx97/grocery_store/blob/main/Categories.cs): `Categories.cs`
- [Customer management](https://github.com/tharumalx97/grocery_store/blob/main/Customers.cs): `Customers.cs`
- [Stock management](https://github.com/tharumalx97/grocery_store/blob/main/AddStock.cs): `AddStock.cs`

### Staff and finance

- [Employee management](https://github.com/tharumalx97/grocery_store/blob/main/Employees.cs): `Employees.cs`
- [Attendance processing](https://github.com/tharumalx97/grocery_store/blob/main/ProcessAttendance.cs): `ProcessAttendance.cs`
- [Salary processing](https://github.com/tharumalx97/grocery_store/blob/main/frmProcessSalary.cs): `frmProcessSalary.cs`
- [Expense management](https://github.com/tharumalx97/grocery_store/blob/main/Expenses.cs): `Expenses.cs`

### Store utilities

- [Barcode printing](https://github.com/tharumalx97/grocery_store/blob/main/PrintBarcodeLabels.cs): `PrintBarcodeLabels.cs`
- [SMS messaging](https://github.com/tharumalx97/grocery_store/blob/main/frmSendSMS.cs): `frmSendSMS.cs`

### Other components

- **Store staff**
- **MySQL database**

## Connections

- Store staff → Application startup: starts app (evidence: `Program.cs`)
- Application startup → License activation: requests activation (evidence: `Program.cs`)
- Application startup → License settings: verifies license (evidence: `Program.cs`)
- Application startup → User login: shows login (evidence: `Program.cs`)
- User login → Session tracking: starts session (evidence: `Login.cs`)
- User login → Point of sale: opens POS (evidence: `Login.cs`)
- Session tracking → Duration formatting: formats duration (evidence: `SessionManager.cs`)
- Point of sale → Category management: references (evidence: `frmPOS.cs`)
- Point of sale → Sale and receipt: records sale (evidence: `frmPOS.cs`)
- Point of sale → User login: uses identity (evidence: `frmPOS.cs`)
- Point of sale → Session tracking: uses session (evidence: `frmPOS.cs`)
- Point of sale → MySQL database: writes sale (evidence: `frmPOS.cs`)
- Back-office dashboard → Product management: opens module (evidence: `BackOffice.cs`)
- Back-office dashboard → Category management: opens module (evidence: `BackOffice.cs`)
- Back-office dashboard → Employee management: opens module (evidence: `BackOffice.cs`)
- Back-office dashboard → Expense management: opens module (evidence: `BackOffice.cs`)
- Back-office dashboard → Customer management: opens module (evidence: `BackOffice.cs`)
- Product management → Category management: reads categories (evidence: `Products.cs`)
- Product management → MySQL database: reads and writes (evidence: `Products.cs`)
- Category management → MySQL database: reads and writes (evidence: `Categories.cs`)
- Customer management → MySQL database: reads and writes (evidence: `Customers.cs`)
- Sale and receipt → MySQL database: reads sale data (evidence: `Sale.cs`)
- Expense management → MySQL database: reads expenses (evidence: `Expenses.cs`)
- User login → MySQL database: checks credentials (evidence: `Login.cs`)
- Session tracking → MySQL database: stores sessions (evidence: `SessionManager.cs`)
- Back-office dashboard → MySQL database: reads dashboard data (evidence: `BackOffice.cs`)
