A Django-based Enterprise Resource Planning (ERP) system for managing products, customers, sales orders, and inventory tracking.
Developer: Abdelrahman Adel
GitHub: github.com/ABDO-ADELL
- Product Management - Create, view, update, and delete products with stock tracking
- Customer Management - Maintain customer database with contact information
- Sales Orders - Process orders with automatic stock reduction
- Inventory Tracking - Comprehensive stock movement logging
- Dashboard - Real-time metrics and low stock alerts
- Role-Based Access Control - Admin and Sales User roles with different permissions
- Excel Export - Export orders to Excel spreadsheets
- Stock Movement Audit Trail - Track every inventory change
- Responsive UI - Bootstrap 5 interface that works on all devices
- Search & Filters - Find records quickly across all modules
- Backend: Django 5.0
- Database: SQLite
- Frontend: Bootstrap 5.3, HTML5, CSS3
- Additional: Django REST Framework, Pillow (image handling), openpyxl (Excel export)
- Python 3.10 or higher
- pip (Python package manager)
- Virtual environment (recommended)
-
Clone the repository
git clone https://github.com/ABDO-ADELL/mini-erp-system.git cd mini-erp-system -
Create and activate virtual environment
# Windows python -m venv venv venv\Scripts\activate # Mac/Linux python3 -m venv venv source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Run migrations
python manage.py migrate
-
Setup initial data and user accounts
python manage.py setup_erp
-
Start the development server
python manage.py runserver
-
Access the application
- Open your browser and go to:
http://127.0.0.1:8000
- Open your browser and go to:
After running setup_erp, use these credentials to login:
| Role | Username | Password | Permissions |
|---|---|---|---|
| Admin | admin | admin123 | Full system access |
| Sales User | sales | sales123 | Create orders & customers, view products |
- ✅ Full CRUD access to all modules
- ✅ Manage products (create, edit, delete)
- ✅ Edit customer information
- ✅ View stock movement logs
- ✅ Access admin panel
- ✅ Create sales orders
- ✅ Add new customers (cannot edit after creation)
- ✅ View products (read-only)
- ❌ Cannot modify product inventory
- ❌ Cannot edit customers
- ❌ Cannot access admin panel
mini_erp/
├── core/ # Authentication & user management
├── products/ # Product catalog & inventory
├── customers/ # Customer database
├── orders/ # Sales order processing
├── inventory/ # Stock movement tracking
├── dashboard/ # Dashboard & metrics
├── templates/ # HTML templates
├── static/ # CSS, JS, images
├── media/ # Uploaded files (product images)
├── manage.py # Django management script
└── requirements.txt # Python dependencies
- Create Order - Sales user selects customer and products
- Validation - System checks stock availability
- Confirmation - Admin confirms order
- Stock quantities automatically reduced
- Stock movement record created
- Cancellation - If needed, order can be cancelled
- Stock automatically returned
- Return movement logged
- Every stock change is logged with:
- Product details
- Quantity changed
- Movement type (sale, return, adjustment)
- User who performed action
- Timestamp
- Related order (if applicable)
The setup_erp command creates sample data:
- 5 Products - Electronics and furniture items
- 3 Customers - Demo business accounts
- User Groups - Admin and Sales User with proper permissions
- Login as
sales / sales123 - Navigate to Orders → Create New Order
- Select customer and add products
- Submit order (status: Pending)
- Verify stock validation works
- Login as
admin / admin123 - View the pending order
- Click "Confirm Order"
- Verify stock quantity decreased
- Check Stock Movements for audit trail
- Login as admin
- Go to Orders list
- Click "Export Excel" button
- Verify Excel file downloads with order data
- Login as
sales / sales123 - Try to edit a customer → Should see error message
- Try to edit a product → Should not see edit option
- Try to access stock movements → Should be blocked
Important: Before deploying to production:
-
Update settings.py:
DEBUG = False SECRET_KEY = os.environ.get('SECRET_KEY') ALLOWED_HOSTS = ['yourdomain.com']
-
Configure static files:
python manage.py collectstatic
-
Use a production database (PostgreSQL recommended)
-
Remove test credentials from templates
-
Set up proper logging
Solution:
pip install openpyxl==3.1.2Solution:
python manage.py migrate --run-syncdbSolution:
python manage.py collectstatic --noinputSolution:
# Reset database and permissions
rm db.sqlite3
python manage.py migrate
python manage.py setup_erp| Endpoint | Method | Description |
|---|---|---|
/admin/ |
GET | Django admin panel |
/ |
GET | Dashboard home |
/products/ |
GET | Product list |
/customers/ |
GET | Customer list |
/orders/ |
GET | Orders list |
/orders/create/ |
POST | Create new order |
/orders/export-excel/ |
GET | Export orders to Excel |
/inventory/movements/ |
GET | Stock movement log |
- This is a learning project with basic security measures
- Default credentials are for development only
- Change all passwords before production use
- Keep
SECRET_KEYin environment variables - Use HTTPS in production
- Implement rate limiting for production APIs
This is a learning project, but suggestions and feedback are welcome!
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Abdelrahman Adel
GitHub: @ABDO-ADELL
- Built with Django framework
- UI components from Bootstrap 5
- Icons from Bootstrap Icons
Last Updated: December 2025
Version: 1.0.0