Configuration
Environment Variablesโ
Copy .env.example to .env and fill in:
# โโ Database โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
POSTGRES_USER=airsafenet
POSTGRES_PASSWORD=your_strong_password
# โโ JWT Auth โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
JWT_SECRET=your_min_32_char_secret_key
# โโ Admin key โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ADMIN_KEY=your_admin_key
# โโ External APIs โโโโโโโโโโโโโโโโโโโโโโโโโ
OPENAQ_API_KEY=your_openaq_key
# Open-Meteo: Free, no key needed
# โโ Notifications โโโโโโโโโโโโโโโโโโโโโโโโโ
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your@gmail.com
SMTP_PASS=your_app_password
# โโ Frontend โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
VITE_API_BASE_URL=http://localhost:7276
Health Groupsโ
| Value | Description |
|---|---|
normal | General population |
child | Children (higher breathing rate) |
elderly | Elderly (reduced lung function) |
respiratory | Asthma, COPD, bronchitis |
pregnant | Pregnant women |
Notification Thresholdsโ
Users can set their personal AQI alert threshold (0โ500) in Preferences. The system sends alerts when PM2.5-derived AQI exceeds this value.
Default threshold: 100 (Unhealthy for Sensitive Groups)
AI Server Configโ
Key constants in src/airsafenet_ai/app/config.py:
LAT = 10.8231 # Ho Chi Minh City latitude
LON = 106.6297 # Ho Chi Minh City longitude
HISTORY_HOURS = 72 # Hours of history used for prediction
To deploy for another city, change LAT and LON โ the model adapts automatically.