# specialgroup2024/sg_wap architecture

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

- Interactive diagram: https://gitdiagram.com/specialgroup2024/sg_wap
- Repository: https://github.com/specialgroup2024/sg_wap

## Overview

SG_WAP is an early-stage, multi-sector enterprise platform. The README says it is still at the M00 foundation milestone, with no business features yet, so there is no established user-to-business-result workflow to map. The visible runtime consists of a Django backend, a Next.js frontend, and a placeholder device gateway; the backend also contains sector-named model modules. The separate `mam/` archive is reference material, not part of the product map. Relationships below follow README statements; detailed runtime wiring was not established by the sampled source.

Main entry points: [`backend/config/urls.py`](https://github.com/specialgroup2024/sg_wap/blob/main/backend/config/urls.py) (Django Backend), [`frontend/src/app/page.tsx`](https://github.com/specialgroup2024/sg_wap/blob/main/frontend/src/app/page.tsx) (Next.js App)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Application"]
  node_frontend["Next.js App<br/>[page.tsx]"]
  node_backend["Django Backend<br/>[urls.py]"]
  node_core["Core App<br/>[views.py]"]
end

subgraph group_domain["Domain Models"]
  node_accounting["Accounting Models<br/>[models.py]"]
  node_catalog["Catalog Models<br/>[models.py]"]
  node_inventory["Inventory Models<br/>[models.py]"]
  node_pharmacy["Pharmacy Models<br/>[models.py]"]
  node_pricing["Pricing Models<br/>[models.py]"]
  node_purchasing["Purchasing Models<br/>[models.py]"]
  node_sales["Sales Models<br/>[models.py]"]
end

subgraph group_edge["Device Gateway"]
  node_gateway["Device Gateway<br/>[mqtt_listener.py]"]
end

node_operator(("Platform User"))
node_postgres[("PostgreSQL")]
node_redis[("Redis")]
node_celery["Celery"]

node_operator -.->|"uses"| node_frontend
node_backend -.->|"uses"| node_postgres
node_backend -.->|"uses"| node_redis
node_backend -.->|"uses"| node_celery

click node_frontend "https://github.com/specialgroup2024/sg_wap/blob/main/frontend/src/app/page.tsx"
click node_backend "https://github.com/specialgroup2024/sg_wap/blob/main/backend/config/urls.py"
click node_core "https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/core/views.py"
click node_accounting "https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/accounting/models.py"
click node_catalog "https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/catalog/models.py"
click node_inventory "https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/inventory/models.py"
click node_pharmacy "https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/pharmacy/models.py"
click node_pricing "https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/pricing/models.py"
click node_purchasing "https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/purchasing/models.py"
click node_sales "https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/sales/models.py"
click node_gateway "https://github.com/specialgroup2024/sg_wap/blob/main/device-gateway/app/mqtt_listener.py"

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_frontend,node_backend,node_core,node_operator toneBlue
class node_accounting,node_catalog,node_inventory,node_pharmacy,node_pricing,node_purchasing,node_sales,node_postgres,node_redis toneAmber
class node_gateway toneMint
class node_celery toneIndigo
```

## Components

### Web Application

- [Next.js App](https://github.com/specialgroup2024/sg_wap/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Django Backend](https://github.com/specialgroup2024/sg_wap/blob/main/backend/config/urls.py): `backend/config/urls.py`
- [Core App](https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/core/views.py): `backend/apps/core/views.py`

### Domain Models

- [Accounting Models](https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/accounting/models.py): `backend/apps/accounting/models.py`
- [Catalog Models](https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/catalog/models.py): `backend/apps/catalog/models.py`
- [Inventory Models](https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/inventory/models.py): `backend/apps/inventory/models.py`
- [Pharmacy Models](https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/pharmacy/models.py): `backend/apps/pharmacy/models.py`
- [Pricing Models](https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/pricing/models.py): `backend/apps/pricing/models.py`
- [Purchasing Models](https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/purchasing/models.py): `backend/apps/purchasing/models.py`
- [Sales Models](https://github.com/specialgroup2024/sg_wap/blob/main/backend/apps/sales/models.py): `backend/apps/sales/models.py`

### Device Gateway

- [Device Gateway](https://github.com/specialgroup2024/sg_wap/blob/main/device-gateway/app/mqtt_listener.py): `device-gateway/app/mqtt_listener.py`

### Other components

- **Platform User**
- **PostgreSQL**
- **Redis**
- **Celery**

## Connections

- Platform User → Next.js App: uses (evidence: `README.md`)
- Django Backend → PostgreSQL: uses (evidence: `README.md`)
- Django Backend → Redis: uses (evidence: `README.md`)
- Django Backend → Celery: uses (evidence: `README.md`)
