The Fake Ecommerce Backend API is a free tool designed to expedite ecommerce frontend development by providing a simulated backend experience. This API enables developers to commence work on the frontend and test functionalities that depend on backend responses. Built with Python FastAPI for exceptional performance, this API offers a range of features for managing products, store categories, carts, and user-related operations.
Get All Products:
Retrieve a list of all available products.Get Product by ID:
Fetch details of a specific product using its unique identifier.Get Products by Category ID:
Obtain a list of products belonging to a particular category.
Get All Categories:
Retrieve a list of all store categories.Get Category by ID:
Fetch details of a specific store category.
Get All Carts:
Retrieve a list of all shopping carts.Get Cart by ID:
Fetch details of a specific shopping cart.Update Cart by ID:
Modify the contents of a shopping cart.Delete Cart by ID:
Remove a shopping cart.
Get All Users:
Retrieve a list of all users.Get User by ID:
Fetch details of a specific user.Authentication (Login and Sign Up):
Secure user authentication using email and password.
Explore the API documentation and access usage code snippets on our official website.
- Python Version: 3.9 and above
- Web Framework: FastAPI 0.99.1
- Database Integration:
- Postgres DB: Version 6.21 and above
- Migration handled with Alembic
- Dependency Injection Framework: Utilizing dependency-injector
- Adhering to the service-repository pattern
- Clone the repository.
- Install dependencies.
git clone https://github.com/kudah99/fake-ecommerce-backend-api
cd fake-ecommerce-backend-api
pipenv install or pip install -r requirements.txt
- Database migrations
Note: Use .env_example as a sample for your .env:
-
alembic upgrade head
: apply every migrations -
alembic downgrade base
: rollback every migrations -
alembic revision --autogenerate -m "revision_name"
: create new migration -
alembic history
: get alembic revision history -
Run the API server.
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
- How to run with Docker?
- Ensure you have Docker installed and running on your machine.
docker-compose up --build
This project is licensed under the MIT License.