Getting Started
Prerequisitesโ
| Tool | Version | Notes |
|---|---|---|
| Docker Desktop | โฅ 24.0 | Recommended for quickest setup |
| Docker Compose | โฅ 2.0 | Included with Docker Desktop |
| Node.js | โฅ 18 | Only for manual frontend setup |
| .NET SDK | 8.0 | Only for manual backend setup |
| Python | 3.11 | Only for manual AI server setup |
Quick Start โ Docker (recommended)โ
# 1. Clone repository
git clone https://github.com/NguyenTriBaoThang/AirSafeNet.git
cd AirSafeNet
# 2. Configure environment
cp .env.example .env
# Edit .env with your API keys
# 3. Start all services
docker compose up -d --build
Once running:
| Service | URL |
|---|---|
| Web Dashboard | http://localhost:5173 |
| Backend Swagger | http://localhost:7276/swagger |
| AI Server Docs | http://localhost:8000/docs |
| AI Health Check | http://localhost:8000/health |
To stop:
docker compose down
Manual Setupโ
Frontend (React + Vite)
cd src/airsafenet_frontend
cp .env.example .env.local
# Set VITE_API_BASE_URL=http://localhost:7276
npm install
npm run dev
# โ http://localhost:5173
Backend (ASP.NET Core 8)
cd src/airsafenet_backend
dotnet restore
dotnet ef database update
dotnet run
# โ http://localhost:7276/swagger
AI Server (FastAPI Python)
cd src/airsafenet_ai
python -m venv .venv
source .venv/bin/activate # Windows: .\.venv\Scripts\activate
pip install -r requirements.txt
# Optional โ Ensemble model support:
pip install statsmodels xgboost
cp .env.example .env
uvicorn app.api:app --reload --host 0.0.0.0 --port 8000
Place your trained model at src/airsafenet_ai/models/model.pkl
First Loginโ
- Open http://localhost:5173
- Click Register and create an account
- Go to Preferences โ set your health group (Child, Elderly, Respiratory, Pregnant, or General)
- Return to Dashboard โ the system will load the latest cached forecast
tip
On first startup, the AI Server automatically triggers a background compute cycle. This takes 3โ8 minutes. The /health endpoint reports "cache_fresh": true when ready.