This project is an Inventory Management System built using Django to efficiently manage products, stock levels, suppliers, and sales. The system supports CRUD operations for products and suppliers, facilitates stock management, and enables tracking of sales orders. A user-friendly interface enhances the functionality.
-
Product Management
- Add, update, delete, and list products.
- Validate product details, including stock quantity and price.
- Ensure no duplicate products exist.
-
Supplier Management
- Add, update, delete, and list suppliers.
- Validate email and phone number formats.
- Ensure no duplicate supplier records exist.
-
Stock Movement
- Record incoming stock ("In") or outgoing stock ("Out").
- Automatically update stock levels.
- Prevent negative stock levels.
-
Sale Order Management
- Create sale orders with stock verification and total price calculation.
- Cancel sale orders and revert stock levels.
- Mark orders as "Completed" and update stock accordingly.
- List all sale orders with details such as product name, quantity, total price, sale date, and status.
-
Stock Level Check
- Check and return the current stock level for each product.
- Backend: Django
- Frontend: HTML, CSS, JavaScript
- Database: MongoDB
| Field | Type |
|---|---|
| name | string |
| description | text |
| category | string |
| price | decimal |
| stock_quantity | integer |
| supplier | foreign key to Supplier |
| Field | Type |
|---|---|
| name | string |
| phone | string (10 digits) |
| address | text |
| Field | Type |
|---|---|
| product | foreign key to Product |
| quantity | integer |
| total_price | decimal |
| sale_date | date |
| status | string (Pending/Completed/Cancelled) |
| Field | Type |
|---|---|
| product | foreign key to Product |
| quantity | integer |
| movement_type | string ("In"/"Out") |
| movement_date | date |
| notes | text |
- Python 3.8+
- MongoDB
- Django
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # For Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up the database connection in the
settings.pyfile:DATABASES = { 'default': { 'ENGINE': 'djongo', 'NAME': '<database_name>', } }
-
Apply migrations:
python manage.py makemigrations python manage.py migrate
-
Run the development server:
python manage.py runserver
-
Access the application in your browser at http://127.0.0.1:8000.
- Add Products and Suppliers: Navigate to the respective pages and fill out the forms.
- Manage Stock: Record incoming or outgoing stock under the Stock Movement section.
- Create and Track Sale Orders: Use the Sale Order section to manage orders and update their status.
- Filter Data: Apply filters for products by category or orders by status.
Run the tests to ensure functionality:
python manage.py test- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes and open a pull request.