This is a personal learning project built while practicing backend development.
This project is a backend application built using FastAPI. It provides basic e-commerce functionality like user authentication, product management, cart system, and order handling.
I built this project to understand how real-world backend systems are structured and how different components like authentication, database, and APIs work together.
- User registration and login
- Password hashing and JWT authentication
- Product creation and listing
- Search and filter products
- Cart functionality
- Order placement
- Pagination support
- Python
- FastAPI
- SQLAlchemy
- SQLite
- Pydantic
- python-jose (JWT)
- passlib (bcrypt)
project/
app.py database.py models.py schemas.py auth.py dependencies.py
routers/ user.py product.py cart.py order.py
-
Clone the repository
-
Create virtual environment
python -m venv .venv
- Activate environment
.venv\Scripts\activate
- Install dependencies
pip install -r requirements.txt
- Run the server
python -m uvicorn app:app --reload
After running the server, open:
You can test all APIs from there.
- Register a user
- Login to get token
- Use token for authorized requests
- Create products
- Add products to cart
- Place order
- How to build REST APIs using FastAPI
- How authentication works using JWT
- How to connect database using SQLAlchemy
- How to structure a backend project
- How to handle requests and responses properly
- Add role-based access (admin/user)
- Use PostgreSQL instead of SQLite
- Deploy the project online
- Add frontend integration
Srikanth