The Inventory Management System manages products and their associated suppliers, including functionalities like adding, updating, retrieving, and deleting records, as well as sending email notifications to suppliers. Below is a structured documentation of the project.
- Products
- Suppliers
- Add Product
- Sending Email to Suppliers
- Framework: FastAPI
- Database: SQLite
- ORM: Tortoise-ORM
- Environment Variables: Stored in
.envfile
app.py: Main application file containing API endpoints.models.py: Database models forProductandSupplier.requirements.txt: Python dependencies.
-
Supplier Endpoints
POST /supplier: Add a new supplier.GET /supplier: Retrieve all suppliers.GET /supplier/{supplier_id}: Retrieve a specific supplier by ID.PUT /supplier/{supplier_id}: Update supplier details.DELETE /supplier/{supplier_id}: Delete a supplier by ID.
-
Product Endpoints
POST /product/{supplier_id}: Add a new product associated with a supplier.GET /product: Retrieve all products.GET /product/{id}: Retrieve a specific product by ID.PUT /product/{id}: Update product details.DELETE /product/{id}: Delete a product by ID.
-
Email Notification Endpoint
POST /email/{product_id}: Send an email to the supplier of a specific product.
- Frameworks: React, Bootstrap
- State Management: React Context API
- HTTP Client: Fetch API
- HTTP Client: Fetch API
App.js: Main application component with routing.ProductContext.js: Context for managing product state.SupplierContext.js: Context for managing supplier state.components/: Directory containing React components.
ProductsTable.js: Displays a table of products.SuppliersTable.js: Displays a table of suppliers.AddProducts.js: Form to add a new product.AddSuppliers.js: Form to add a new supplier.UpdateProduct.js: Form to update product details.UpdateSupplier.js: Form to update supplier details.EmailPage.js: Form to send an email to a supplier.
-
Backend Setup
- Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install dependencies:
pip install -r api/requirements.txt
- Run the FastAPI server:
uvicorn api.app:app --reload
- Create a virtual environment and activate it:
-
Frontend Setup
- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install
- Start the React development server:
npm start
- Navigate to the frontend directory:
- Implement user authentication and authorization.
- Add more detailed logging and error handling.
- Improve the UI/UX of the frontend application.
If you encounter any bugs or have suggestions for improvements, please feel free to reach out at:



