A complete backend system for a grocery delivery application built using FastAPI. This project demonstrates real-world backend features including cart management, order processing, and advanced query handling.
- RESTful APIs built with FastAPI
- Pydantic-based request validation
- Full CRUD operations for items
- Cart system (add, remove, view items)
- Checkout workflow (cart → orders)
- Bulk order discount logic (8% for large quantities)
- Delivery charge calculation (slot-based)
- Search, filter, sort, and pagination for items
- Order management with search, sorting, and pagination
- Interactive API testing using Swagger UI
- Add, update, delete items
- Filter by category, price, stock
- Search by keyword
- Sort and paginate results
- Add items to cart
- Merge quantities
- Remove items
- View cart with totals
- Convert cart into orders
- One order per item
- Calculate final cost with delivery charges
- Place orders directly
- Search by customer name
- Sort by total cost
- Paginate results
- Python
- FastAPI
- Pydantic
pip install -r requirements.txt
uvicorn main:app --reloadOpen API docs:
http://127.0.0.1:8000/docs
Swagger UI examples are included in the repository screenshots.
grocery-api/
│
├── main.py
├── requirements.txt
├── README.md
└── screenshots/
- Uses in-memory data (no database)
- No authentication or user management
- Not designed for production use
- Integrate database (SQLite/PostgreSQL with SQLAlchemy)
- Add authentication (JWT)
- Modular project structure (routers, services)
- Dockerize the application
Bhanu Sai Prakash Bandaru
Aspiring Data Scientist | FastAPI