Stock Master Tracker docs
v2.0.0
Get help
● Start · How it fits together

Architecture
who talks to whom.

The three parts you deploy (operator console, Firebase backend, mobile app) and the outside services they call. Read it once before you set anything up: most setup questions are answered by this picture.

01The diagram

Boxes with a solid border are the parts in this package. Boxes with a dashed border are outside services you open accounts for. Arrows point in the direction the request goes.

Stock Master Tracker architecture The operator console writes settings to Cloud Firestore. Cloud Functions read those settings, call market data, SEC EDGAR, RSS, AI, store and push services, and serve the v1 API. The mobile app calls only the v1 API and Firebase Authentication, and receives push through Firebase Cloud Messaging. Operator consoleadmin/ (Node, you host it) Cloud Firestoreconfig/public, config/private, users Cloud Functionsapi (/v1) and 4 scheduled jobskeys live here only Mobile appapp/ (Flutter) Firebase Auth and FCM Finnhub, Twelve Data SEC EDGAR RSS news feeds AI provider (optional) Google Play, App Store writes settingsGET/POST /v1 (HTTPS)sign-in, push
The app talks to your API and Firebase only. It never holds a data-provider, AI or store key.

02What happens when a user opens a company

  1. The app asks your APIGET /v1/stocks/AAPL. The app signs in anonymously with Firebase in the background.
  2. The licence gateIf you have not confirmed in the console that your data plan allows public display, the API answers 503 provider_not_licensed and the app shows "Prices are not connected yet". SEC data is not behind the gate.
  3. Routing and cacheThe API serves a cached answer if it is fresh; otherwise it calls the provider you routed for that capability, then the other one if fallback is on, and counts the call against your budget. If every provider fails it serves the last cached value marked stale, or answers 503 upstream_unavailable.
  4. Filings and insider tradesCome from SEC EDGAR with the contact you entered.

03The scheduled jobs

FunctionScheduleWhat it does
apiHTTPSThe whole /v1 API (512 MiB, 60 s).
evaluateAlertsevery 5 minutesChecks every active alert and sends the push.
refreshNewsevery 15 minutesFetches the RSS feeds, keeps headlines and links for 7 days, tags them with tickers.
refreshBriefevery 60 minutesRegenerates the AI market brief per language when it is older than your interval (only with AI on and a key).
sendCampaignsevery 5 minutesSends due push campaigns created in the console. The only sender.

Source: firebase/functions/src/index.ts.

04Where settings live

  • config/public: what the app may read (name, accent colour, features, ad ids, product ids, labels). Served by GET /v1/config.
  • config/private: keys and budgets only Cloud Functions read. No client can read it (firebase/firestore.rules).
  • The console is the only writer of both. Changes reach the app the next time it starts, because the API caches the config for about a minute.