Will It Rain On My Parade? - An intelligent weather analysis application powered by NASA data and Google Gemini AI
- Overview
- Features
- Tech Stack
- Project Structure
- Prerequisites
- Installation
- Configuration
- Running the Application
- API Documentation
- Deployment
- Contributing
- License
NASA WeatherSense is a comprehensive weather analysis platform that combines NASA's weather data with Google's Gemini AI to provide intelligent weather predictions and insights. The application helps users make informed decisions by analyzing weather conditions for specific locations and dates.
This project was developed for the NASA Space Apps Challenge, focusing on making weather data accessible and actionable for everyday users.
- πΊοΈ Interactive Location Selection - Choose any location worldwide using Mapbox integration
- π Date-based Weather Analysis - Get weather predictions for specific dates
- π€ AI-Powered Insights - Leverages Google Gemini AI for intelligent weather analysis
- π Historical Trends - Visualize weather patterns with interactive charts
- π‘οΈ Comprehensive Weather Data - Temperature, precipitation, humidity, wind speed, and more
- π± Responsive Design - Works seamlessly across desktop, tablet, and mobile devices
- β‘ Real-time Updates - Fast and efficient data processing
- π¨ NASA-themed UI - Beautiful space-inspired design elements
- React 19.2 - Modern UI library with latest features
- TypeScript 5.9 - Type-safe development
- Vite 7.1 - Lightning-fast build tool
- D3.js & Recharts - Interactive data visualizations
- Mapbox GL - Interactive maps for location selection
- Axios - HTTP client for API requests
- date-fns - Modern date utility library
- Node.js & Express 5.1 - Server framework
- TypeScript 5.6 - Type-safe backend development
- Google Gemini AI - Advanced AI capabilities
- Visual Crossing Weather API - Real weather data and statistical forecasts
- Axios - HTTP client for API requests
- CORS - Cross-origin resource sharing
- dotenv - Environment variable management
- Google Search Grounding - Real-time web data integration for accurate weather insights
- ESLint - Code quality and consistency
- Jest - Unit testing framework
- Playwright - End-to-end testing
- Nodemon - Auto-reload during development
NASA-WeatherSense/
βββ backend/ # Express.js backend server
β βββ src/
β β βββ config/ # Configuration files
β β βββ controllers/ # Request handlers
β β βββ routes/ # API route definitions
β β βββ services/ # Business logic (Gemini AI)
β β βββ types/ # TypeScript type definitions
β β βββ server.ts # Main server file
β βββ .env.example # Environment variables template
β βββ package.json # Backend dependencies
β βββ tsconfig.json # TypeScript configuration
β
βββ frontend/ # React + Vite frontend
β βββ public/ # Static assets
β βββ src/
β β βββ components/ # React components
β β β βββ common/ # Reusable components
β β β βββ date/ # Date picker component
β β β βββ location/ # Location selector
β β β βββ trends/ # Chart components
β β β βββ weather/ # Weather display components
β β βββ pages/ # Page components
β β βββ services/ # API service layer
β β βββ styles/ # Global styles
β β βββ types/ # TypeScript types
β β βββ utils/ # Utility functions
β β βββ App.tsx # Main App component
β β βββ main.tsx # Application entry point
β βββ .env.example # Environment variables template
β βββ package.json # Frontend dependencies
β βββ vite.config.ts # Vite configuration
β βββ tsconfig.json # TypeScript configuration
β
βββ README.md # This file
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher) - Download
- npm or yarn - Package manager
- Git - Version control
You'll also need API keys for:
- Google Gemini API - Get API Key
- Mapbox API - Get API Key
-
Clone the repository
git clone https://github.com/thrkingunknown/NASA-WeatherSense.git cd NASA-WeatherSense -
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd ../frontend npm install
-
Navigate to the
backenddirectory -
Copy
.env.exampleto.env:cp .env.example .env
-
Edit
.envand add your credentials:PORT=3001 GEMINI_API_KEY=your_gemini_api_key_here VISUAL_CROSSING_API_KEY=your_visual_crossing_api_key_here ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000
Get API Keys:
- Gemini AI: Get API Key
- Visual Crossing: Get API Key (Free tier: 1000 records/day)
π Visual Crossing Integration: See VISUAL_CROSSING_INTEGRATION.md for detailed documentation.
-
Navigate to the
frontenddirectory -
Copy
.env.exampleto.env:cp .env.example .env
-
Edit
.envand add your credentials:VITE_MAPBOX_API_KEY=your_mapbox_api_key_here VITE_API_BASE_URL=http://localhost:3001
-
Start the backend server (in the
backenddirectory):npm run dev
The backend will run on
http://localhost:3001 -
Start the frontend development server (in the
frontenddirectory):npm run dev
The frontend will run on
http://localhost:5173 -
Open your browser and navigate to
http://localhost:5173
-
Build the backend:
cd backend npm run build npm start -
Build the frontend:
cd frontend npm run build npm run preview
http://localhost:3001/api
GET /api/healthResponse:
{
"status": "ok",
"timestamp": "2025-10-04T12:00:00.000Z"
}GET /api/weather?latitude={lat}&longitude={lon}&date={DD-MM-YYYY}Parameters:
latitude(required): Latitude coordinate (-90 to 90)longitude(required): Longitude coordinate (-180 to 180)date(required): Date in DD-MM-YYYY format
Example Request:
GET /api/weather?latitude=40.7128&longitude=-74.0060&date=15-10-2025Response:
{
"success": true,
"data": {
"location": {
"latitude": 40.7128,
"longitude": -74.006
},
"date": "15-10-2025",
"analysis": "AI-generated weather analysis",
"conditions": {
"temperature": 20,
"precipitation": 30,
"humidity": 65,
"windSpeed": 15
}
}
}- Set environment variables in your hosting platform
- Update
ALLOWED_ORIGINSto include your frontend URL - Deploy the
backenddirectory
- Update
.env.productionwith production API URL - Build the project:
npm run build - Deploy the
distfolder
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the ISC License.
- NASA - For providing access to weather data and inspiring this project
- Google Gemini AI - For advanced AI capabilities
- Mapbox - For interactive mapping features
- NASA Space Apps Challenge - For the opportunity to build this application
For questions or support, please open an issue on GitHub.
Made with β€οΈ for the NASA Space Apps Challenge
β Star this repository if you find it helpful!