Configuration reference

config/brand.json (app)

This file is read at build time through app.config.js and exposed to the code through src/config/index.js. Restart Expo (npx expo start -c) after you change it.

Key Example What it does
appName "Acme Field" Name on the home screen, login, notifications and web title
slug "acme-field" Expo project slug (lowercase, dashes)
bundleId "com.acme.field" iOS bundle identifier and Android package. Set it before your first store build and never change it after
primaryColor "#075E54" Android notification accent. The in-app palette is in src/ui/theme.js
companyName "Acme Agri" Used in labels such as "All Acme Agri"
countryName "United States" Label for the company-wide scope. Must equal app_settings.national_label
currency "USD", "$", "€" Shown next to every amount. Amounts are stored as plain numbers in one currency
utcOffsetMinutes -300 Offset the app uses for "today" (fleet periods, expense dates). New York in winter is -300
phoneCountryCode "1" Used for WhatsApp/call links when a number is stored in local format
loginPlaceholder "name@company.com" Hint in the login field
roleLabels {"AL":"Field Rep"} Display names for the built-in role codes (see Roles)
provinces ["East","West"] Top-level regions, in display order. Must match areas.province_name
provinceLabel "State" What to call that level in the UI
paymentInstitutions ["Chase","Wells Fargo"] Bank/payment choices on the Payments screen ("Other" is always added)
paymentPolicies ["Spring promo"] Quick-pick scheme names on the Payments screen (optional)
fleetModuleName "Fleet" Name of the fleet module tab
plateRegion "TX" Small text on the number-plate badge (defaults to countryName)
excludedAreas ["Vacant 3"] Area names hidden from pickers and leaderboards
secondaryLanguage null or "ur" null = English only. The built-in second-line strings are Urdu; for another language, replace the strings passed to ur()
poweredBy "" Optional footer line on the login screen
easProjectId, easUpdatesUrl from eas init Expo build and over-the-air update settings

public.app_settings (database)

Key Default Meaning
timezone UTC IANA timezone for "today", monthly periods, season boundaries and reminder logic
national_label National Company-wide scope name in the dashboard views. Equals countryName
functions_url empty https://<ref>.supabase.co/functions/v1. Push stays off until this is set; in-app notifications still work
phone_country_code empty Digits only. Phone numbers starting with 0 are stored as <code><number> for duplicate detection
webhook_secret random 64-char value Shared with the Edge Function (WEBHOOK_SECRET). Signed-in users can't read it

Change them with update public.app_settings set value = '...' where key = '...';.

Roles

Role codes are fixed in the database. Only their display names are configurable.

Code Default label Sees
AL Field Rep Own area: plans, visits, payments, orders
TL Team Lead Their region
BL Business Lead Their region
KM Key Account Manager Their province; KM posts get their own activity-feed tab
ADMIN Admin Everything, plus user management
DIRECTOR Director Everything
ACCOUNTS Accounts Payment validation and creation
LOGISTICS Logistics Orders and dispatch

Each user's province, region_label and area_name in public.users decide their scope.

Geography

The hierarchy is province → region → area, stored in public.areas (province_name, region_name, area_name). Add rows there (or through Admin) and assign field reps to areas in al_areas.

Seasons and targets

Sales seasons default to S1 = Jan–Apr, S2 = May–Aug and S3 = Sep–Dec (public.seasons). Targets are set per national, province, region or area scope by year and season, from the Admin screen.