Skip to content

yuridomingues/support-system-api

Repository files navigation

Support System API

API developed in FastAPI for registering and managing clients and support tickets.


Technologies Used


Installation and Local Execution

Prerequisites

  • Python 3.12+
  • Docker and Docker Compose
  • uv (optional, but recommended)

Virtual Environment Setup with uv

It is recommended to use uv to simplify virtual environment creation and dependency synchronization.

Create and activate the virtual environment

uv venv

Activate the virtual environment

  • On Linux/macOS:
source .venv/bin/activate
  • On Windows PowerShell:
.\.venv\Scripts\Activate.ps1

Synchronize dependencies

uv sync

.env File Configuration

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

Local Setup with Docker

make up

# Access the API at:
http://localhost:8000

Run Automated Tests

# Using Makefile
make test

The tests use in-memory SQLite to ensure isolation and speed.


Authentication

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>

Database

  • Production: PostgreSQL (port 6543 in docker-compose.yml)
  • Tests: In-memory SQLite (test.db may be generated locally)

Useful Commands

# Start application
make up

# Stop containers and remove volumes
make down

# Run tests
make test

Notes

  • Project focused on best practices, clarity, and complete API functionality.
  • Authentication protects sensitive routes.
  • Independent tests using local SQLite.
  • URL FRONTEND

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published