API developed in FastAPI for registering and managing clients and support tickets.
- FastAPI
- PostgreSQL
- SQLAlchemy
- Alembic
- Pydantic v2
- Python-Jose (JWT)
- Pytest + pytest-asyncio
- Docker + Docker Compose
- uv
- Python 3.12+
- Docker and Docker Compose
uv
(optional, but recommended)
It is recommended to use uv
to simplify virtual environment creation and dependency synchronization.
uv venv
- On Linux/macOS:
source .venv/bin/activate
- On Windows PowerShell:
.\.venv\Scripts\Activate.ps1
uv sync
To run the application, you need to create a .env
file in the project root with the following environment variables:
DATABASE_URL=postgresql+asyncpg://postgres:postgres@db:5432/support_db
SECRET_KEY=ana
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
make up
# Access the API at:
http://localhost:8000
# Using Makefile
make test
The tests use in-memory SQLite to ensure isolation and speed.
Authentication is done via JWT. Use the endpoint:
POST /auth/token
Request body (x-www-form-urlencoded):
username=admin
password=1234
Usage example:
Add the token to the header of protected requests:
Authorization: Bearer <token>
- Production: PostgreSQL (port 6543 in
docker-compose.yml
) - Tests: In-memory SQLite (
test.db
may be generated locally)
# Start application
make up
# Stop containers and remove volumes
make down
# Run tests
make test
- Project focused on best practices, clarity, and complete API functionality.
- Authentication protects sensitive routes.
- Independent tests using local SQLite.
- URL
FRONTEND