A full-stack inventory management application built with Python, FastAPI, Streamlit, SQLite, and Docker.
| Component | Platform | Link |
|---|---|---|
| Frontend | Streamlit Community Cloud | https://inventory-management-sys.streamlit.app/ |
| Backend API | Render | https://inventory-backend-ktbp.onrender.com |
| API Documentation | FastAPI Swagger UI | https://inventory-backend-ktbp.onrender.com/docs |
The Inventory Management System is a full-stack web application designed to manage product inventory through a modern dashboard and RESTful API.
The application allows users to create, view, update, and delete products while monitoring inventory information through an interactive Streamlit dashboard.
The project follows a separated frontend and backend architecture:
- Frontend: Streamlit provides the interactive dashboard.
- Backend: FastAPI handles API requests and business logic.
- Database: SQLite stores product records.
- Containerization: Docker packages the backend application.
- Deployment: Render hosts the backend, while Streamlit Community Cloud hosts the frontend.
The frontend communicates with the backend through HTTP requests, making the application modular and easier to maintain.
- Create new products.
- View all available products.
- Retrieve individual products by ID.
- Update existing product information.
- Delete products from inventory.
- View inventory records.
- Monitor product information.
- Display inventory statistics.
- Manage products through an interactive interface.
- RESTful API development with FastAPI.
- Data validation using Pydantic.
- SQLite database integration.
- HTTP exception handling.
- CORS configuration for frontend-backend communication.
- Dockerized backend application.
- Separate frontend and backend deployment.
- Backend deployment on Render.
- Frontend deployment on Streamlit Community Cloud.
- Environment-independent API communication through a deployed backend URL.
The application follows a three-layer architecture.
flowchart TD
A["👤 User"] --> B["🖥️ Streamlit Frontend"]
B -->|"HTTP Requests"| C["🔗 FastAPI REST API"]
C --> D["📋 Pydantic Validation"]
D --> E["⚙️ Backend Logic"]
E --> F[("🗄️ SQLite Database")]
G["🐳 Docker Container"] -.-> C
H["☁️ Render"] -.-> G
I["☁️ Streamlit Cloud"] -.-> B
- A user interacts with the Streamlit dashboard.
- The frontend sends an HTTP request using Python Requests.
- FastAPI receives the API request.
- Pydantic validates incoming product data.
- Backend functions communicate with the SQLite database.
- The API returns a JSON response.
- Streamlit updates the dashboard based on the response.
| Technology | Purpose |
|---|---|
| Python | Core programming language |
| FastAPI | Backend API framework |
| Streamlit | Interactive frontend |
| Pydantic | Request data validation |
| SQLite | Database management |
| Requests | HTTP communication |
| Docker | Backend containerization |
| Render | Backend hosting |
| Streamlit Cloud | Frontend hosting |
| Git & GitHub | Version control and source management |
FastApi-Project/
│
├── Backend/
│ ├── Backend.py
│ ├── database.py
│ ├── inventory.db
│ ├── requirements.txt
│ └── Dockerfile
│
├── Frontend/
│ ├── Frontend.py
│ ├── theme.py
│ └── requirements.txt
│
├── .gitattributes
└── README.md
The backend exposes RESTful endpoints for inventory operations.
Base URL
https://inventory-backend-ktbp.onrender.com
| Method | Endpoint | Description |
|---|---|---|
| POST | /products/{product_id} |
Create a product |
| GET | /products |
Retrieve all products |
| GET | /products/{product_id} |
Retrieve a product by ID |
| PUT | /products/{product_id} |
Update a product |
| DELETE | /products/{product_id} |
Delete a product |
{
"name": "Wireless Mouse",
"category": "Electronics",
"price": 45.99,
"stock": 70
}Create Product
POST /products/3
Content-Type: application/json{
"name": "Mechanical Keyboard",
"category": "Electronics",
"price": 120.50,
"stock": 25
}Example Response
{
"message": "Product created successfully",
"product": {
"name": "Mechanical Keyboard",
"category": "Electronics",
"price": 120.5,
"stock": 25
}
}FastAPI automatically generates interactive API documentation.
- Swagger UI:
/docs - ReDoc:
/redoc
This project involved several practical backend and deployment challenges.
Instead of building the entire application inside one Python file, the project separates frontend responsibilities from backend responsibilities.
Challenge: Maintaining communication between independently deployed applications.
Implementation: The Streamlit frontend communicates with the FastAPI backend through HTTP requests.
Implemented separate endpoints for product creation, retrieval, updating, and deletion.
Engineering considerations:
- HTTP methods and status codes.
- Dynamic route parameters.
- JSON request and response handling.
- Product ID validation.
- Handling missing or duplicate products.
Integrated SQLite with the FastAPI backend to store and retrieve inventory records.
Engineering considerations:
- Database initialization.
- Product insertion.
- Product retrieval.
- Product updates.
- Product deletion.
- Database function separation.
Created a Product schema to validate incoming API data.
class Product(BaseModel):
name: str
category: str
price: float
stock: intThis helps ensure that incoming product information follows the expected structure and data types.
Packaged the FastAPI backend into a Docker image.
Engineering considerations:
- Dockerfile configuration.
- Python dependency installation.
- Container startup commands.
- Port configuration.
- Docker image building and deployment.
Configured FastAPI's CORSMiddleware to allow requests from the deployed Streamlit frontend.
This enables communication between frontend and backend hosted on different domains.
Deployed the frontend and backend independently.
- Backend: Render with Docker.
- Frontend: Streamlit Community Cloud.
This demonstrates practical experience with multi-service deployment and production-style application architecture.
Follow these steps to run the project locally.
- Python 3.10+
- Git
- Docker Desktop (optional, for containerized backend execution)
git clone YOUR_GITHUB_REPOSITORY_URLcd FastApi-Projectcd BackendCreate a virtual environment:
python -m venv venvActivate it on Windows:
venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtStart the backend:
uvicorn Backend:app --reloadBackend URL:
http://127.0.0.1:8000
Open another terminal:
cd FrontendCreate and activate a virtual environment if needed, then install dependencies:
pip install -r requirements.txtRun Streamlit:
streamlit run Frontend.pyFrontend URL:
http://localhost:8501
Important: For local frontend testing, configure the frontend API base URL to point to the local backend. For the deployed application, use the Render backend URL.
The backend is containerized using Docker.
Run from the project root:
docker build -t inventory-backend:1.0 ./Backenddocker run -d -p 8000:8000 --name inventory-api inventory-backend:1.0docker pshttp://localhost:8000/docs
| Service | Deployment Platform | Responsibility |
|---|---|---|
| Frontend | Streamlit Community Cloud | User interface and dashboard |
| Backend | Render | REST API and application logic |
| Database | SQLite | Product data storage |
| Container | Docker | Backend packaging and runtime |
The frontend and backend are deployed independently and communicate through the configured API URL.
The backend handles important product-related errors:
| Scenario | HTTP Status |
|---|---|
| Product created successfully | 201 |
| Product already exists | 400 |
| Product not found | 404 |
| Invalid request data | 422 |
Potential enhancements for future versions:
- 🔐 User authentication and role-based access.
- 🗄️ PostgreSQL database integration.
- 📦 Product image uploads.
- 🔍 Advanced search and filtering.
- 📊 Inventory analytics and reporting.
- 📉 Low-stock alerts.
- 📜 Product transaction history.
- 🧪 Automated testing with Pytest.
- 🔄 CI/CD pipeline integration.
- 📋 Pagination and advanced API filtering.
Building this project provided practical experience with:
- Full-stack application architecture.
- REST API development using FastAPI.
- Pydantic data validation.
- SQLite database operations.
- Frontend-backend integration.
- HTTP requests and API communication.
- CORS configuration.
- Docker image creation and container execution.
- Cloud deployment using Render and Streamlit Community Cloud.
- Debugging deployment and environment configuration issues.
Abdullah Asim
Full-Stack Developer | AI Development & Automation
Built with Python, FastAPI, Streamlit & Docker.
⭐ If you find this project useful, consider giving it a star!