Skip to content

Configuration Flags ​

All configuration is via environment variables (see Environment Variables for the full .env walkthrough). This page focuses on the behaviour-changing flags an operator reaches for.

Feature flags ​

FlagDefaultEffect
EMANDI_TILED_REDESIGN_ENABLEDtrueThe 4-tile hub landing pages for /buy and /sell (vs. flat boards). Gates the back-to-hub links.

Runtime feature toggles are resolved through apps/api/src/lib/featureFlags.ts.

Quota limits (env-overridable) ​

Phase 1 is intentionally loose — instrument first, calibrate later.

VarDefaultAxis
SELL_LEADS_DAILY5Posts (sell)
BUY_LEADS_DAILY5Posts (buy)
LEAD_VIEWS_DAILY_SELL50Views (sell)
LEAD_VIEWS_DAILY_BUY50Views (buy)
LEAD_ENGAGEMENTS_DAILY_SELL20Engagements (sell)
LEAD_ENGAGEMENTS_DAILY_BUY20Engagements (buy)
QUOTA_TIMEZONEAsia/KolkataIST reset boundary

Rate limiting ​

VarDefaultNotes
RATE_LIMIT_DISABLEDfalseMaster off-switch. Ignored when NODE_ENV=production. Set true on CI/QA and before load tests.
OTP_RATE_LIMIT_MAX / OTP_RATE_LIMIT_WINDOW_MS5 / 600000OTP per phone
LOGIN_PHONE_LIMIT_MAX10Consecutive failures before lockout
LOGIN_DEVICE_LIMIT_MAX20Per device
LOGIN_IP_LIMIT_MAX300Coarse shared bucket (NAT-safe)
SEARCH_RATE_LIMIT_MAX120Search

Timing & pool tuning ​

VarDefaultNotes
DATABASE_POOL_SIZE5 (raise to ~20)Connections per API process on the Supabase pooler
DATABASE_POOL_TIMEOUT10sP2024 → graceful 503
DATABASE_POOL_WARM3Connections opened at boot
LOGIN_TIMEOUT_MS3000Fast-fail a login with 503 when the pool is saturated
REFRESH_TOKEN_GRACE_MS60000Previous refresh token validity after rotation
REDIS_MAX_RETRIES_PER_REQUEST2Reconnect attempts before a queued command is flushed with an error (request-path client only; BullMQ keeps null)
REDIS_COMMAND_TIMEOUT_MS3000Command budget on a connected-but-silent socket; 0 disables

Scheduled jobs ​

VarDefaultNotes
OVERCOMMITMENT_GRACE_WINDOW_HOURS48Stock-overcommit grace
ACCOUNT_DELETION_MAX_PENDING_DAYS30Deferred-deletion ceiling
FINALIZE_PENDING_DELETIONS_CRON30 4 * * *Finalize sweep (10:00 IST)
SOFT_DELETE_RETENTION_YEARS7Retention purge window

Test/QA locks (never on production) ​

VarEffect
ENABLE_TEST_ENDPOINTS + TEST_ENDPOINT_SECRETMounts /api/v1/test/* (both required).
TEST_OTP_PHONESMatched numbers get the fixed OTP 123456, no SMS, rate-exempt. Supports trailing-* prefix wildcards.

Confirm on a running process: GET /api/v1/health → data.config shows testEndpoints and fixedOtpPhones counts.

See also: Troubleshooting · Scheduled Jobs & Workers · Security Checklist · Deployment (Railway) · External Services & Provisioning.

Internal technical documentation — Cropto