Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/teofilobetancourt/Tradiciones-y-Sabores/llms.txt

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

Tradiciones y Sabores ships as a three-container Docker Compose stack that mirrors its production three-layer architecture. A single docker compose up --build -d command builds both application images and starts the PostgreSQL database, the FastAPI backend, and the Nginx-served React frontend, wiring them together on an internal network so each service can reach the others by container name.

Prerequisites

Before you begin, make sure the following are installed on your host machine:
  • Docker 24+Install Docker
  • Docker Compose v2 — bundled with Docker Desktop; on Linux install the docker-compose-plugin
  • 1 GB RAM minimum — the three containers comfortably run within 512 MB each, but 1 GB total headroom is recommended
  • Ports 80, 443, 5000, and 5432 free on the host

Deployment Workflow

1

Clone the repository

Pull the source code from GitHub and enter the project directory:
git clone https://github.com/teofilobetancourt/Tradiciones-y-Sabores.git
cd Tradiciones-y-Sabores
2

Create your .env file

Copy the provided example file to create your local environment configuration:
cp .env.example .env
3

Configure environment variables

Open .env in your editor and fill in the required values. See Environment Variables for a full reference of every variable and its purpose.
4

Build and start all services

Build both Docker images and start all three containers in detached mode:
docker compose up --build -d
The first run downloads the postgres:16-alpine and python:3.12-slim base images, installs Python dependencies, and compiles the React frontend with Vite. Subsequent starts skip the build unless you pass --build again.
5

Verify the deployment

Once the containers are running, confirm the stack is healthy:
docker compose ps
All three services should report running. Then open the access URLs below to confirm each layer is responding.
URLDescription
http://localhostStaff application (POS, Kitchen, Orders, Inventory, Suppliers, Reports)
http://localhost/?view=menuCustomer-facing digital menu with self-service ordering
http://localhost:5000/api/docsInteractive Swagger UI for the FastAPI backend
http://localhost:5000/api/debugReal-time PostgreSQL connection health check

docker-compose.yml

The full Compose file that defines all three services:
version: '3.8'

services:
  # ── Base de Datos PostgreSQL 16 ──────────────────────────────
  postgres:
    image: postgres:16-alpine
    container_name: tradiciones_sabores_db
    restart: always
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: tradiciones_sabores
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data

  # ── Backend FastAPI Python ──────────────────────────────────
  backend:
    build:
      context: ./backend
      dockerfile: Dockerfile
    container_name: tradiciones_sabores_api
    restart: always
    ports:
      - "5000:5000"
    environment:
      DB_HOST: postgres
      DB_PORT: 5432
      DB_NAME: tradiciones_sabores
      DB_USER: postgres
      DB_PASSWORD: postgres
      CORS_ORIGINS: "*"
    depends_on:
      - postgres

  # ── Capa 1: Frontend (Nginx + React SPA) ───────────────────
  frontend:
    build:
      context: ./
      dockerfile: Dockerfile
    container_name: tradiciones_sabores_frontend
    restart: always
    ports:
      - "80:80"
      - "443:443"
    depends_on:
      - backend

volumes:
  postgres_data:

Service Containers

Container NameRoleExposed Ports
tradiciones_sabores_dbPostgreSQL 16 Alpine database5432
tradiciones_sabores_apiPython 3.12 / FastAPI backend served by Uvicorn5000
tradiciones_sabores_frontendReact SPA served by Nginx80, 443
The backend service declares depends_on: postgres, and frontend declares depends_on: backend, so Compose always starts the containers in the correct order.

Common Docker Commands

# Stream logs from all services
docker compose logs -f

# Stream logs from a specific service only
docker compose logs -f backend

# Stop and remove all containers (data volume is preserved)
docker compose down

# Restart only the backend after a code change
docker compose restart backend

# Rebuild and restart a single service
docker compose up --build -d backend

# Check resource usage across containers
docker stats
The named volume postgres_data stores PostgreSQL data at /var/lib/postgresql/data inside the container. Running docker compose down removes containers but preserves this volume, so your data survives restarts. To delete all data and start fresh, run docker compose down -v.
On first startup, the FastAPI backend automatically runs Base.metadata.create_all() to create all database tables (plato, mesa, cliente, pedido, detalle_pedido, factura) plus the Inventario schema tables (Insumos, Proveedores) and seeds the initial product catalogue with sample dishes. No manual migration step is required.

Build docs developers (and LLMs) love