Globant FastAPI application

Tech Stack

  • Backend: FastAPI, SQLModel, Asyncpg
  • Database: PostgreSQL
  • ORM: SQLModel
  • Migration: Alembic
  • Testing: Pytest
  • Package Manager: uv
  • Development: Docker, Docker Compose

Project Structure

.
├── .postgres-data/
├── app/
│   ├── database/
│   ├── routes/
│   ├── schemas/
│   ├── services/
│   └── utils/
├── migrations/
├── tests/
│   ├── routes/
│   └── services/
├── Dockerfile
├── compose.yaml
├── alembic.ini
├── pyproject.toml
└── README.md

Getting Started

Prerequisites

  • Python 3.12+
  • Docker and Docker Compose
  • uv package manager

Installation/development

  1. Clone the repository:

    git clone https://github.com/1cadumagalhaes/globant-test
    cd globant-test
  2. Install uv if you haven't already:

    pip install uv
  3. Install dependencies:

    uv sync

Running the Application

Using Docker

Start the application and its dependencies:

  • Obs: If there is no .postgres-data directory, create it before running the application. We choose to let its path set so this can be easily implemented in production.
docker compose up

For development with auto-reload:

docker compose up --build --watch

Using Taskipy

Start the application and its dependencies:

  • Obs: This requires the installation of dependencies with uv sync.
task docker-up

For development with auto-reload:

task docker-dev

Stop the application:

task docker-down

Check the logs:

task docker-logs

Local Development

  1. Start the development server:

    task dev

Testing

Run tests:

task test

Generate coverage report:

task post_test

Code Quality

Lint the code:

task lint

Format the code:

task format

Run all checks (lint, format, test):

task check

Other commands

Clean project directory:

task clean

Create postgres-data folder

task init

Documentation

API documentation is available at /docs when the server is running