Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/IvanchoDev89/maleku-system/llms.txt

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

Maleku System ships three Docker Compose files: docker-compose.yml for full local development, docker-compose.staging.yml for pre-production validation, and docker-compose.test.yml for isolated test infrastructure. All containers share a dedicated bridge network (costarica_network) so services resolve each other by name. Prometheus and Grafana are included in the default compose file but gated behind the monitoring profile so they don’t start by default.
This project uses Docker Compose V2 (docker compose with a space), not the legacy V1 docker-compose binary. If you are on an older Docker installation, upgrade to Docker Desktop 4.x or later, or install the docker-compose-plugin package.

Services

The following services are defined in docker-compose.yml:
ServiceImagePort(s)Purpose
postgrespostgres:16-alpine5434:5432Primary PostgreSQL database (costaricatravel DB)
redisredis:7-alpine6381:6379Cache and rate-limiter state store (password-protected)
mailhogmailhog/mailhog:latest1025:1025, 8025:8025SMTP capture for development email testing
backend./backend/Dockerfile.dev8000:8000FastAPI application with hot-reload via volume mount
frontend./frontend/Dockerfile.dev3000:3000Nuxt.js 3 dev server with hot-reload via volume mount
backuppostgres:16-alpineOn-demand DB backup utility (activated via --profile backup)
prometheusprom/prometheus:latest9090:9090Metrics collection (activated via --profile monitoring)
grafanagrafana/grafana:latest3002:3000Dashboard visualisation (activated via --profile monitoring)
Both postgres and redis require secrets via environment variables — POSTGRES_PASSWORD and REDIS_PASSWORD must be set in your shell or in a .env file at the project root before starting the stack.

Local Development

Start the full stack (backend, frontend, database, Redis, MailHog):
# Build images and start all services in detached mode
docker compose up -d

# Follow logs for a specific service
docker compose logs -f backend

# Apply Alembic migrations after first start
docker compose exec backend alembic upgrade head

# Stop and remove containers (volumes are preserved)
docker compose down
If you already have database tables from a previous run and Alembic reports a conflict, stamp the current state as the baseline without running migrations:
docker compose exec backend alembic stamp head
To start the monitoring stack alongside the core services:
docker compose --profile monitoring up -d
Prometheus will be available at http://localhost:9090 and Grafana at http://localhost:3002 (default credentials: admin / value of GRAFANA_PASSWORD env var, default admin).

Hybrid Mode

For the fastest hot-reload experience during active development, run only MailHog inside Docker and start PostgreSQL, Redis, the backend, and the frontend natively:
# 1. Start MailHog in Docker
docker run -d \
  --name costarica_mailhog \
  -p 1025:1025 \
  -p 8025:8025 \
  mailhog/mailhog:latest

# 2. Start the FastAPI backend (from project root)
cd backend && uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload

# 3. Start the Nuxt.js frontend (in a separate terminal)
cd frontend && npm run dev
Ensure your backend/.env points SMTP_HOST=localhost and USE_SMTP_IN_DEV=True so the backend routes email through the MailHog container. The MailHog web UI is available at http://localhost:8025.

Staging Environment

docker-compose.staging.yml mirrors production as closely as possible. It uses the production Dockerfiles (without volume mounts), runs the backend with uvicorn --workers 2 --proxy-headers, and targets a separate costaricatravel_staging database. Migrations are run automatically on container start via the entrypoint command. Key differences from the dev compose file:
DetailDevStaging
Backend DockerfileDockerfile.devDockerfile
Frontend DockerfileDockerfile.devDockerfile
DB namecostaricatravelcostaricatravel_staging
Backend port80008001
Frontend port30003001
MailHog SMTP port10251026
MailHog UI port80258026
Workers1 (reload)2
Start the staging stack:
docker compose -f docker-compose.staging.yml up -d --build
Or use the Makefile shortcut:
make docker-staging

Makefile Commands

The project Makefile provides shortcuts for every common workflow. Run make <target> from the project root:

Development

TargetCommand
make startRun start.sh (interactive startup helper)
make devStart backend and frontend natively (hot-reload)
make dev-backenduvicorn app.main:app --reload --host 0.0.0.0 --port 8000
make dev-frontendnpm run dev inside frontend/
make dev-dockerdocker compose up --build
make stopKill background uvicorn and Nuxt processes

Build

TargetCommand
make buildBuild both backend Docker image and frontend static output
make build-backenddocker build -t costarica-backend ./backend
make build-frontendnpm run build inside frontend/

Docker

TargetCommand
make docker-updocker compose up -d --build
make docker-downdocker compose down
make docker-logsdocker compose logs -f
make docker-stagingdocker compose -f docker-compose.staging.yml up -d --build

Testing

TargetCommand
make testStart test infra → run all tests → tear down infra
make test-backendpytest -v --tb=short -x inside backend/
make test-backend-coveragepytest with --cov report
make test-frontendnpx vitest run inside frontend/
make test-e2enpx playwright test
make test-reservationSmoke test: full reservation flow via live API

Database

TargetCommand
make migratealembic upgrade head
make migration message="..."Auto-generate a new migration revision
make migration-create message="..."Create an empty migration revision

Code Quality

TargetCommand
make lintRun ruff + ESLint across the full codebase
make lint-backend-fixAuto-fix ruff violations in backend/
make securitybandit on backend + npm audit on frontend
make pre-commit-runRun all pre-commit hooks

Backup

TargetCommand
make backupRun scripts/backup-db.sh
make backup-localBackup to ./backups/

Housekeeping

TargetCommand
make cleanRemove __pycache__, .pytest_cache, .ruff_cache, frontend/.output, frontend/node_modules, backend/venv

Build docs developers (and LLMs) love