crudy
    FeaturesUse CasesDocumentationPricingAboutContact
    Get started free
    Documentation
    • Introduction
    • Installation
    • Quickstart
    • CLI Reference
    • Overview
    • Core Packages
    • App Structure
    • Modules & Routes
    • Module Anatomy
    • Backend Module
    • Frontend Module
    • Quotas
    • Full Example
    • Overview
    • Docker
    • Environment Variables
    • Licensing
    Deployment

    Environment Variables

    Every variable a Crudy deployment reads.

    The backend reads its configuration from environment variables and validates them at boot. Missing or weak secrets cause the process to exit before the server starts listening.

    Required at boot

    The framework's assertSecretsHardened check runs first. It enforces these and any module-declared secrets.

    VariableRequiredNotes
    JWT_SECRETyesAt least 32 characters. Must not match known defaults (changeme, password, secret, admin, ...). Must have at least 8 unique characters of entropy.
    LICENSE_FILEyesPath to the license.lic file Crudy issued for your deployment. Read once at boot.
    LICENSE_PUBLIC_KEY or LICENSE_PUBLIC_KEY_FILEyesThe verification key Crudy shipped alongside your license. Inline PEM or a path.

    If any check fails the backend logs the failures with the [secrets] prefix and exits.

    Warning

    Never deploy with a placeholder secret. The check rejects common default values (including changeme, change-this-to-a-long-random-secret-in-production, postgres, admin, test, dev) and any string under 32 characters or with low entropy.

    Database

    VariableDefaultNotes
    DB_HOSTlocalhostPostgreSQL hostname. In the generated compose file this is postgres.
    DB_USERrequiredPostgreSQL role used by the backend.
    DB_PASSWORDrequiredPassword for that role.
    DB_NAMErequiredDatabase name.
    POSTGREST_URLhttp://localhost:3002Internal PostgREST URL. Never exposed publicly.
    POSTGREST_DB_PASSWORDrequiredPassword for the authenticator role used by PostgREST.

    The generated docker-compose.yml reads DB_USER, DB_PASSWORD, DB_NAME, and POSTGREST_DB_PASSWORD from your .env.

    Admin account

    VariableDefaultNotes
    ADMIN_EMAILadmin@localhostGlobal admin user created on first boot with a random unusable password. Run crudy admin reset to set a password.
    Note

    Do not set ADMIN_EMAIL=admin@example.com for the global admin. That email is used by dev seeds for an org-scoped admin and conflating the two creates a misleading permission state.

    Network and CORS

    VariableDefaultNotes
    CORS_ORIGINhttp://localhost:3001Comma-separated list of allowed origins for the API.
    BACKEND_PORT3000Host port the backend container publishes.
    FRONTEND_PORT3001Host port the frontend container publishes.
    NEXT_PUBLIC_API_URLhttp://localhost:3000URL the frontend uses to reach the backend. Baked into the build because of the NEXT_PUBLIC_ prefix.

    Operational toggles

    VariableDefaultNotes
    NODE_ENVrequired by Docker imagesdevelopment or production.
    DISABLE_RATE_LIMITunsetSet to true only for local load testing. Never in production.

    Module-declared secrets

    A module can declare additional required secrets in its BackendModule.requiredSecrets array. The framework adds them to the boot-time check:

    ts
    requiredSecrets: [
        { name: 'SMTP_PASSWORD', minLength: 16, description: 'SMTP relay password' },
    ]

    If the module is wired into the app, the variable must be present at boot. The same length and entropy checks apply.

    Where to put values

    • Local dev: .env in the app root, loaded by docker compose and by the generated Makefile targets.
    • Production: your secrets manager. Mount values into the backend container.
    • Never commit .env files to source control. The framework ships .env.example as the documented template.

    Verifying

    After setting variables, make health confirms the backend is up and reports db: connected. If the backend fails to start, its logs (make dev-logs or docker logs <container>) will show the [secrets] failures or the license verification error.

    PreviousDockerNext Licensing
    crudy

    Build internal tools your teams actually use. Powered by a framework built for developers.

    Product

    • Features
    • Use Cases
    • Pricing

    Company

    • About
    • Contact

    © 2026 Crudy. All rights reserved.

    crudy.fr