Mobile App — Configuration
Everything the app needs is configured in one file — lib/src/core/config/app_config.dart — with the connection-critical values also overridable per build via --dart-define. There is no in-app settings screen for the server or realtime; this keeps the app a locked-down companion client.
All settings in one place
AppConfig (lib/src/core/config/app_config.dart):
| Setting | Default | What it does |
|---|---|---|
appName | WhatsMine | Display name across the app. |
baseUrl | https://whatsmine-demo.spagreen.net | The WhatsMine server the app connects to. Override per build with SERVER_URL. |
apiPrefix | /api/v1 | REST prefix appended to baseUrl. |
broadcastAuthPath | /broadcasting/auth | Endpoint Laravel uses to authorise private/presence channels. |
pusherKey | (empty) | Pusher/Reverb key. Empty = realtime disabled. Override with PUSHER_KEY. |
pusherCluster | mt1 | Pusher cluster. Override with PUSHER_CLUSTER. |
defaultLanguage | en | Initial UI language. Override with DEFAULT_LANG. |
supportedLanguages | en, es, fr, ar, bn | Languages shown in the in-app picker. |
deviceName | WhatsMine Agent (Flutter) | Reported to the server when issuing the Sanctum token. |
conversationsPerPage / messagesPerPage | 30 / 50 | Pagination — keep in sync with the backend. |
connectTimeout / receiveTimeout | 20s / 30s | Dio networking timeouts. |
maxAttachmentBytes | 20 MB | Max upload size — keep in sync with the backend. |
privacyPolicyUrl | … | Legal links surfaced in Settings (required for store review). |
termsUrl | … | |
supportUrl | … | |
accountDeletionUrl | … | Linked from Settings → Account & data (store policy). |
Server URL & realtime (build-time)
Edit the defaults in app_config.dart, or pass them per build so one codebase can target dev / staging / production:
flutter run \
--dart-define=SERVER_URL=https://your-domain.com \
--dart-define=PUSHER_KEY=your_pusher_key \
--dart-define=PUSHER_CLUSTER=mt1 \
--dart-define=DEFAULT_LANG=en
Realtime is optional
Leave PUSHER_KEY empty to disable realtime — the app still works via pull-to-refresh, and opening a conversation always loads the latest messages. When a key is set, the app authorises private channels through the server's /broadcasting/auth using the agent's token.
Your PUSHER_KEY / PUSHER_CLUSTER must match the server's broadcast settings (hosted Pusher or self-hosted Reverb). Configure those on the backend under Admin → Real-time Settings — see Integrations → Real-time & Push.
Legal & store links
Point these at your hosted pages before submitting to either store — they are surfaced in Settings and required for review:
static const String privacyPolicyUrl = 'https://your-domain.com/privacy-policy';
static const String termsUrl = 'https://your-domain.com/terms';
static const String supportUrl = 'https://your-domain.com/support';
static const String accountDeletionUrl= 'https://your-domain.com/account-deletion';
A starter privacy policy lives at Chat-Agent-App/docs/PRIVACY_POLICY_TEMPLATE.md.
Branding & customisation
The app ships with the WhatsMine brand (green #467235 / amber #FFBF00, sourced from the project .branding): themed UI, branded login logo, launcher icons and native splash.
| What | Where |
|---|---|
| Brand colours & theme | lib/src/core/theme/app_theme.dart |
| App name, server, legal URLs | lib/src/core/config/app_config.dart |
| Channel colours/icons | lib/src/core/constants/channels.dart |
| Logo / icon source images | assets/images/app_icon.png, assets/images/splash_logo.png |
To re-brand, replace those images + colours, then regenerate native assets:
dart run flutter_launcher_icons # app launcher icons (Android + iOS)
dart run flutter_native_splash:create # native splash screens
The display name WhatsMine Agent is set in Android AndroidManifest.xml (android:label) and iOS Info.plist (CFBundleDisplayName).
Languages (i18n)
UI strings live in lib/l10n/app_*.arb (en, es, fr, ar, bn). Agents pick a language in Settings; defaultLanguage sets the initial one. Arabic renders right-to-left automatically. To add a language, add an app_<code>.arb, list it in supportedLanguages, and run flutter pub get (codegen is on via generate: true).
Mobile API contract
The app is bound to these server endpoints (all under baseUrl + /api/v1, Bearer-token auth via Sanctum). They live in Chat-Agent-App/lib/src/core/network/api_endpoints.dart and map 1:1 to app/Http/Controllers/Api/V1/Mobile* on the server.
| Area | Method & path |
|---|---|
| Auth | POST /auth/login (public), POST /auth/logout, GET /auth/me, POST /auth/profile |
| Inbox bootstrap | GET /mobile/inbox/setup, /mobile/inbox/templates, /mobile/inbox/labels, /mobile/inbox/canned-replies |
| Conversations | GET /mobile/conversations, GET /mobile/conversations/{uuid}, GET …/{uuid}/messages, POST /mobile/conversations (start) |
| Replies & actions | POST …/{uuid}/reply, PATCH …/{uuid}/assign, PATCH …/{uuid}/status, POST …/{uuid}/typing, POST …/{uuid}/handover |
| Notes | GET …/{uuid}/notes, POST …/{uuid}/notes |
| Labels | POST …/{uuid}/labels, DELETE …/{uuid}/labels/{labelId} |
| Contacts | GET /mobile/contacts/search, GET /mobile/contacts/{id} |
| Broadcast | channels conversation.{id} / workspace.{id}; events MessageSent, MessageReceived, MessageStatusUpdated, TypingChanged, ConversationAssigned |
Demo mode
When the server runs with APP_DEMO_MODE=true, the /api/v1/mobile/* routes allow reads but block writes (replies, assigns, status changes) — the app stays a consistent read-only showcase and shows a demo banner. See Getting Started → Demo Mode.