How munuhee/sales-and-inventory-management works
Project Type and Purpose
• This is a monolithic, full-stack Django web application (“Django-inventory-management”) for handling user accounts, inventory, billing, invoicing, and transactions.
• It uses Bootstrap for UI, Ajax for dynamic operations, Django ORM for persistence, and Docker for deployment.
File Structure
• Top-level:
• Dockerfile / .dockerignore → containerization
• .github/workflows/django.yml → CI/CD pipeline
• manage.py, InventoryMS/ → core Django project (settings, URLs, ASGI/WSGI)
• requirements.txt → Python dependencies
• static/ → CSS, JS, images (served as static assets)
• Django apps (each containing models, views, templates, URLs, tests):
• accounts (authentication, profiles, staff/vendor/customer)
• store (categories, products, dashboard, deliveries, charts)
• transactions (sales, purchases, signals for inventory adjustment)
• bills (billing logic)
• invoice (invoice generation)
• Database migrations live under each app’s migrations/.
README Insights
• Describes domain entities: users, vendors, customers, inventory, transactions, billing, invoicing.
• Mentions Bootstrap, Ajax, Docker support, and Python 3.12.
• No external microservices noted, so everything is handled within one container.
Main Components & Their Relationships
a. Presentation Layer
• Web Browser / Client
• Static Assets (CSS, JS, images)—served by Django’s staticfiles or via CDN in production
• Ajax calls (front-end JS → Django REST or regular views returning JSON)
b. Application Layer
• Django ASGI/WSGI Server (e.g., Gunicorn/Uvicorn inside Docker)
• URL Router (InventoryMS/urls.py directs traffic to each app)
• Django Apps:
• accounts
• store
• transactions
• bills
• invoice
• Templates & Forms rendering HTML or returning JSON
• Signals (inventory updates on transaction save/delete)
c. Data Layer
• Django ORM Models (one set per app)
• Relational Database (e.g., PostgreSQL or SQLite)—migrations tracked under each app
d. Infrastructure & DevOps
• Docker container running Python + Django + Gunicorn
• .github/workflows/django.yml for CI: lint, test, build image
• Optional: Nginx reverse proxy + static file serving (add on production)
Architectural Patterns & Design Principles
• Layered architecture (Presentation → Application → Data)
• Separation of Concerns via Django apps (accounts vs. store vs. transactions vs. billing vs. invoicing)
• Event-driven updates via Django signals in transactions/signals.py and accounts/signals.py
• MVC-ish pattern:
• Models → business data
• Views → controllers (with forms, filters, tables)
• Templates → views