Skip to main content

Getting Started

Prerequisitesโ€‹

ToolVersionNotes
Docker Desktopโ‰ฅ 24.0Recommended for quickest setup
Docker Composeโ‰ฅ 2.0Included with Docker Desktop
Node.jsโ‰ฅ 18Only for manual frontend setup
.NET SDK8.0Only for manual backend setup
Python3.11Only for manual AI server setup

# 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:

ServiceURL
Web Dashboardhttp://localhost:5173
Backend Swaggerhttp://localhost:7276/swagger
AI Server Docshttp://localhost:8000/docs
AI Health Checkhttp://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โ€‹

  1. Open http://localhost:5173
  2. Click Register and create an account
  3. Go to Preferences โ†’ set your health group (Child, Elderly, Respiratory, Pregnant, or General)
  4. 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.

Next Stepsโ€‹