Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/danizd/geoviable/llms.txt

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

All runtime configuration for GeoViable is managed through a single .env file in the project root. This file is read by Docker Compose and injected into both the geoviable-db and geoviable-api containers at startup. The repository ships an .env.example template with safe placeholder values — it contains no real secrets and is safe to commit. The actual .env file is listed in .gitignore and must never be committed.

Creating the file

cp .env.example .env
Open the new .env file in your editor and replace the placeholder values with real ones before running docker compose up.

Variable Reference

Database

These variables are consumed by both the PostgreSQL container (to create the database and user on first start) and the FastAPI backend (to build the connection string).
VariableDefaultDescription
POSTGRES_DBgeoviablePostgreSQL database name
POSTGRES_USERgeoviablePostgreSQL username
POSTGRES_PASSWORDCHANGE_ME_SECURE_PASSWORDPostgreSQL password — use a secure random value in production
DATABASE_URLpostgresql+psycopg2://geoviable:CHANGE_ME_SECURE_PASSWORD@geoviable-db:5432/geoviableFull SQLAlchemy connection string. The hostname must be geoviable-db (the Docker Compose service name) when running inside Docker.
Never commit .env to version control if it contains real passwords. The .env.example file (with placeholder values) is safe to commit — .env itself is gitignored.

Application

VariableDefaultDescription
ENVIRONMENTproductionSet to development for local work or production for live deployments
LOG_LEVELINFOLogging verbosity passed to Uvicorn and the application logger: debug, info, warning, error, or critical
CORS_ORIGINShttps://geoviable.movilab.esComma-separated list of allowed CORS origins. For local development use http://localhost:3000,http://localhost:5173

Analysis Limits

These variables set the operational guardrails for the spatial analysis engine. They protect against large or malformed payloads that could cause slow PostGIS queries or excessive memory use.
VariableDefaultDescription
MAX_POLYGON_AREA_KM2100Maximum polygon area in km². Requests exceeding this are rejected before hitting the database.
MAX_POLYGON_VERTICES10000Maximum number of vertices allowed in a single polygon
MAX_UPLOAD_SIZE_MB5Maximum file upload size in MB, enforced in FastAPI middleware
QUERY_TIMEOUT_SECONDS30PostGIS query timeout in seconds. Applied as a statement_timeout to every database session via the PGSTATEMENT_TIMEOUT environment variable in entrypoint.sh.

Production Tips

Generate a cryptographically secure password for POSTGRES_PASSWORD with:
openssl rand -base64 32
Copy the output and use it for both POSTGRES_PASSWORD and the password portion of DATABASE_URL.
For a production deployment, your .env should include at minimum:
# Use a strong randomly generated password
POSTGRES_PASSWORD=<output of openssl rand -base64 32>
DATABASE_URL=postgresql+psycopg2://geoviable:<same password>@geoviable-db:5432/geoviable

# Set production mode (reduces debug output)
ENVIRONMENT=production
LOG_LEVEL=INFO

# Restrict CORS to your actual domain
CORS_ORIGINS=https://geoviable.movilab.es
For local development, relax CORS to allow both the production build served by Nginx and the Vite dev server:
ENVIRONMENT=development
LOG_LEVEL=debug
CORS_ORIGINS=http://localhost:3000,http://localhost:5173

Build docs developers (and LLMs) love