A project focused on an online shop for selling electronic products. You'll find management of products, orders, user authentication, and user registration.
- User Authentication: Users can register, log in, email verification, and recover passwords.
- Product Management: Administrators can add, edit, and delete products.
- Order Management: Customers can place orders and view their order details.
- Product Categories: Organizes products into categories for easy navigation.
- Email Sending with Mailpit: Registration, confirmation via emails.
This project was developed using the following technologies:
- Python: version 3.13.0.
- FastAPI: version 0.115.8
- PostgreSQL:version 16.8
- Docker: version 27.3.1
- SQLAlchemy: version 2.0.38
- Pydantic: version 2.10.6
The project follows a modular to ensure future scalability. Below is the main directory structure:
โฃ ๐api
โ โฃ ๐routes
โ โ โฃ ๐admin
โ โ โฃ ๐auth
โ โ โฃ ๐client
โ โ โ ๐public
โ โ ๐api.py
โฃ ๐core
โฃ ๐dependencies
โฃ ๐middlewares
โฃ ๐models
โ โฃ ๐category
โ โฃ ๐order
โ โฃ ๐product
โ โฃ ๐user
โ โ ๐__init__.py
โฃ ๐responses
โฃ ๐schemas
โฃ ๐services
โ โฃ ๐category
โ โฃ ๐order
โ โฃ ๐product
โ โฃ ๐email.py
โ โฃ ๐user_profile.py
โ โ ๐user.py
โฃ ๐templates
โ โ ๐user
โฃ ๐utils
โ ๐main.py
Before getting started, make sure you have the following installed:
- Docker
- Python >= 3.8
- PostgreSQL
-
Clone this repository:
git clone https://github.com/nuriadevs/store-backend-fastapi.git cd evoltronic_store
-
Build and start the Docker containers:
docker-compose up --build
-
Run the migrations:
docker exec -it fastapi_app alembic upgrade head
-
Open the browser to view the routes:
http://localhost:8000/docs
-
Open the browser to receive the emails:
http://localhost:8025/
If you want to explore and test the API, you can use the Postman collection weโve prepared. You can find it in the api_docs/evoltronic.json
file. Enjoy it!
Login using the admin user provided in the migration
POST/users
{
"username": "Lolo",
"email": "lolo@example.com",
"password": "PassHashed_123!"
}
POST/products/create
{
"name": "Laptop",
"description": "Laptop Samsung ultra.",
"price": 800.50,
"stock": 10,
"category_id": 1
}
docker-compose exec app pytest
If you have any questions send me an email.
โ๏ธ Email
- Run the migration to test the application with an admin user.
- Don't forget to create your own .env file for the variables.
- This project is under construction...can be improved.