This project is a fullstack web application built with Python. It provides a REST API backend and a web interface, with data stored in a PostgreSQL database.
The goal of the project is to demonstrate a clean, modular architecture suitable for scalable service development.
- FastAPI — web framework
- SQLAlchemy — ORM
- Alembic — database migrations
- PostgreSQL — database
- (Option 1) Jinja2 templates (server-side rendering)
- (Option 2) React (separate frontend application)
- Docker / Docker Compose — environment and deployment
- Postman — API testing
backend/
app/
main.py # Entry point
api/ # API routes
models/ # Database models
schemas/ # Pydantic schemas
services/ # Business logic
migrations/ # Alembic migrations
frontend/ # Frontend application (optional)
docker-compose.yml # Service orchestration
- Python 3.10+
- Docker and Docker Compose
- PostgreSQL (if running locally without Docker)
git clone <your-repo-url>
cd <repo-folder>
Create a .env file in the project root:
POSTGRES_DB=app
POSTGRES_USER=app
POSTGRES_PASSWORD=app
DATABASE_URL=postgresql://app:app@db:5432/app
docker-compose up --build
The API will be available at:
http://localhost:8000
Run migrations:
docker-compose exec backend alembic upgrade head
Create a new migration:
docker-compose exec backend alembic revision --autogenerate -m "message"
Interactive API docs are available at:
/docs(Swagger UI)/redoc(ReDoc)
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload
Run tests:
pytest
- Authentication (JWT)
- Role-based access control
- Frontend integration
- CI/CD pipeline
- Production deployment setup
MIT License
This project follows a modular, layered architecture:
- API layer (routes)
- Service layer (business logic)
- Data access layer (models)
The structure is designed to keep components loosely coupled and easy to maintain.