Installation
from the zip to your phone.
The full path: your Firebase backend, the operator console, then the app on an Android or iOS device, built against your own API.
01What is in the package
Every path and command in these docs starts in the source/ folder of the download.
| Folder | What it is |
|---|---|
app/ | The Flutter app. Screens in app/lib/ui/, design in app/lib/sm/, ads in app/lib/ads/, purchases in app/lib/iap/, texts in app/lib/l10n/app_*.arb, Android widgets in app/android/app/src/main/kotlin/, the iOS widget in app/ios/StockMasterWidget/. |
firebase/ | Cloud Functions, Firestore rules and indexes. |
admin/ | The operator console. |
docs/ | The API contracts. |
tool/ | check_ad_ids.sh, the ad-id check (Ads). |
02The order
- Data accountsGet your Finnhub and/or Twelve Data key on a plan that allows public display, and decide your SEC contact. Market data
- Firebase backendCreate the project, upgrade to Blaze, enable Anonymous sign-in and Firestore, deploy. You get your
API_BASE_URL. Firebase backend - Operator consoleRun it with a service account, create the owner, set legal URLs and the market-data section. Operator console
- Your idsChoose your app name, Android application id, iOS bundle id and App Group before you connect the app to Firebase. Rebranding
- The appBelow.
03Connect the app to Firebase
The app ships with a placeholder app/lib/firebase_options.dart (project id demo-stockmaster). While it is in place, a normal build shows a "Connect your Firebase project" screen instead of the app. Replace it with your project's values:
dart pub global activate flutterfire_cli
cd app
flutterfire configure --project=<your-project-id> # choose android and ios
FlutterFire registers the Android and iOS apps with the application id and bundle id it finds in the project, rewrites lib/firebase_options.dart and adds android/app/google-services.json and ios/Runner/GoogleService-Info.plist. That is why you change the ids first. The package ships none of these files.
The app signs every user in anonymously in the background; nothing else is needed for it to work. Users can also sign in with Google, Apple or e-mail to sync across devices. Each method is switched on in Firebase Authentication and can be switched off in the console (Sign-in methods). Google on Android needs the SHA-1 and SHA-256 of your signing key in Firebase. Sign in with Apple needs the capability in Xcode and the Apple provider in Firebase; keep it on if Google is on (App Store rule 4.8).
04Run the app on a device
cd app
flutter pub get
flutter run --dart-define=API_BASE_URL=https://us-central1-<your-project-id>.cloudfunctions.net/api
Use your region. No trailing slash. See API_BASE_URL.
Build switch (--dart-define) | Meaning |
|---|---|
API_BASE_URL=<url> Required | Your backend. Empty shows the setup screen (except in the example build). |
DEMO_MODE=true | Example data: no Firebase, no network, simulated ads and purchases. Not for store builds. |
USE_EMULATOR=true | Use the local Firebase Auth and Firestore emulators. Never ship it. |
EMULATOR_HOST=<ip> | With USE_EMULATOR: your computer's address. Default 10.0.2.2 on the Android emulator, localhost elsewhere. |
Source: app/lib/core/env.dart, app/lib/core/firebase_setup.dart.
The app opens on Today, the index strip loads (or says "Prices are not connected yet" until you confirmed the display licence), and in the console the Status page lists your app's config as written.
05iOS specifics (Mac)
- Open the workspace
app/ios/Runner.xcworkspacein Xcode (not the.xcodeproj). - SigningThe project ships with no signing team. Choose yours for both targets, Runner and StockMasterWidget.
- PodsThe Podfile sets iOS 15.0 and raises any pod below it to 15.0. If a pod install complains,
cd app/ios && pod install --repo-update. - CapabilitiesPush Notifications, Background Modes (Remote notifications), Sign in with Apple and the App Group are already declared in
Runner.entitlements; check them after you change the bundle id.
06Local Firebase emulators (optional)
cd firebase/functions
npm ci
npm run serve # auth 9099, firestore 8080, functions 5001; project demo-stockmaster
The emulators accept any project id, so a mismatch between the console, the API and the app shows no error, only empty data: use demo-stockmaster everywhere (the placeholder firebase_options.dart and the console's default with FIRESTORE_EMULATOR_HOST already do). The scheduled jobs are listed but not triggered by the emulator. Needs Java 21 or newer.