Every framework env var now requires the TINA4_ prefix. The legacy un-prefixed names (DATABASE_URL, SECRET, SMTP_HOST, HOST_NAME, etc.) no longer work. Setting them at startup makes the framework refuse to boot with a list of renames.
Run tina4 env --migrate to rewrite your existing .env automatically, or rename manually using the table below. The runtime guard prints the same mapping if it detects legacy names.
Conventional names stay un-prefixed:PORT, HOST, NODE_ENV, RACK_ENV, RUBY_ENV, ENVIRONMENT. These are runtime/PaaS conventions, not framework config.
Tina4 Node.js is configured through environment variables, read from .env at the project root. Every variable has a sensible default; most projects set three or four values and leave the rest alone.
This chapter lists every variable the Node.js framework reads, grouped by subsystem. Start with the minimum-config examples at the end, then come back here when you need to tune something specific.
Connection URL. Scheme selects the driver: sqlite, postgres, mysql.
TINA4_DATABASE_USERNAME
(empty)
Overrides the username embedded in TINA4_DATABASE_URL.
TINA4_DATABASE_PASSWORD
(empty)
Overrides the password embedded in TINA4_DATABASE_URL.
TINA4_DATABASE_FIREBIRD_PATH
(empty)
Overrides the database path/alias parsed from TINA4_DATABASE_URL for Firebird. Useful for Windows backslash paths and split-config setups.
TINA4_AUTOCOMMIT
true
Standalone writes auto-commit on their own connection (durable + visible across a pool); explicit transactions stay atomic. Set false for strict manual-commit mode.
TINA4_DB_CACHE
false
Enables in-memory query-result caching for read queries.
TINA4_DB_CACHE_TTL
30
Query cache TTL in seconds when TINA4_DB_CACHE=true.
TINA4_DB_POOL
0
Connection-pool size override. Applied to the database adapter's pool config when not set explicitly in code. 0 leaves the adapter default in place.
TINA4_ORM_PLURAL_TABLE_NAMES
true
When true, the ORM pluralises class names into table names (User → users).
Response cache backend. Options: memory, file, redis, valkey, memcached, mongodb, database. Falls back to file if the configured backend is unreachable.
TINA4_CACHE_DIR
data/cache
Cache directory for the file backend.
TINA4_CACHE_TTL
60
Default cache TTL in seconds.
TINA4_CACHE_MAX_ENTRIES
1000
Maximum cache entries.
TINA4_CACHE_URL
redis://localhost:6379
Connection URL for remote cache backends. For database, falls back to TINA4_DATABASE_URL when unset.
TINA4_CACHE_USERNAME
(none)
Username for the cache backend. May also be embedded in TINA4_CACHE_URL.
TINA4_CACHE_PASSWORD
(none)
Password for the cache backend. May also be embedded in TINA4_CACHE_URL (e.g. redis://:pass@host). Memcached is unauthenticated.
IMAP transport security. Options: tls, starttls, none. Node also accepts ssl as an alias for tls for back-compat.
TINA4_MAILBOX_DIR
data/mailbox
Dev mailbox directory. All outbound mail lands here when TINA4_DEBUG=true.
TINA4_MAIL_HOST, TINA4_MAIL_PORT, TINA4_MAIL_USERNAME, TINA4_MAIL_PASSWORD, TINA4_MAIL_FROM, TINA4_MAIL_FROM_NAME, TINA4_MAIL_IMAP_HOST, TINA4_MAIL_IMAP_PORT, TINA4_MAIL_IMAP_USERNAME, TINA4_MAIL_IMAP_PASSWORD are accepted as legacy aliases. New projects should use the TINA4_MAIL_* names.
Logs default to stdout. Set TINA4_LOG_OUTPUT=file plus TINA4_LOG_FILE=app.log to write to disk; the framework rotates at TINA4_LOG_ROTATE_SIZE bytes and keeps TINA4_LOG_ROTATE_KEEP backups using stdlib fs calls.
Variable
Default
Description
TINA4_LOG_LEVEL
DEBUG
Minimum log level written to console and files. Options: DEBUG, INFO, WARNING, ERROR, ALL.
TINA4_LOG_MAX_SIZE
10
Per-file log size limit in megabytes. Rotated when exceeded.
The app-facing Ai client and the developer dashboard share the TINA4_AI_* namespace. The client supports local OpenAI-compatible servers, OpenAI, and Anthropic. See Chapter 39: AI Client for code examples.
Variable
Default
Description
TINA4_AI_PROVIDER
local
Provider used by the app-facing client: local, openai, or anthropic.
TINA4_AI_URL
Provider-specific
Base URL or full endpoint. Local defaults to http://localhost:11437; OpenAI and Anthropic use their public API bases.
TINA4_AI_MODEL
Provider-specific
Default model. Local uses llama3.2, OpenAI uses gpt-4o-mini, and Anthropic uses claude-3-5-haiku-latest.
TINA4_AI_KEY
(none)
Required before an OpenAI or Anthropic request. Local requests need no key.
TINA4_AI_TIMEOUT
60
Total request deadline in seconds, including retries and response reads.
TINA4_AI_CONNECT_TIMEOUT
10
Connection-establishment deadline in seconds.
TINA4_AI_MAX_RETRIES
2
Retries before output for connection failures, HTTP 429, and HTTP 5xx.
TINA4_EMBED_URL
(inherits TINA4_AI_URL)
Optional embedding base URL or full endpoint.
TINA4_RAG_URL
http://localhost:11438
RAG service used by the developer dashboard.
TINA4_RAG_TOPK
4
Number of RAG matches returned per query.
TINA4_VISION_URL
http://localhost:11437/api/chat
Vision endpoint used by developer tools, not the app-facing AI client.
TINA4_IMAGE_URL
http://localhost:11437/api/generate
Image endpoint used by developer tools, not the app-facing AI client.
TINA4_SUPERVISOR_URL
http://localhost:9999
Rust supervisor URL used by developer tools.
TINA4_MCP_REMOTE
false
Allows MCP to bind beyond localhost. Do not enable it on a public production interface.
TINA4_NO_AI_PORT
false
Disables the developer AI port listener.
TINA4_OVERRIDE_CLIENT
false
Lets the framework start without the Rust client in containers and CI.
The tables above list every knob. These are the setups most apps actually reach for, ready to paste into .env. Each block sets only what the feature needs. Everything else keeps its default.
One URL points the ORM, the migrations, and the query builder at Postgres. Credentials can ride in the URL or sit in their own variables, which keeps the password out of your shell history.
The response cache and the cross-request query cache both speak to the same Redis. Point them at it and every instance shares one cache, invalidated globally on every write.
The file backend is fine for a single server. Move sessions to Redis the moment you run more than one instance, so a user stays logged in whichever instance answers the next request.
The dashboard AI talks to a local model through Ollama by default, so nothing leaves your machine. Point the URLs elsewhere only when you run the hosted Tina4 AI services.
Debug mode lights up the Swagger UI, the dev dashboard, detailed error pages, and live reload. Keeping the browser flag on stops a new tab opening every time you save a file.
No TINA4_DEBUG. It defaults to false, which is what you want in production. Set a real secret, a real database, locked-down CORS origins, HSTS, and SMTP credentials if you send email. Everything else has a production-appropriate default.