Skip to main content

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โ€‹

ValueDescription
normalGeneral population
childChildren (higher breathing rate)
elderlyElderly (reduced lung function)
respiratoryAsthma, COPD, bronchitis
pregnantPregnant 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.