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