tokyo-boy/inventory-backend
Inventory Order Management System
A modern full-stack Inventory & Order Management application built with React, FastAPI, PostgreSQL, Docker, and Alembic.
The system enables businesses to efficiently manage products, customers, orders, inventory levels, and operational analytics through a responsive dashboard.
Live Demo
Frontend
https://inventory-order-management-7z6azcvtui.vercel.appBackend API
https://inventory-backend-uotd.onrender.comAPI Documentation
[https://your-backend.onrender.com/](https://inventory-backend-uotd.onrender.com/docsDocker Hub Image
docker.io/gopal0921/backend:latestFeatures
Dashboard
- Inventory Overview
- Product Statistics
- Customer Statistics
- Order Statistics
- Inventory Value Calculation
- Low Stock Alerts
- Recent Orders Feed
Product Management
- Create Products
- Update Products
- Delete Products
- SKU Management
- Stock Tracking
- Product Search
Customer Management
- Create Customers
- Update Customers
- Delete Customers
- Email Validation
- Customer Search
Order Management
- Create Orders
- Multiple Line Items
- Automatic Inventory Deduction
- Order Details View
- Order History
- Inventory Validation
Backend Features
- RESTful API
- PostgreSQL Database
- Alembic Migrations
- Pydantic Validation
- Service Layer Architecture
- Global Exception Handling
DevOps Features
- Dockerized Backend
- Dockerized Frontend
- Docker Compose Support
- GitHub Actions CI
- Render Deployment
- Vercel Deployment
Tech Stack
Frontend
- React 18
- Vite
- React Router
- Axios
- React Hook Form
- Zod
- Lucide React
- React Hot Toast
Backend
- FastAPI
- SQLAlchemy
- PostgreSQL
- Alembic
- Pydantic
- Uvicorn
Infrastructure
- Docker
- Docker Compose
- GitHub Actions
- Render
- Vercel
Project Structure
inventory-order-management/
│
├── backend/
├── frontend/
├── docs/
├── screenshots/
├── docker-compose.yml
└── README.mdArchitecture
React Frontend
│
▼
FastAPI REST API
│
▼
PostgreSQL DatabaseThe backend follows a layered architecture consisting of:
API Layer
│
Service Layer
│
Database Layer
│
PostgreSQLThis structure improves maintainability, scalability, and testability.
Screenshots
Dashboard
The dashboard provides inventory metrics, business statistics, low-stock alerts, and recent order activity.
Products Management
Manage products, pricing, stock levels, and SKU information through a searchable product catalog.
Customers Management
Manage customer information including names, email addresses, and contact details.
Orders Management
Create and manage customer orders with automatic inventory updates and order tracking.
Mobile Responsive View
Fully responsive user interface optimized for mobile and tablet devices.
Local Setup
Clone Repository
git clone https://github.com/gopal092003/inventory-order-management.git
cd inventory-order-managementBackend Setup
cd backend
python -m venv venv
# Linux / Mac
source venv/bin/activate
# Windows
venv\Scripts\activate
pip install -r requirements.txtCreate environment file:
cp .env.example .envRun migrations:
alembic upgrade headSeed database:
python -m app.db.seedStart server:
uvicorn app.main:app --reloadBackend URL:
http://localhost:8000Swagger Documentation:
http://localhost:8000/docsFrontend Setup
cd frontend
npm installCreate environment file:
cp .env.example .envStart frontend:
npm run devFrontend URL:
http://localhost:5173Docker Setup
Run the complete application:
docker compose up --buildServices:
Frontend:
http://localhost:5173
Backend:
http://localhost:8000
Swagger:
http://localhost:8000/docsEnvironment Variables
Backend
DATABASE_URL=
CORS_ORIGINS=
LOW_STOCK_THRESHOLD=Frontend
VITE_API_BASE_URL=API Documentation
Detailed endpoint documentation:
docs/api-endpoints.mdSwagger UI:
/api/docsDeployment
Deployment instructions:
docs/deployment-guide.mdFree deployment without Render card requirements:
docs/free-deployment-guide.mdFly.io backend deployment:
docs/fly-deployment-guide.mdDeployment stack:
Frontend → Vercel
Backend → Render
Database → Render PostgreSQLFree stack:
Frontend -> Vercel
Backend -> Hugging Face Spaces Docker
Database -> Supabase PostgresContinuous Integration
GitHub Actions automatically:
- Installs backend dependencies
- Validates backend imports
- Builds frontend application
- Verifies Docker image builds
Workflow:
.github/workflows/ci.ymlDatabase Migrations
Create migration:
alembic revision --autogenerate -m "migration_name"Apply migrations:
alembic upgrade headRollback migration:
alembic downgrade -1Future Enhancements
- Authentication & Authorization
- Role-Based Access Control
- Inventory Reports
- CSV Export
- PDF Invoice Generation
- Order Status Tracking
- Audit Logging
- Unit Tests
- Integration Tests
Author
Your Name
GitHub:
https://github.com/gopal092003LinkedIn:
https://www.linkedin.com/in/gopal-gupta-0ab404281/License
This project was developed as part of a technical assessment and is intended for educational and evaluation purposes.
