This project is a simple ecommerce backend built with FastAPI and MongoDB Atlas.
- Product APIs: Create and list products
- Order APIs: Create orders and get orders by user (with product details)
- Pagination and filtering support
app/
main.py # FastAPI app and route registration
config/db.py # MongoDB connection logic
models/ # Pydantic models for request validation
schemas/ # Serialization helpers
routes/ # API endpoints
services/ # Business logic and DB operations
run.py # Entrypoint to run the app
requirements.txt # Dependencies
- Add your MongoDB Atlas URI to a
.envfile asMONGODB_URI. - Install dependencies:
pip install -r requirements.txt - Run the app:
python run.py
Deployable to Render/Railway. All endpoints are documented in the code.