Pharma ERP V01 is a Django-powered ERP system designed for pharmacies, suppliers, and healthcare distributors. It combines inventory management, e-commerce workflows, and predictive analytics into a unified Modular Monolith architecture, following 12-Factor App principles for scalability and maintainability.
The project is structured for collaborative development and welcomes external contributions.
-
User & Role Management Authentication, user profiles, geolocation, and company/branch structures.
-
Catalog & Products Manufacturers, active ingredients, dosage forms, product variants, and detailed drug formulations.
-
Inventory Management Batch-level tracking, expiry monitoring (FEFO/FIFO), supplier relationships, and real-time stock movements.
-
E-commerce & Orders Shopping cart, checkout, order lifecycle, fulfillment, and delivery tracking.
-
AI-Powered Predictions Demand forecasting per branch & product variant.
-
Audit & Security System-wide logging of CRUD operations and sensitive changes.
The system is built as a Modular Monolith with 4 core Django applications:
| App | Responsibility | Key Models |
|---|---|---|
| users | Authentication, profiles, addresses | UserProfile, Address |
| catalog | Product dictionary, lookups, search | Product, ProductVariant, Manufacturer, ActiveIngredient |
| inventory | Stock management, pricing, AI data | Company, Branch, InventoryBatch, Prediction, InventoryMovement |
| orders | Cart, checkout, fulfillment, reviews | Cart, Order, Shipment, OrderItem, Review |
The database schema is normalized across 21 entities including:
- Users & Organizations: User, Profile, Company, Branch
- Catalog: Manufacturer, Product, Variant, Ingredients
- Inventory: Batches, Movements, Predictions
- Transactions: Orders, OrderItems, Cart, Shipment
- Audit & Feedback: AuditLog, Review
- Backend: Django 5.x (Python 3.12+)
- Database: PostgreSQL (recommended) / MySQL
- Containerization: Docker & Docker Compose
- Documentation: Swagger / drf-spectacular
- Testing: Pytest & Django Test Framework
- CI/CD: GitHub Actions (planned)
git clone https://github.com/<your-username>/pharma-erp-v2.git
cd pharma-erp-v2cp .env.example .envUpdate DB credentials, secret keys, and debug options.
docker-compose up --buildThe app will be available at http://localhost:8000/.
docker-compose exec web python manage.py migrate
docker-compose exec web python manage.py createsuperuser- Swagger/OpenAPI available at:
http://localhost:8000/api/schema/swagger-ui/
pharma-erp-v2/
│── users/ # User profiles, addresses
│── catalog/ # Product catalog, variants, lookups
│── inventory/ # Stock, branches, movements
│── orders/ # Cart, orders, shipping, reviews
│── core/ # Shared settings, utils
│── docs/ # API & ERD documentation
│── docker/ # Docker & deployment configs
│── manage.py
│── requirements.txt
│── docker-compose.yml
│── Dockerfile
- Codebase: Modular Monolith, single repo
- Dependencies: Managed via
pip+requirements.txt - Config:
.envenvironment variables - Backing Services: Database, Redis (future), Storage
- Build/Release/Run: Docker Compose workflows
- Processes: Stateless Django workers
- Logs: Standardized logging to stdout/stderr
- Concurrency: Gunicorn/ASGI workers for scaling
- Disposability: Quick startup/shutdown via Docker
- Dev/Prod Parity: Docker ensures reproducibility
We welcome external contributions!
-
Fork the repo
-
Create a branch:
git checkout -b feature/your-feature-name
-
Commit changes with clear messages
-
Push to your fork
-
Submit a Pull Request
- Follow PEP8 and Django best practices
- Ensure tests pass before submitting PR
- Use descriptive commit messages
- Enhanced ERD Blueprint (21 Models)
- Implement Users & Catalog Apps
- Inventory Management with FEFO
- Orders & Fulfillment APIs
- AI Forecasting Module
- CI/CD with GitHub Actions
- Deployment to Cloud (AWS/GCP)
This project is licensed under the ** Dev License** – feel free to use and extend with attribution.
- Inspired by real-world pharmacy workflows
- Designed for scalability and collaboration
- Built with 💙 by contributors around the world