This is a RESTful API for managing an E-commerce platform, built with FastAPI. The backend includes functionalities to handle products, categories, cart, orders, payments, reviews, and inventory. It also supports Excel export for products.
- CRUD operations for:
- Products
- Categories
- Cart
- Orders
- Payments
- Reviews
- Inventory
- Export product data to Excel.
- Organized and modular architecture.
- Python
- FastAPI
- Pydantic
- OpenPyXL (for Excel export)
GET /api/products- Get all productsGET /api/products/{id}- Get a product by IDPOST /api/products- Create a new productPUT /api/products/{id}- Update a productDELETE /api/products/{id}- Delete a productGET /api/products/export- Export product data to Excel
GET /api/categories- Get all categoriesGET /api/categories/{id}- Get a category by IDPOST /api/categories- Create a new categoryPUT /api/categories/{id}- Update a categoryDELETE /api/categories/{id}- Delete a category
POST /api/cart- Add a product to the cartGET /api/cart/{user_id}- Get the cart for a specific userDELETE /api/cart/{user_id}/{product_id}- Remove a product from the cart
POST /api/orders- Create a new orderGET /api/orders/{user_id}- Get orders for a userPUT /api/orders/{id}/{status}- Update the status of an order
POST /api/payments- Register a paymentGET /api/payments/{order_id}- Get payments for an order
POST /api/reviews- Add a review for a productGET /api/reviews/{product_id}- Get reviews for a product
PUT /api/inventory/{product_id}- Update inventory for a productGET /api/inventory- Get inventory data
