Zephra is a web-based app that delivers real-time and short-term air quality forecasts by combining NASA TEMPO satellite data with ground-based monitoring.
It's designed with a public health focus, helping communities and policymakers understand and act on air quality risks.
Currently under development
- Python 3.8+ (for backend)
- Node.js 16+ (for frontend)
- npm or yarn (package manager)
git clone https://github.com/ArjiJethin/Zephra.git
cd Zephracd backend
# Install dependencies
pip install -r requirements.txt
# Create environment file
cp .env.example .env
# Edit .env with your NASA credentials
# NASA_TOKEN=your_nasa_jwt_token_here
# NASA_USERNAME=your_nasa_username
# WAQI_API_KEY=your_waqi_key (optional)
# Start the FastAPI server (Windows)
python zephra_api.py
# Or use the batch file (Windows)
start_backend.batBackend runs on: http://localhost:5000
cd frontend
npm install
npm run dev
# Or use the batch file (Windows)
start_frontend.batFrontend runs on: http://localhost:5174
The application requires proper environment variables for security and functionality.
Create a .env file in the backend directory with:
# NASA API Configuration (Required for real data)
NASA_TOKEN=your_nasa_jwt_token_here
NASA_USERNAME=your_nasa_username
# WAQI API (Optional - used as fallback)
WAQI_API_KEY=your_waqi_api_key
# Server Configuration
DEBUG=true
LOG_LEVEL=INFO
HOST=0.0.0.0
PORT=5000
CORS_ORIGINS=http://localhost:5173,http://localhost:3000- Register at NASA Earthdata Login
- Apply for data access permissions
- Generate JWT token for API access
- Add token to your
.envfile
Security Note: Never commit .env files to version control!
- Frontend: React.js with TypeScript, Vite, Chart.js, PWA capabilities
- Backend: Python with FastAPI, async/await, NASA API integration
- Data Sources: NASA TEMPO/MERRA-2/MODIS satellites + WAQI ground stations
- Model: Enhanced location-based environmental modeling with fallback systems
- Deployment: Modern cloud deployment ready
Zephra/
โโโ backend/ # FastAPI backend server
โ โโโ zephra_api.py # Main API with NASA authentication
โ โโโ requirements.txt # Python dependencies
โโโ frontend/ # React TypeScript frontend
โ โโโ src/
โ โ โโโ components/ # Dashboard, Home, Navigation, etc.
โ โ โโโ App.tsx # Main React component
โ โ โโโ main.tsx # Entry point
โ โโโ package.json # Node.js dependencies
โ โโโ vite.config.ts # Vite with backend proxy
โโโ README.md # This documentation
- Dashboard Data:
GET /api/dashboard?location={city}or?lat={lat}&lon={lon} - Available Locations:
GET /api/locations - NASA Status:
GET /api/nasa-status
- ๐ฝ New York (40.7128, -74.006)
- ๐ผ Tokyo (35.6762, 139.6503)
- ๐ London (51.5074, -0.1278)
- ๐๏ธ Delhi (28.6139, 77.209)
- ๐ Sydney (-33.8688, 151.2093)
- ๐๏ธ Denver (39.7392, -104.9903)
- Custom coordinates supported
{
"weather": [{"timestamp": "...", "temperature": 25.5, "humidity": 65, ...}],
"air_quality": [{"timestamp": "...", "aqi": 85, "pm25": 25.3, ...}],
"satellite": [{"timestamp": "...", "visibility": 18.5, "cloud_cover": 35, ...}],
"health": [{"timestamp": "...", "overall_health_index": 7.2, ...}],
"forecast": [{"hour": "14:00", "predicted_aqi": 92, "confidence": 85}],
"status": {"api_status": "Connected", "data_freshness": 95, ...},
"location_info": {"name": "Tokyo", "coordinates": [35.6762, 139.6503], ...}
}Start with hot reload:
uvicorn zephra_api:app --reload --host 0.0.0.0 --port 5000Key Features:
- Real NASA token authentication (
eswarajiuser) - Async HTTP requests with
aiohttp - Location-specific data modeling
- Fallback systems when NASA APIs return unexpected formats
- CORS enabled for frontend development
Available scripts:
npm run dev # Development server
npm run build # Production build
npm run preview # Preview production build
npm run lint # ESLint checkingKey Features:
- TypeScript for type safety
- Chart.js for interactive visualizations
- PWA capabilities with service worker
- Responsive design with modern CSS
- Proxy configuration for backend API calls
NASA_TOKEN = "eyJ0eXAiOiJKV1QiLCJvcmlnaW4iOiJFYXJ0aGRhdGEgTG9naW4i..."
USERNAME = "eswaraji"- TEMPO:
https://disc.gsfc.nasa.gov/api- Air quality satellite data - MERRA-2:
https://goldsmr4.gesdisc.eosdis.nasa.gov/data/MERRA2- Weather reanalysis - MODIS:
https://modis.gsfc.nasa.gov/data- Satellite imagery
When NASA APIs return HTML instead of JSON (common), the system uses:
- Location-specific pollution baselines (Delhi: AQI ~180, Sydney: AQI ~45)
- Climate-based weather modeling (tropical vs arctic patterns)
- Urban vs rural environmental factors
- Seasonal adjustments (Northern vs Southern hemisphere)
# Port 5000 in use
netstat -ano | findstr :5000
taskkill /PID <PID> /F
# Missing dependencies
pip install fastapi uvicorn aiohttp requests python-multipart# Clear npm cache
npm cache clean --force
rm -rf node_modules package-lock.json
npm install
# Proxy connection issues - ensure backend is running on port 5000pip install gunicorn
gunicorn -w 4 -k uvicorn.workers.UvicornWorker zephra_api:app --bind 0.0.0.0:5000npm run build
npx serve dist๐ Real-time Environmental Data โ Live air quality, weather, satellite observations
๐จ Location-Specific Modeling โ Realistic data patterns for any global location
๐ก NASA Satellite Integration โ Authenticated TEMPO, MERRA-2, MODIS data access
๐ Interactive Visualizations โ Beautiful charts with Chart.js, color-coded AQI
๐ฉบ Health Impact Assessment โ Respiratory and cardiovascular risk analysis
๐ฎ 12-Hour Forecasting โ Predictive AQI with confidence intervals
๐ Progressive Web App โ Installable, offline-capable dashboard
โก FastAPI Performance โ Async backend with enhanced data processing
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
@Ayush Singh
@Arji Jethin Naga Sai Eswar
@Aluru Bala Karthikeya
๐ Monitor. Analyze. Act. - Making environmental data accessible to everyone.