Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CRISTIANCAMACH34/Zippi/llms.txt

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

All backend configuration is driven by environment variables loaded from backend/.env at startup via app.config.settings.get_settings(). Copy backend/.env.example to backend/.env and populate the values listed below before running the application. Variables marked Required must be set — leaving them blank will use insecure defaults that are rejected when APP_ENV=production.
SECRET_KEY and JWT_SECRET_KEY must each contain at least 32 bytes of random data in production. The app raises a RuntimeError on startup if either is missing or too short when APP_ENV=production. Generate safe values with:
python -c "import secrets; print(secrets.token_hex(32))"

App

General application identity and server binding settings.
VariableDefaultRequiredDescription
APP_NAMEZippiNoHuman-readable application name surfaced in health-check responses.
APP_ENVdevelopmentNoRuntime environment. Set to production to enable strict secret validation.
APP_DEBUGtrueNoEnables Flask debug mode. Must be false in production.
APP_HOST0.0.0.0NoInterface address Flask binds to. Use 127.0.0.1 to restrict to localhost.
APP_PORT5000NoTCP port the Flask API listens on.
APP_URLhttp://localhost:5000NoCanonical public URL of the backend, used to build absolute links.
TIMEZONEAmerica/BogotaNoIANA timezone used for timestamps and scheduled jobs.

Secrets & JWT

Never commit real secret values to version control. Rotate SECRET_KEY and JWT_SECRET_KEY immediately if either is exposed. In production both must be ≥ 32 bytes; the app will refuse to start otherwise.
VariableDefaultRequiredDescription
SECRET_KEYYes (prod)Flask session signing key. Must be ≥ 32 bytes in production.
JWT_SECRET_KEYYes (prod)HMAC key used to sign JWT tokens (HS256). Must be ≥ 32 bytes in production. Falls back to SECRET_KEY if unset in development.
JWT_ACCESS_TOKEN_EXPIRES_MINUTES4NoLifetime of short-lived access tokens in minutes.
JWT_REFRESH_TOKEN_EXPIRES_DAYS30NoLifetime of refresh tokens in days.
ADMIN_SESSION_IDLE_TIMEOUT_MINUTES15NoMinutes of inactivity before an admin session is invalidated.

Database

