A comprehensive inventory management system for prepared/frozen meals manufacturers
Features β’ Installation β’ Usage β’ Demo
- About
- Team Members
- Features
- Tech Stack
- Installation
- Configuration
- Usage
- Database Schema
- Demo Instructions
- Project Structure
- Troubleshooting
This project implements a production-ready inventory management system for a prepared/frozen meals manufacturer. The system provides comprehensive functionality for managing products, ingredients, suppliers, manufacturers, batches, and production workflows with robust database constraints and business logic enforcement.
| Member Name | Unity ID |
|---|---|
| Pranav V | pvareny |
| Christopher Dillon Michels | Cdmichel |
| Anandteertha Ramesh Rao | arrao6 |
| Edward Feng | sfeng9 |
- β Create and manage product types with categories
- β Versioned recipe plans (BOM) management
- β Record ingredient receipts with validation
- β Create product batches with ingredient consumption
- β FEFO (First Expired First Out) lot selection π
- β Inventory reports (on-hand, nearly out of stock, almost expired)
- β Batch cost calculation and summaries
- β Recall & traceability system π
- β Manage ingredients supplied
- β Create/update ingredient definitions (atomic or compound)
- β Maintain ingredient formulations with versioning
- β Do-not-combine list management π
- β Receive ingredient batches with automatic lot numbering
- β Browse available products by category
- β Generate flattened ingredient lists for products
- β Compare products for incompatibilities π
- β 5 pre-defined analytical queries
- β Supplier spending analysis
- β Product cost analysis
- β Ingredient conflict detection
- FEFO (First Expired First Out): Automatic lot selection prioritizing earliest expiring batches
- Recall & Traceability: Track affected product batches for ingredient recalls
- Incompatibility Checking: Real-time conflict detection during recipe creation
- Product Comparison: Compare products for ingredient incompatibilities
- Backend: Python 3.7+
- Database: MySQL/MariaDB
- Database Driver: mysql-connector-python
- Environment Management: python-dotenv
- Interface: Menu-driven CLI
- Python 3.7 or higher
- MySQL/MariaDB database server (8.0+)
- MySQL command-line client (for database setup)
git clone <repository-url>
cd database-management-systempip install -r requirements.txtOr install manually:
pip install mysql-connector-python python-dotenv-
Run the application:
python main.py
-
Select option 5. Database Setup (Drop & Recreate)
-
Type
YESto confirm
The script will automatically:
- Drop existing database (if any)
- Create fresh database
- Load all schema, triggers, and procedures
- Insert sample data
# Create database
mysql -u root -p -e "CREATE DATABASE inventory_management CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
# Load schema and data
mysql -u root -p inventory_management < inventory-management.sql
mysql -u root -p inventory_management < triggers.sql
mysql -u root -p inventory_management < stored_procedures.sql
mysql -u root -p inventory_management < sample-data.sqlCreate a .env file in the project root:
DB_HOST=localhost
DB_NAME=inventory_management
DB_USER=root
DB_PASSWORD=your_password
DB_PORT=3306
β οΈ Note: The.envfile is gitignored. Never commit database credentials!
python main.py- Manufacturer - Product and batch management
- Supplier - Ingredient and formulation management
- General (Viewer) - Browse products and view ingredient lists
- View Queries - Execute pre-defined analytical queries
- Database Setup - Drop and recreate database (
β οΈ destructive)
# 1. Start application
python main.py
# 2. Select role (e.g., Manufacturer)
# 3. Enter user ID (e.g., MFG001)
# 4. Navigate through menu options| Table | Description |
|---|---|
UserDetails |
User accounts with role-based access |
Product |
Product definitions with categories |
Ingredient |
Atomic and compound ingredients |
IngredientFormulation |
Supplier-specific ingredient formulations |
ProductBOM |
Bill of materials for products |
RecipePlan |
Versioned recipe plans |
IngredientBatch |
Ingredient inventory batches |
ProductBatch |
Production batches |
IngredientConsumption |
Ingredient consumption tracking |
IngredientIncompatibility |
Ingredient conflict rules |
RecordProductionBatch- Creates product batch with validationRecordIngredientIntake- Records ingredient batch intakeConsumeIngredientLot- Consumes ingredient lots into product batchesRecalculateBatchCost- Recalculates batch costs
- Auto-generate ingredient lot numbers
- Enforce 90-day expiration rule
- Prevent expired consumption
- Maintain inventory on-hand quantities
- Role validation for manufacturers and suppliers
| Role | User ID | Name |
|---|---|---|
| Manufacturer | MFG001 |
Manufacturer One |
| Manufacturer | MFG002 |
Manufacturer Two |
| Supplier | 20 |
SupplierA Inc. |
| Supplier | 21 |
SupplierB Co. |
1. Login as Manufacturer β Enter ID: MFG001
2. Products β Create/Update
3. Products β Recipe Plans
4. Production β Create Product Batch
5. Reports β View all reports
6. (Grad) Recall & Traceability
1. Login as Supplier β Enter ID: 20
2. Manage Ingredients Supplied
3. Ingredients β Create/Update
4. Ingredients β Do-Not-Combine
5. Inventory β Receive Ingredient Batch
1. Login as General Viewer
2. Browse Products
3. Product β Ingredient List
4. (Grad) Compare Products
1. Select "View Queries"
2. Execute all 5 required queries:
- Query 1: Last batch ingredients
- Query 2: Supplier spending analysis
- Query 3: Unit cost lookup
- Query 4: Conflict detection
- Query 5: Supplier coverage analysis
database-management-system/
βββ π main.py # Main entry point
βββ π database.py # Database connection & operations
βββ π database_setup.py # Database setup script
βββ π manufacturer.py # Manufacturer role functionality
βββ π supplier.py # Supplier role functionality
βββ π general_viewer.py # General viewer functionality
βββ π queries.py # Required queries
βββ π enums.py # Enumerations
βββ π requirements.txt # Python dependencies
βββ π .env # Environment variables (gitignored)
βββ π .gitignore # Git ignore rules
βββ π README.md # This file
β
βββ ποΈ inventory-management.sql # Database schema
βββ ποΈ triggers.sql # Database triggers
βββ ποΈ stored_procedures.sql # Stored procedures
βββ ποΈ sample-data.sql # Sample data
- Last Batch Ingredients: List ingredients and lot numbers of last batch of Steak Dinner (100) by MFG001
- Supplier Spending: For MFG002, list all suppliers and total amount spent
- Unit Cost: Find unit cost for product lot 100-MFG001-B0901
- Conflict Detection: Find conflicting ingredients for product lot 100-MFG001-B0901
- Supplier Coverage: Which manufacturers has supplier James Miller (21) NOT supplied to?
- β
Check
.envfile configuration - β Verify database server is running
- β Ensure database exists and user has proper permissions
- β
Test connection:
mysql -u root -p -h localhost
- β
Install dependencies:
pip install -r requirements.txt - β
Verify Python version:
python --version(should be 3.7+) - β Check virtual environment activation
- β Verify all SQL files executed in order
- β Check database setup completed successfully
- β Verify sample data loaded correctly
- β Use Database Setup option (option 5) to recreate
- β Run Database Setup from main menu (option 5)
- β Check MySQL command-line client is installed
- β Verify SQL files are in project directory
- β Check file permissions
- π₯οΈ Interface: Menu-driven CLI (no GUI)
- π Constraints: Enforced via triggers and stored procedures
- π Grad Features: FEFO, recall/traceability, incompatibility checking
- π Composition: Supports one-level compound ingredient composition
- β Validation: All business rules enforced at database level
This project is for educational purposes (CSC540 - Project 1).
- Course: CSC540 - Database Management Systems
- Institution: North Carolina State University
- Project: Inventory Management for Prepared/Frozen Meals Manufacturer