This project provides a RESTful API for an e-commerce platform built with FastAPI, PostgreSQL (managed locally with Docker Compose), and tested with Pytest. GitHub Actions handle CI/CD.
-
Clone the repository.
-
Create a Virtual Environment: Isolate project dependencies:
python3 -m venv venv venv\Scripts\activate # Windows # source venv/bin/activate # Linux/macOS
-
Install Dependencies: Install the required packages:
pip install -r requirements.txt
-
Docker Compose: Initialize the PostgreSQL database using Docker Compose:
docker-compose up --build
-
Environment Variables: Create a
.env
file based on.env.example
. Replace the placeholders with your actual values, especiallyYOUR_SECRET_KEY_HERE
! -
Database Migrations: Apply database migrations using either:
alembic upgrade head
or
python migrate.py
-
Run the API: Start the FastAPI application:
python run.py
-
Ensure your environment variables are set correctly.
-
Run Pytest:
pytest
- FastAPI: High-performance Python web framework.
- PostgreSQL: Relational database (managed locally with Docker).
- Docker Compose: Container orchestration for local development.
- Pytest: Testing framework.
- GitHub Actions: Continuous integration and continuous deployment.