Zippi targets MySQL 8 in production. You may set either the high-level DB_* components (which are assembled into a mysql+pymysql:// URL automatically) or the full DATABASE_URL directly — DATABASE_URL takes precedence when present.
VariableDefaultRequiredDescription
DB_CONNECTIONmysqlNoDriver type: mysql, mariadb, postgresql, or sqlite.
DB_HOST127.0.0.1NoDatabase server hostname or IP.
DB_PORT3306NoDatabase server port.
DB_DATABASEzippi_dbNoSchema / database name.
DB_USERNAMErootNoDatabase username.
DB_PASSWORD(empty)Yes (prod)Database password.
DATABASE_URLmysql+pymysql://root:tu_password@127.0.0.1:3306/zippi_dbNoFull SQLAlchemy DSN. Overrides all DB_* component variables when set.

CORS

Controls which browser origins may call the API. The defaults cover both Vite dev-server ports (5173 and 5174).
VariableDefaultRequiredDescription
CORS_ALLOWED_ORIGINShttp://localhost:5173,http://127.0.0.1:5173,http://localhost:5174,http://127.0.0.1:5174NoComma-separated list of allowed origins for CORS pre-flight requests.
CORS_ALLOW_CREDENTIALStrueNoWhether cookies and Authorization headers are included in CORS requests.

URLs

Public base URLs used to build absolute links in outbound messages, webhooks, and redirects. These must be updated whenever the deployment domain changes.
VariableDefaultRequiredDescription
BACKEND_PUBLIC_URLhttp://localhost:5000NoPublicly reachable backend base URL. Used to construct webhook callback URLs.
ADMIN_FRONTEND_URLhttp://localhost:5173NoAdmin panel URL. Used in email links and redirect targets for admin actions.
WEBHOOK_BASE_URLhttp://localhost:5000NoBase URL registered with third-party services (WhatsApp, Wompi) for webhook delivery.

WhatsApp

Credentials for the Meta Cloud API used by the conversational bot. All fields are optional for local development — the bot degrades gracefully when not configured.
VariableDefaultRequiredDescription
WHATSAPP_API_VERSIONv22.0NoMeta Graph API version, e.g. v22.0.
WHATSAPP_GRAPH_BASE_URLhttps://graph.facebook.comNoMeta Graph API base URL used by the WhatsApp client.
WHATSAPP_PHONE_NUMBER_IDYes (prod)Numeric phone number ID from the Meta Business dashboard.
WHATSAPP_BUSINESS_ACCOUNT_IDYes (prod)WhatsApp Business Account (WABA) ID.
WHATSAPP_ACCESS_TOKENYes (prod)Permanent or system-user access token with whatsapp_business_messaging scope.
WHATSAPP_VERIFY_TOKENYes (prod)Arbitrary secret string used to verify webhook subscriptions with Meta.
WHATSAPP_WEBHOOK_SECRETYes (prod)HMAC secret to validate the X-Hub-Signature-256 header on incoming webhooks.
WHATSAPP_DEFAULT_COUNTRY_CODE57NoCountry dialing code prepended when normalizing phone numbers (57 = Colombia).

Wompi Payments

Integration with Wompi, the payment gateway used for Colombia. Set WOMPI_ENV=production when going live; the base URL switches automatically.
VariableDefaultRequiredDescription
WOMPI_ENVsandboxNosandbox or production. Determines the default WOMPI_BASE_URL if not overridden.
WOMPI_PUBLIC_KEYYes (prod)Public key from the Wompi dashboard (used client-side to tokenise cards).
WOMPI_PRIVATE_KEYYes (prod)Private key for server-to-server API calls.
WOMPI_INTEGRITY_SECRETYes (prod)Secret used to compute the payment integrity signature.
WOMPI_EVENTS_SECRETYes (prod)Secret to validate HMAC signatures on Wompi event webhooks.
WOMPI_BASE_URLhttps://sandbox.wompi.co/v1NoWompi REST API base URL. Auto-set based on WOMPI_ENV if left blank.
WOMPI_REDIRECT_URLhttp://localhost:5173/ordersNoFrontend URL Wompi redirects to after a payment attempt.
WOMPI_WEBHOOK_PUBLIC_URLhttp://localhost:5000/api/v1/payments/wompi/webhookNoPublicly reachable URL Wompi calls for payment events.

Storage

Controls where uploaded files (images, receipts) are stored. Switch STORAGE_DRIVER to s3 for cloud-native deployments.
VariableDefaultRequiredDescription
STORAGE_DRIVERlocalNoStorage backend: local (filesystem) or s3 (AWS S3 / compatible).
UPLOAD_FOLDERstorage/uploadsNoRelative path (from backend/) used when STORAGE_DRIVER=local.
MAX_CONTENT_LENGTH_MB10NoMaximum upload size in megabytes. Mapped to Flask’s MAX_CONTENT_LENGTH.
AWS_ACCESS_KEY_IDS3 onlyAWS access key ID for S3 operations.
AWS_SECRET_ACCESS_KEYS3 onlyAWS secret access key.
AWS_REGIONS3 onlyAWS region, e.g. us-east-1.
AWS_S3_BUCKETS3 onlyS3 bucket name for uploads.
AWS_S3_BASE_URLS3 onlyBase public URL for serving S3 objects (e.g. a CloudFront distribution URL).

Redis & Celery

Redis serves as both the Celery message broker and the task result backend. Set REDIS_URL directly or configure the individual REDIS_* component variables — REDIS_URL takes precedence when present.
VariableDefaultRequiredDescription
REDIS_HOST127.0.0.1NoRedis server hostname or IP address.
REDIS_PORT6379NoRedis server port.
REDIS_DB0NoRedis logical database index (0–15).
REDIS_PASSWORD(empty)NoRedis AUTH password. Leave blank for instances without authentication.
REDIS_URLredis://127.0.0.1:6379/0NoFull Redis connection URL. Overrides REDIS_HOST/REDIS_PORT/REDIS_DB when set.
CELERY_BROKER_URLredis://127.0.0.1:6379/0NoCelery broker URL. Defaults to the same Redis instance as REDIS_URL.
CELERY_RESULT_BACKENDredis://127.0.0.1:6379/0NoWhere Celery stores task results. Can be set to a different Redis DB.

Logging

VariableDefaultRequiredDescription
LOG_LEVELINFONoPython logging level: DEBUG, INFO, WARNING, ERROR, or CRITICAL.
LOG_FILEstorage/logs/zippi.logNoPath (relative to backend/) for the rotating log file. Directory must exist.

Business Rules

These variables tune the platform’s operational behaviour without requiring code changes. All have sensible defaults for development.
VariableDefaultRequiredDescription
MAX_ACTIVE_ORDERS_PER_COURIER1NoMaximum number of in-progress orders a courier can hold simultaneously.
ORDER_ASSIGNMENT_TIMEOUT_SECONDS60NoSeconds before an unaccepted order assignment is cancelled and reassigned.
REQUIRE_LOCATION_FOR_DELIVERYfalseNoWhen true, couriers must share GPS location before accepting a delivery order.
ALLOW_MANUAL_ORDER_CREATIONtrueNoAllow operators to create orders manually from the admin panel.
AUTO_NOTIFY_CUSTOMER_STATUStrueNoAutomatically send WhatsApp status updates to customers on order state changes.
DEFAULT_SERVICE_FEE_FOOD4000NoDefault service fee (COP) applied to food delivery orders.
DEFAULT_SERVICE_FEE_FREE_ORDER5000NoDefault service fee for free-form orders.
DEFAULT_SERVICE_FEE_BILL_PAYMENT5000NoDefault service fee for bill payment errands.
DEFAULT_SERVICE_FEE_COPIES5000NoDefault service fee for copy/print errands.
DEFAULT_SERVICE_FEE_CUSTOM_ERRAND6000NoDefault service fee for custom / miscellaneous errands.

Default Admin

Bootstrap credentials for the initial administrator account, created by the seed script on a fresh install. Change DEFAULT_ADMIN_PASSWORD immediately after first login and never use these values in production.
VariableDefaultRequiredDescription
DEFAULT_ADMIN_NAMEAdministrador ZippiNoDisplay name for the seeded admin account.
DEFAULT_ADMIN_EMAILadmin@zippi.localNoEmail address for the seeded admin account.
DEFAULT_ADMIN_PASSWORD(empty)Yes (prod)Password for the seeded admin account. Must be set before running seeds.

Mail

SMTP settings for transactional email (password resets, activation links). All fields are optional for local development — email sending is skipped gracefully when the server is not configured.
VariableDefaultRequiredDescription
MAIL_SERVERNoSMTP server hostname (e.g. smtp.gmail.com).
MAIL_PORT587NoSMTP server port. Use 587 for TLS or 465 for SSL.
MAIL_USERNAMENoSMTP authentication username.
MAIL_PASSWORDNoSMTP authentication password.
MAIL_USE_TLStrueNoEnable STARTTLS. Set to false only for local mail catchers (e.g. Mailhog).
MAIL_DEFAULT_SENDERNoFrom address used for all outbound emails (e.g. noreply@zippi.co).

LLM (Local AI)

Zippi includes an optional local language model that powers the conversational order bot. The model runs in-process using HuggingFace Transformers. Disable this section entirely by setting LLM_LOCAL_ENABLED=false if your server does not have sufficient RAM or you do not need AI features.
LLM_LOCAL_ENABLED defaults to true in .env.example but the feature only activates if a model path is resolvable at startup — either via LLM_LOCAL_MODEL_PATH or the HuggingFace local cache. The default model is HuggingFaceTB/SmolLM2-135M-Instruct, which is downloaded automatically on first use if you have an internet connection.
VariableDefaultRequiredDescription
LLM_LOCAL_ENABLEDtrueNoMaster switch for the local LLM feature. Set to false to disable entirely.
LLM_LOCAL_SELECTOR_ENABLEDtrueNoEnables automatic selection of the best trained adapter from LLM_LOCAL_RUNS_ROOT.
LLM_LOCAL_MODEL_PATHHuggingFaceTB/SmolLM2-135M-InstructNoHuggingFace model ID or absolute path to a locally downloaded model directory.
LLM_LOCAL_TOKENIZER_PATH(same as model path)NoOverride tokenizer path if different from the model path.
LLM_LOCAL_ADAPTER_PATH(auto-detected from runs root)NoAbsolute path to a LoRA adapter directory containing adapter_model.safetensors.
LLM_LOCAL_RUNS_ROOTartifacts/llm_local/runsNoRoot directory where training run outputs are stored. Used by the auto-selector.
LLM_LOCAL_PHASE_REPORTS_ROOTartifacts/llm_local/phase_testsNoDirectory containing phase evaluation reports used to rank adapter quality.
LLM_LOCAL_MAX_NEW_TOKENS350NoMaximum number of tokens the model generates per turn.
LLM_LOCAL_TEMPERATURE0.2NoSampling temperature. Lower values produce more deterministic outputs.
LLM_LOCAL_TOP_P0.95NoNucleus sampling probability mass. Combined with LLM_LOCAL_TEMPERATURE.

Build docs developers (and LLMs) love