An AI-powered solar energy planning tool that helps users analyze solar potential for any location, estimate energy production, and calculate ROI.
- Location Analyzer: Search any address or click on a map to get detailed solar production estimates
- Interactive Charts: View monthly energy production, solar radiation, and payback analysis
- AI Chatbot: Ask questions about solar energy and get data-driven answers
- Heat Map: Visualize solar potential across regions
solstice/
├── backend/ # Python FastAPI server
│ ├── api.py # Main API endpoints
│ ├── solar_lookup.py # NREL PVWatts integration
│ ├── chatbot/ # Gemini AI chatbot
│ └── requirements.txt # Python dependencies
├── solar1-ai/ # React frontend
│ ├── src/
│ │ ├── pages/ # Page components
│ │ └── components/ # Shared components
│ └── package.json # Node dependencies
└── README.md
- Python 3.9+
- Node.js 16+ and npm
- API Keys:
- NREL API Key (free) - for solar data
- Google Gemini API Key (free) - for AI chatbot
git clone https://github.com/darkeneddd/solstice.git
cd solsticecd backend
pip3 install -r requirements.txtOr install manually:
pip3 install fastapi uvicorn python-dotenv requests pydantic google-generativeaiCreate a .env file in the backend/ folder:
# backend/.env
NREL_API_KEY=your_nrel_api_key_here
GEMINI_API_KEY=your_gemini_api_key_here- Get your free NREL API key at: https://developer.nrel.gov/signup/
- Get your free Gemini API key at: https://makersuite.google.com/app/apikey
cd backend
python3 -m uvicorn api:app --reload --port 8002The API will be available at http://localhost:8002
cd solar1-ai
npm installnpm startThe app will open at http://localhost:3000
| Endpoint | Method | Description |
|---|---|---|
/api/solar |
GET | Get solar data for a location (by name or coordinates) |
/api/geocode |
GET | Convert address to coordinates |
/api/chat |
POST | Chat with the AI assistant |
/api/solar/batch |
GET | Get solar data for multiple locations |
Get solar data by location name:
curl "http://localhost:8002/api/solar?location=Atlanta,GA&system_kw=4"Get solar data by coordinates:
curl "http://localhost:8002/api/solar?lat=33.749&lon=-84.388&system_kw=4"Chat with AI assistant:
curl -X POST "http://localhost:8002/api/chat" \
-H "Content-Type: application/json" \
-d '{"message": "Which city is better for solar?", "locations": ["Atlanta, GA", "Seattle, WA"]}'Use Python module syntax instead:
python3 -m uvicorn api:app --reload --port 8002Another process is using the port. Try a different port:
python3 -m uvicorn api:app --reload --port 8003Your NREL API key is missing or invalid. Check your .env file.
Make sure:
google-generativeaiis installed:pip3 install google-generativeai- Your
GEMINI_API_KEYis set in.env - Restart the backend after changing
.env
- Frontend: React, Leaflet (maps), Recharts (charts)
- Backend: FastAPI, Python
- APIs: NREL PVWatts (solar data), Google Gemini (AI)