# bishal-somare/sales2 architecture

> Architecture diagram of the GitHub repository bishal-somare/sales2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bishal-somare/sales2
- Repository: https://github.com/bishal-somare/sales2

## Overview

##### Project type and purpose
- This is a Django-based full-stack Inventory Management System (InventoryMS).
- Purpose: track products, manage vendors and customers, handle sales and purchases, generate bills and invoices, and provide user/account management.

##### File structure
- Top-level Django project folder: InventoryMS/ (contains settings.py, urls.py, wsgi.py, asgi.py, middleware.py).
- Five reusable Django apps under the project root:
- accounts – user registration, login, profiles, staff/vendor/customer management
- store – product/catalog management, categories, deliveries, dashboard
- transactions – sales and purchase transaction recording, signals for business rules
- bills – billing logic and bill templates
- invoice – invoicing logic and invoice templates
- Static assets: CSS, JS, images under static/.
- SQLite database: db.sqlite3.
- Shell script for setup: bin/setup.sh.
- manage.py at root to drive Django commands.

##### README
- README is empty so infer architecture purely from structure: conventional Django MVC (MTV) pattern, WSGI/ASGI entry points, SQLite as datastore, server-side templates.

## Diagram (Mermaid)

```mermaid
flowchart TB
    Client["Client Browser/Mobile"]:::client
    NGINX["Web Server (Nginx)"]:::infra
    GW["WSGI/ASGI (Gunicorn/Daphne)"]:::compute

    subgraph "Django Core"
        direction TB
        Settings["settings.py"]:::core
        URLs["urls.py"]:::core
        Middleware["middleware.py"]:::core
        WSGI["wsgi.py"]:::core
        ASGI["asgi.py"]:::core
    end

    subgraph "Django Apps"
        direction TB
        subgraph "Accounts App"
            direction TB
            AccModels["models.py"]:::app
            AccViews["views.py"]:::app
            AccForms["forms.py"]:::app
            AccFilters["filters.py"]:::app
            AccSignals["signals.py"]:::app
            AccURLs["urls.py"]:::app
            AccTemplates["templates/accounts/"]:::templates
        end
        subgraph "Store App"
            direction TB
            StoreModels["models.py"]:::app
            StoreViews["views.py"]:::app
            StoreForms["forms.py"]:::app
            StoreFilters["filters.py"]:::app
            StoreURLs["urls.py"]:::app
            StoreTemplates["templates/store/"]:::templates
        end
        subgraph "Transactions App"
            direction TB
            TransModels["models.py"]:::app
            TransViews["views.py"]:::app
            TransForms["forms.py"]:::app
            TransFilters["filters.py"]:::app
            TransSignals["signals.py"]:::app
            TransURLs["urls.py"]:::app
            TransTemplates["templates/transactions/"]:::templates
        end
        subgraph "Bills App"
            direction TB
            BillsModels["models.py"]:::app
            BillsViews["views.py"]:::app
            BillsTables["tables.py"]:::app
            BillsURLs["urls.py"]:::app
            BillsTemplates["templates/bills/"]:::templates
        end
        subgraph "Invoice App"
            direction TB
            InvModels["models.py"]:::app
            InvViews["views.py"]:::app
            InvTables["tables.py"]:::app
            InvURLs["urls.py"]:::app
            InvTemplates["templates/invoice/"]:::templates
        end
    end

    DB["SQLite Database (db.sqlite3)"]:::db
    Static["Static Assets"]:::static
    Setup["Setup Script (bin/setup.sh)"]:::infra
    Manage["manage.py"]:::infra

    Client -->|HTTP/HTTPS| NGINX
    NGINX -->|proxy| GW
    GW -->|dispatch| URLs

    URLs -->|routes to| AccViews
    URLs -->|routes to| StoreViews
    URLs -->|routes to| TransViews
    URLs -->|routes to| BillsViews
    URLs -->|routes to| InvViews

    AccViews -->|uses| AccModels
    AccViews -->|renders| AccTemplates
    AccModels -->|ORM| DB

    StoreViews -->|uses| StoreModels
    StoreViews -->|renders| StoreTemplates
    StoreModels -->|ORM| DB

    TransViews -->|uses| TransModels
    TransViews -->|renders| TransTemplates
    TransModels -->|ORM| DB
    TransSignals -.->|updates| StoreModels

    BillsViews -->|uses| BillsModels
    BillsViews -->|renders| BillsTemplates
    BillsModels -->|ORM| DB

    InvViews -->|uses| InvModels
    InvViews -->|renders| InvTemplates
    InvModels -->|ORM| DB

    NGINX -->|serves| Static
    Client -->|requests| Static

    Manage -->|runs| GW
    Setup -->|provisions| Manage

    click Settings "https://github.com/bishal-somare/sales2/blob/main/InventoryMS/settings.py"
    click URLs "https://github.com/bishal-somare/sales2/blob/main/InventoryMS/urls.py"
    click Middleware "https://github.com/bishal-somare/sales2/blob/main/InventoryMS/middleware.py"
    click WSGI "https://github.com/bishal-somare/sales2/blob/main/InventoryMS/wsgi.py"
    click ASGI "https://github.com/bishal-somare/sales2/blob/main/InventoryMS/asgi.py"

    click AccModels "https://github.com/bishal-somare/sales2/blob/main/accounts/models.py"
    click AccViews "https://github.com/bishal-somare/sales2/blob/main/accounts/views.py"
    click AccForms "https://github.com/bishal-somare/sales2/blob/main/accounts/forms.py"
    click AccFilters "https://github.com/bishal-somare/sales2/blob/main/accounts/filters.py"
    click AccSignals "https://github.com/bishal-somare/sales2/blob/main/accounts/signals.py"
    click AccURLs "https://github.com/bishal-somare/sales2/blob/main/accounts/urls.py"
    click AccTemplates "https://github.com/bishal-somare/sales2/tree/main/accounts/templates/accounts/"

    click StoreModels "https://github.com/bishal-somare/sales2/blob/main/store/models.py"
    click StoreViews "https://github.com/bishal-somare/sales2/blob/main/store/views.py"
    click StoreForms "https://github.com/bishal-somare/sales2/blob/main/store/forms.py"
    click StoreFilters "https://github.com/bishal-somare/sales2/blob/main/store/filters.py"
    click StoreURLs "https://github.com/bishal-somare/sales2/blob/main/store/urls.py"
    click StoreTemplates "https://github.com/bishal-somare/sales2/tree/main/store/templates/store/"

    click TransModels "https://github.com/bishal-somare/sales2/blob/main/transactions/models.py"
    click TransViews "https://github.com/bishal-somare/sales2/blob/main/transactions/views.py"
    click TransForms "https://github.com/bishal-somare/sales2/blob/main/transactions/forms.py"
    click TransFilters "https://github.com/bishal-somare/sales2/blob/main/transactions/filters.py"
    click TransSignals "https://github.com/bishal-somare/sales2/blob/main/transactions/signals.py"
    click TransURLs "https://github.com/bishal-somare/sales2/blob/main/transactions/urls.py"
    click TransTemplates "https://github.com/bishal-somare/sales2/tree/main/transactions/templates/transactions/"

    click BillsModels "https://github.com/bishal-somare/sales2/blob/main/bills/models.py"
    click BillsViews "https://github.com/bishal-somare/sales2/blob/main/bills/views.py"
    click BillsTables "https://github.com/bishal-somare/sales2/blob/main/bills/tables.py"
    click BillsURLs "https://github.com/bishal-somare/sales2/blob/main/bills/urls.py"
    click BillsTemplates "https://github.com/bishal-somare/sales2/tree/main/bills/templates/bills/"

    click InvModels "https://github.com/bishal-somare/sales2/blob/main/invoice/models.py"
    click InvViews "https://github.com/bishal-somare/sales2/blob/main/invoice/views.py"
    click InvTables "https://github.com/bishal-somare/sales2/blob/main/invoice/tables.py"
    click InvURLs "https://github.com/bishal-somare/sales2/blob/main/invoice/urls.py"
    click InvTemplates "https://github.com/bishal-somare/sales2/tree/main/invoice/templates/invoice/"

    click Static "https://github.com/bishal-somare/sales2/tree/main/static"
    click DB "https://github.com/bishal-somare/sales2/blob/main/db.sqlite3"
    click Setup "https://github.com/bishal-somare/sales2/blob/main/bin/setup.sh"
    click Manage "https://github.com/bishal-somare/sales2/blob/main/manage.py"

    classDef client fill:#AEDFF7,stroke:#036
    classDef infra fill:#E2E3E5,stroke:#333
    classDef compute fill:#FDEBD0,stroke:#F39C12
    classDef core fill:#D6EAF8,stroke:#2E86C1
    classDef app fill:#D5F5E3,stroke:#27AE60
    classDef templates fill:#FCF3CF,stroke:#F1C40F
    classDef db fill:#FADBD8,stroke:#C0392B
    classDef static fill:#F4ECF7,stroke:#8E44AD
```
