# NasaSpaceApp
🚀 Space Weather Alerts for Farmers (S.W.A.F.)
S.W.A.F. is a comprehensive monitoring system designed to protect farmers' investments by translating complex NASA and NOAA space weather data into localized, actionable alerts delivered via WhatsApp.
🌟 Key Features
Three-Source Data Aggregation: Combines data from \text{NOAA} (\text{Kp} index), \text{NASA} \text{FLR} (Flares), and \text{NASA} \text{CME} (Coronal Mass Ejections) for accurate risk scoring.
Actionable Alerts: Sends customized, localized messages (e.g., Malayalam) instructing farmers on how to protect \text{GPS} systems and power backups.
Continuous Monitoring: Backend runs every 5 minutes using the schedule module.
Full-Stack Solution: Includes a backend data engine and a simple, live web dashboard.
đź› Setup and Execution Guide
Follow these steps to get the project running on your local machine.
1. Prerequisites
You must have Python 3 and pip installed.
2. Install Dependencies
Install all required Python packages using pip:
pip install requests twilio python-dotenv Flask schedule
3. Configuration (The .env File)
NEVER SUBMIT YOUR ACTUAL .env FILE!
Create a file named .env in the root directory.
Fill it with your credentials (obtained from \text{Twilio} and \text{api.nasa.gov}):
4. Launching the System (Two-Terminal Process)
The system requires two separate commands run in two different PowerShell/CMD windows to operate the backend and the frontend simultaneously.
Ensure both terminal windows are in the project folder: C:\Users\...\space_alert_bot>
Step 4A: Launch the Backend (Data Monitor)
The backend calculates risk and updates the status.json file every 5 minutes.
In Terminal 1, run:
python space_alert_bot.py
Output: The script will confirm it's entering the Continuous Monitoring Loop.
Action: If the risk level changes, a message will be sent to the configured \text{WhatsApp} number.
Step 4B: Launch the Frontend (Web Dashboard)
The frontend starts the web server that reads the status.json …