A modern, scalable, and production-ready E-Commerce Backend built with FastAPI, PostgreSQL, SQLAlchemy, and Alembic.
Rubel Mart is designed to power a complete online shopping platform with secure authentication, product management, order processing, payment integration, inventory management, and administrative tools.
- User Registration
- User Login
- JWT Authentication
- Role-Based Access Control (RBAC)
- Password Hashing with Bcrypt
- Email Verification
- Password Reset
- User Profiles
- Address Management
- Account Verification
- Customer & Admin Roles
- Product Catalog
- Categories
- Brands
- Product Images
- Inventory Tracking
- Product Variants
- Shopping Cart
- Wishlist
- Order Placement
- Order Tracking
- Order History
- Product Reviews
- Product Ratings
- Customer Feedback
- Dashboard Analytics
- User Management
- Product Management
- Order Management
- Inventory Management
- FastAPI
- PostgreSQL
- SQLAlchemy ORM
- Alembic Database Migrations
- Docker Support
- Environment Configuration
- Structured Logging
- Global Exception Handling
- Request Validation
- CORS Configuration
app/
├── api/
│ ├── router.py
│ └── v1/
│
├── core/
│ ├── config.py
│ ├── database.py
│ ├── lifespan.py
│ └── logger.py
│
├── exceptions/
│ ├── api_exception.py
│ ├── handlers.py
│ └── __init__.py
│
├── middleware/
│ └── cors.py
│
├── models/
├── repositories/
├── services/
├── schemas/
├── utils/
│
└── main.py| Technology | Purpose |
|---|---|
| FastAPI | Backend Framework |
| PostgreSQL | Database |
| SQLAlchemy | ORM |
| Alembic | Database Migration |
| Pydantic | Data Validation |
| JWT | Authentication |
| Docker | Containerization |
| Uvicorn | ASGI Server |
Create a .env file:
APP_NAME=Rubel Mart API
APP_VERSION=1.0.0
APP_ENV=development
HOST=0.0.0.0
PORT=5000
DATABASE_URL=postgresql://username:password@localhost:5432/rubel_mart_db
JWT_SECRET=your-secret-key
FRONTEND_URL=http://localhost:3000Build Docker Image:
docker build -t rubel-mart-api .Run Container:
docker run -p 5000:5000 rubel-mart-apiCreate Migration:
alembic revision --autogenerate -m "create users table"Apply Migration:
alembic upgrade headRollback Migration:
alembic downgrade -1Install Dependencies:
pip install -r requirements.txtRun Development Server:
python run.pyAPI Documentation:
http://localhost:5000/docs
ReDoc:
http://localhost:5000/redoc
{
"message": "Operation successful",
"success": true,
"status_code": 200,
"data": {}
}{
"message": "Validation failed",
"success": false,
"status_code": 422,
"data": {
"errors": [
{
"field": "email",
"message": "Email is required"
}
]
}
}- Password Hashing (Bcrypt)
- JWT Authentication
- Input Validation
- CORS Protection
- Environment-Based Configuration
- Structured Exception Handling
Md. Mohin Uddin Rubel
Backend Developer | Full Stack Developer
Building scalable and production-ready web applications using modern technologies.
This project is proprietary software. All rights reserved. © Rubel Mart