● 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.
02What happens when a user opens a company
- The app asks your API
GET /v1/stocks/AAPL. The app signs in anonymously with Firebase in the background. - The licence gateIf you have not confirmed in the console that your data plan allows public display, the API answers
503 provider_not_licensedand the app shows "Prices are not connected yet". SEC data is not behind the gate. - 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 answers503 upstream_unavailable. - Filings and insider tradesCome from SEC EDGAR with the contact you entered.
03The scheduled jobs
| Function | Schedule | What it does |
|---|---|---|
api | HTTPS | The whole /v1 API (512 MiB, 60 s). |
evaluateAlerts | every 5 minutes | Checks every active alert and sends the push. |
refreshNews | every 15 minutes | Fetches the RSS feeds, keeps headlines and links for 7 days, tags them with tickers. |
refreshBrief | every 60 minutes | Regenerates the AI market brief per language when it is older than your interval (only with AI on and a key). |
sendCampaigns | every 5 minutes | Sends 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 byGET /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.