Configuration
Configuration lives in three places: environment variables (build time),
src/config/* (source defaults) and the Settings screens (runtime, per browser,
stored in localStorage).
Runtime settings win over source defaults. Source defaults win over nothing — they are the defaults every new user sees.
Environment variables
Copy .env.example to .env.local. Every variable is NEXT_PUBLIC_, which
means it is embedded in the browser bundle — never put secrets in them.
| Variable | Default | Purpose |
|---|---|---|
NEXT_PUBLIC_APP_NAME |
Numeralens |
Product name in titles and help |
NEXT_PUBLIC_API_URL |
(empty) | Backend base URL; empty uses the demo API routes |
NEXT_PUBLIC_ENABLE_DEMO_MODE |
true |
false routes all data through the HTTP adapter |
NEXT_PUBLIC_AUTH_MODE |
demo |
demo, bearer or cookie |
NEXT_PUBLIC_MOCK_LATENCY_MS |
350 |
Artificial latency so loading states are visible |
NEXT_PUBLIC_DEFAULT_CURRENCY |
USD |
Formatting default |
NEXT_PUBLIC_DEFAULT_TIMEZONE |
UTC |
Reporting timezone default |
NEXT_PUBLIC_DEFAULT_LOCALE |
en-US |
Number and date locale default |
Read into a typed object in src/config/app.config.ts.
Server-only (not NEXT_PUBLIC_):
| Variable | Default | Purpose |
|---|---|---|
SITE_URL |
(Vercel: deployment URL) | Public base URL, e.g. https://dash.example.com, so link-share images resolve. Required when self-hosting. |
Config files
| File | Controls |
|---|---|
src/config/app.config.ts |
Environment-derived settings, request timeout |
src/config/branding.ts |
Company name, logo, colours, currency, formats, landing page |
src/config/features.ts |
The 17 feature flags and their descriptions |
src/config/roles.ts |
Roles, permissions and the role→permission matrix |
src/config/navigation.ts |
Sidebar structure and the route→feature-flag map |
Feature flags
enableRevenue enableExpenses enableProfitability
enableCashFlow enableReports enableCustomers
enableVendors enableTransactions enableBudget
enableForecast enableInventory enableCustomDashboard
enableExport enableNotifications enableGlobalSearch
Turning a flag off does three things: the navigation entry disappears, the route
renders a "module is turned off" screen (via the route→feature map in
navigation.ts), and related widgets stop being offered in the widget library.
Change the shipped defaults in src/config/features.ts; end users toggle them at
Settings → Modules and Settings → Feature flags.
To remove a module permanently, delete its folder under src/app/, its entry
in navigation.ts and its flag.
Runtime settings and storage keys
All persisted under localStorage, namespaced so they are easy to clear:
| Key | Written by |
|---|---|
numeralens.branding.v1 |
Settings → Branding |
numeralens.features.v1 |
Settings → Modules / Feature flags |
numeralens.api.v1 |
Settings → Data source |
numeralens.filters.v1 |
The global filter bar |
numeralens.auth.v1 |
Demo auth provider (sign-in state and role) |
numeralens.custom-dashboard.v1 |
Custom dashboard layout |
numeralens.notification-prefs.v1 |
Settings → Notifications |
numeralens.sidebar.collapsed |
Sidebar collapse toggle |
Clearing site data resets the app to the values in src/config/*.
To persist these server-side instead, replace useLocalStorage in the relevant
provider with a query plus mutation against your API — the rest of the UI reads
from context and does not care where the value came from.