Guides & technical diagrams
Written guides (Markdown) plus architecture diagrams (docs/tech/) for the Nepal respiratory early-warning stack. Older bookmark /documentation redirects here; partner-internal Markdown lives under Admin → Private documentation.
Public markdown guides
Open in the browser while the API is running (rendered HTML). Sources live under docs/guides/ — all non-private Markdown is stored there.
Note: Restricted UNICEF/strategy drafts stay in docs-private/ — they are not linked here; operators open them from Admin → Private documentation after unlocking the dashboard.
Architecture
Tech diagrams live in docs/tech/ on disk and are exposed at /guides/media/tech/…. Concept framing SVGs ship under landing/assets/diagrams/ (/landing-assets/diagrams/…).
End-to-end platform
Backend & hosted stack (FastAPI, MongoDB, Render)
Frontend tiers
Notification & alert flow
This matches the running backend: notifications_api.py, twilio_notify.py, db_state.py, and MongoDB (early_warning). Outbound SMS/WhatsApp use Twilio; email uses SendGrid when configured. There is no built-in timer from air quality to broadcast—an external job or operator calls POST /api/alerts/broadcast when you want automated escalation.
Concept graphics
Blockchain & verification
Two layers are implemented in this codebase:
- Cryptographic anchoring (always safe): payload digests and optional EIP-191-style signing in blockchain_integration.py. Shown on API responses as verification so exports can be checked for tampering.
- Optional Polygon transactions (off by default): hashed “alert / action / outcome” events are written via onchain_logger.py when POLYGON_ONCHAIN_LOG=true. The bridge module onchain_hooks.py calls these APIs from real product flows (air/heat broadcasts, facility POST /api/action-log) and records every attempt in MongoDB onchain_anchor_log. Each successful write costs testnet or mainnet gas.
Operator verification (not on the public users page): open GET /admin/dashboard → Polygon section → Refresh blockchain overview, Load recent anchors, and Send test on-chain touch (one minimal on-chain transaction to prove signer + RPC). On mainnet, that smoke test spends real POL; use Amoy first.
Environment variables (on-chain path)
- POLYGON_ONCHAIN_LOG=true — turn on the optional transaction logger at API startup.
- POLYGON_PRIVATE_KEY — funded wallet key (never commit; use secrets in production).
- BLOCKCHAIN_ONCHAIN_NETWORK=amoy (recommended testnet), mumbai (deprecated), or mainnet (live ledger — real POL).
Full operator route list: docs/guides/IMPLEMENTATION_SNAPSHOT.md → Operator admin → Polygon / /api/admin/blockchain/*.
Free test “coins” on Polygon
On testnets, tokens are worthless play money used to pay gas while you experiment. They are minted by faucets, not purchased.
- Install a wallet (e.g. MetaMask) and create a dedicated developer wallet—never reuse a main wallet loaded with real funds.
- Add the correct test network to your wallet (historically Mumbai 80001; increasingly Amoy 80002).
- Visit an official/community faucet, connect the wallet, and request test MATIC.
- Wait for the transaction to arrive, then retry your API with POLYGON_ONCHAIN_LOG=true.
Examples of faucet entry points (verify current URLs with Polygon documentation):
- Polygon faucet hub (faucet.polygon.technology)
- Mumbai Polygonscan (explorer for legacy Mumbai txs—if still supported)
- Polygonscan (explorers and network tools)
APIs & operations
Operational checks
- GET /api/health — API up; mongodb_persistence when MongoDB is wired; notification_registry when the full DB handle is active for contacts/alerts.
- GET /api/runtime-config — public config + integration flags (including Twilio / email provider readiness where implemented).
Weather and optional LLM proxies are documented in Swagger once your server is running.