Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JorLOrT/rappi2/llms.txt

Use this file to discover all available pages before exploring further.

Docker Compose is the fastest way to run Rappi2. It starts three services together: api (the FastAPI application), postgres (PostgreSQL 15), and mongodb (MongoDB 6.0). All data is persisted in named volumes so it survives container restarts.

Prerequisites

Setup

1

Clone the repository

git clone https://github.com/JorLOrT/rappi2.git
cd rappi2
2

Configure environment variables

Copy the example file and edit the values for your environment:
cp .env.example .env
At minimum, set the following variables before starting:
VariableWhat to change
POSTGRES_USERPostgreSQL username (default: postgres)
POSTGRES_PASSWORDPostgreSQL password (default: postgres)
POSTGRES_DBDatabase name (default: rappi2)
MONGO_USERMongoDB root username (default: admin)
MONGO_PASSWORDMongoDB root password (default: admin)
SECRET_KEYJWT signing secret — must be changed for any non-development environment
ORS_API_KEYYour OpenRouteService API key for route planning
The DATABASE_URL and MONGO_URL values in .env are used by Alembic and scripts running outside Docker. Inside the api container, Docker Compose injects these automatically using the service hostnames postgres and mongodb.
3

Build and start the stack

docker-compose up -d --build
Docker Compose will build the api image, pull postgres:15-alpine and mongo:6.0, and wait for both databases to pass their health checks before starting the API.
4

Run database migrations

Apply all Alembic migrations to create the PostgreSQL schema:
docker-compose exec api alembic upgrade head
5

Seed initial data

Create the default roles, permissions, and admin user:
docker-compose exec api python scripts/seed_admin.py
This creates the Admin, Despachador, Conductor, and Cliente roles, assigns wildcard permissions to Admin, and creates the user admin with password admin123.
6

Verify the API is running

curl http://localhost:8000/
Expected response:
{
  "name": "Rappi2",
  "version": "1.0.0",
  "docs": "/docs",
  "openapi": "/openapi.json"
}

Useful commands

# View logs for all services
docker-compose logs -f

# View logs for a single service
docker-compose logs -f api
docker-compose logs -f postgres
docker-compose logs -f mongodb

# Restart the API after a code change
docker-compose restart api

# Stop all services (data is preserved in volumes)
docker-compose stop

# Stop and remove containers and volumes
docker-compose down -v
The API is available at http://localhost:8000. Interactive API documentation (Swagger UI) is at http://localhost:8000/docs and the ReDoc view is at http://localhost:8000/redoc.

Build docs developers (and LLMs) love