# aesthetic99/swastik architecture

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

- Interactive diagram: https://gitdiagram.com/aesthetic99/swastik
- Repository: https://github.com/aesthetic99/swastik

## Overview

This is a role-based restaurant operations web application. Staff authenticate, then use role-specific screens to maintain menu, users, and tables; waiters create orders, chefs advance preparation status, and cashiers generate bills and record payments. Pages are server-rendered PHP backed by a shared MySQL connection, with JavaScript enhancements for order entry and administrative actions. The SQL schema and several named features are evident from the tree, but their implementation details were not sampled, so uncertain wiring is omitted.

Main entry points: [`dashboard.php`](https://github.com/aesthetic99/swastik/blob/main/dashboard.php) (Role dashboard), [`config.php`](https://github.com/aesthetic99/swastik/blob/main/config.php) (Database connection), [`app.js`](https://github.com/aesthetic99/swastik/blob/main/app.js) (UI enhancements), [`login.php`](https://github.com/aesthetic99/swastik/blob/main/login.php) (Authenticate)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Navigation"]
  node_login["Authenticate<br/>[login.php]"]
  node_dashboard["Role dashboard<br/>[dashboard.php]"]
  node_home["Home page<br/>[index.php]"]
  node_ui["UI enhancements<br/>[app.js]"]
end

subgraph group_service["Restaurant Operations"]
  node_order_entry["Take order<br/>[take_order.php]"]
  node_orders["View and update orders<br/>[view_orders.php]"]
  node_menu["Manage menu<br/>[manage_menu.php]"]
  node_tables["Manage tables<br/>[manage_tables.php]"]
  node_users["Manage users<br/>[manage_users.php]"]
  node_polling["Order polling<br/>[fetch_orders.php]"]
end

subgraph group_finance["Billing and Reporting"]
  node_bill["Generate bill<br/>[generate_bill.php]"]
  node_payments["Record payment<br/>[payments.php]"]
  node_sales["Sales report<br/>[sales_report.php]"]
end

subgraph group_data["Data Layer"]
  node_db_config["Database connection<br/>[config.php]"]
  node_database[("Restaurant database<br/>[restaurant_db.sql]")]
end

node_staff(("Restaurant staff"))

node_staff -->|"signs in"| node_login
node_login -->|"queries users"| node_db_config
node_login -->|"redirects"| node_dashboard
node_staff -->|"opens"| node_dashboard
node_dashboard -->|"waiter access"| node_order_entry
node_dashboard -->|"order access"| node_orders
node_dashboard -->|"admin access"| node_menu
node_dashboard -->|"admin access"| node_tables
node_dashboard -->|"admin access"| node_users
node_dashboard -->|"cashier access"| node_bill
node_dashboard -->|"cashier access"| node_payments
node_order_entry -->|"reads and writes"| node_db_config
node_orders -->|"reads and updates"| node_db_config
node_menu -->|"reads and writes"| node_db_config
node_tables -->|"reads and writes"| node_db_config
node_users -->|"reads and writes"| node_db_config
node_bill -->|"reads items"| node_db_config
node_payments -->|"records payment"| node_db_config
node_sales -->|"queries sales"| node_db_config
node_db_config -->|"connects"| node_database
node_order_entry -->|"uses enhancements"| node_ui
node_ui -->|"posts table actions"| node_tables
node_ui -->|"posts user actions"| node_users
node_ui -->|"posts menu actions"| node_menu
node_bill -->|"links to payment"| node_payments

click node_login "https://github.com/aesthetic99/swastik/blob/main/login.php"
click node_dashboard "https://github.com/aesthetic99/swastik/blob/main/dashboard.php"
click node_home "https://github.com/aesthetic99/swastik/blob/main/index.php"
click node_ui "https://github.com/aesthetic99/swastik/blob/main/app.js"
click node_order_entry "https://github.com/aesthetic99/swastik/blob/main/take_order.php"
click node_orders "https://github.com/aesthetic99/swastik/blob/main/view_orders.php"
click node_menu "https://github.com/aesthetic99/swastik/blob/main/manage_menu.php"
click node_tables "https://github.com/aesthetic99/swastik/blob/main/manage_tables.php"
click node_users "https://github.com/aesthetic99/swastik/blob/main/manage_users.php"
click node_polling "https://github.com/aesthetic99/swastik/blob/main/fetch_orders.php"
click node_bill "https://github.com/aesthetic99/swastik/blob/main/generate_bill.php"
click node_payments "https://github.com/aesthetic99/swastik/blob/main/payments.php"
click node_sales "https://github.com/aesthetic99/swastik/blob/main/sales_report.php"
click node_db_config "https://github.com/aesthetic99/swastik/blob/main/config.php"
click node_database "https://github.com/aesthetic99/swastik/blob/main/restaurant_db.sql"

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_dashboard,node_home,node_ui toneBlue
class node_order_entry,node_orders,node_menu,node_tables,node_users,node_polling toneAmber
class node_bill,node_payments,node_sales toneMint
class node_db_config,node_database toneRose
class node_staff toneIndigo
```

## Components

### Access and Navigation

- [Authenticate](https://github.com/aesthetic99/swastik/blob/main/login.php): `login.php`
- [Role dashboard](https://github.com/aesthetic99/swastik/blob/main/dashboard.php): `dashboard.php`
- [Home page](https://github.com/aesthetic99/swastik/blob/main/index.php): `index.php`
- [UI enhancements](https://github.com/aesthetic99/swastik/blob/main/app.js): `app.js`

### Restaurant Operations

- [Take order](https://github.com/aesthetic99/swastik/blob/main/take_order.php): `take_order.php`
- [View and update orders](https://github.com/aesthetic99/swastik/blob/main/view_orders.php): `view_orders.php`
- [Manage menu](https://github.com/aesthetic99/swastik/blob/main/manage_menu.php): `manage_menu.php`
- [Manage tables](https://github.com/aesthetic99/swastik/blob/main/manage_tables.php): `manage_tables.php`
- [Manage users](https://github.com/aesthetic99/swastik/blob/main/manage_users.php): `manage_users.php`
- [Order polling](https://github.com/aesthetic99/swastik/blob/main/fetch_orders.php): `fetch_orders.php`

### Billing and Reporting

- [Generate bill](https://github.com/aesthetic99/swastik/blob/main/generate_bill.php): `generate_bill.php`
- [Record payment](https://github.com/aesthetic99/swastik/blob/main/payments.php): `payments.php`
- [Sales report](https://github.com/aesthetic99/swastik/blob/main/sales_report.php): `sales_report.php`

### Data Layer

- [Database connection](https://github.com/aesthetic99/swastik/blob/main/config.php): `config.php`
- [Restaurant database](https://github.com/aesthetic99/swastik/blob/main/restaurant_db.sql): `restaurant_db.sql`

### Other components

- **Restaurant staff**

## Connections

- Restaurant staff → Authenticate: signs in
- Authenticate → Database connection: queries users
- Authenticate → Role dashboard: redirects
- Restaurant staff → Role dashboard: opens
- Role dashboard → Take order: waiter access
- Role dashboard → View and update orders: order access
- Role dashboard → Manage menu: admin access
- Role dashboard → Manage tables: admin access
- Role dashboard → Manage users: admin access
- Role dashboard → Generate bill: cashier access
- Role dashboard → Record payment: cashier access
- Take order → Database connection: reads and writes
- View and update orders → Database connection: reads and updates
- Manage menu → Database connection: reads and writes
- Manage tables → Database connection: reads and writes
- Manage users → Database connection: reads and writes
- Generate bill → Database connection: reads items
- Record payment → Database connection: records payment
- Sales report → Database connection: queries sales
- Database connection → Restaurant database: connects
- Take order → UI enhancements: uses enhancements
- UI enhancements → Manage tables: posts table actions
- UI enhancements → Manage users: posts user actions
- UI enhancements → Manage menu: posts menu actions
- Generate bill → Record payment: links to payment
