πŸ“¦ Nepal AQI early-warning β€” package summary

βœ… What you have

Source code (GitHub β€” recommended)

Repository: https://github.com/mamta2009/aqinepal2026

git clone https://github.com/mamta2009/aqinepal2026.git
cd aqinepal2026/early-warning-system

Documentation for behaviour and APIs: IMPLEMENTATION_SNAPSHOT.md (this folder).
Hands-on Cursor walkthrough: CURSOR_SETUP_GUIDE.md β€” same /guides URLs as the running site.

Optional ZIP delivery

An early-warning-system.zip (if someone shared one) mirrors the early-warning-system/ folder: backend, landing/ (marketing /guides via guides.html, /registration, /admin/dashboard), frontend/, config/, docs/ (guides under docs/guides/).


πŸš€ Getting started (~10 minutes)

git clone https://github.com/mamta2009/aqinepal2026.git
cd aqinepal2026/early-warning-system/backend
python -m venv .venv && source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env β€” Mongo keys, AQ keys, NOTIFICATION_API_KEY, etc.

python -m uvicorn main:app --reload --host 127.0.0.1 --port 8000

Use http://127.0.0.1:8000 in the browser (avoid http://0.0.0.0:8000 β€” often blank).

Page URL
Marketing landing http://127.0.0.1:8000/
Guides hub http://127.0.0.1:8000/guides
Registration http://127.0.0.1:8000/registration
Dashboard http://127.0.0.1:8000/frontend/index.html
Operator admin http://127.0.0.1:8000/admin/dashboard
OpenAPI http://127.0.0.1:8000/docs

πŸ“š Documentation index (in-repo)

File Purpose
README.md Repository root β€” points into early-warning-system/
../../README.md App early-warning-system/README.md stub (links here)
IMPLEMENTATION_SNAPSHOT.md Canonical APIs, env, Mongo, AQ resolver, /api/admin/*
CURSOR_SETUP_GUIDE.md Cursor-centric setup
README.md Guides index β€” lists every docs/guides/*.md topic
blockchain-ai/README.md Polygon / on-chain Markdown (companion docs/blockchain-ai/*.py stubs)
../blockchain-ai/README.md Short pointer from docs/blockchain-ai/ into this folder

Older β€œ/outputs” or duplicate guides elsewhere may exist from packaging history; IMPLEMENTATION_SNAPSHOT.md wins when wording conflicts with the running code.


βœ… What runs out of the box


πŸ“‹ Repository layout (app tree)

early-warning-system/
β”œβ”€β”€ backend/           ← main.py, admin_panel.py, notifications_api.py, …
β”œβ”€β”€ landing/           ← landing.html, guides.html, registration_portal.html, admin_dashboard.html
β”œβ”€β”€ frontend/index.html
β”œβ”€β”€ config/.env.example
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ guides/                    ← Every public Markdown file + `/guides/md/…` rendering
β”‚   β”œβ”€β”€ tech/*.svg                 ← Architectural diagrams (/guides/media/tech/…)
β”‚   └── blockchain-ai/             ← Reference Python only (guides live under docs/guides/blockchain-ai/)
β”œβ”€β”€ docs-private/                  ← Internal markdown β€” `/admin/dashboard` β†’ Private documentation
β”œβ”€β”€ render.yaml
└── README.md

⚑ Smoke test (quick)

curl http://127.0.0.1:8000/api/health
curl http://127.0.0.1:8000/api/cases/week/Kathmandu
curl "http://127.0.0.1:8000/api/air-quality/current?city=Kathmandu"

πŸ“€ Deploy

  1. Repo is already on GitHub: mamta2009/aqinepal2026. Fork or mirror to a private repo if you must exclude materials under docs-private/ from publication.
  2. Connect Render (or another host): run uvicorn from early-warning-system/backend with production env vars. See early-warning-system/render.yaml as a starting blueprint.
  3. Hosting cost depends on provider and tiers β€” size the service to traffic and MongoDB separately.

πŸ”§ Troubleshooting (short)

Problem Fix
β€œModule not found” Activate backend/.venv; pip install -r backend/requirements.txt
Port 8000 in use python -m uvicorn main:app --reload --host 127.0.0.1 --port 8001
Blank browser page Use 127.0.0.1 or localhost, not 0.0.0.0
CORS Prefer http://127.0.0.1:8000/frontend/index.html (same origin as API)
Admin JSON 401 / 403 Set NOTIFICATION_API_KEY in backend/.env; send Authorization: Bearer …

🎯 Realistic demo data vs production

Weekly case curves are synthetic WHO-style patterns suitable to prove dashboards and alerting β€” not a substitute for ministry surveillance until you swap the pipeline. See IMPLEMENTATION_SNAPSHOT.md for what is keyed vs heuristic.


Last aligned with docs: May 2026 (repository aqinepal2026, branch main). Update this file if the canonical snapshot or URLs change.