Azerbaijan Sustainable Energies Hub — a multi-language renewable energy platform for Azerbaijan featuring a solar panel calculator, renewable energy news aggregator, regulatory framework tracker, and project listings.
- Solar Calculator — PVGIS-powered system sizing with lead capture and AI analysis (OpenAI GPT-4o-mini)
- News Aggregator — Live scraping from area.gov.az, minenergy.gov.az, and renewables.az
- Regulatory Framework — Azerbaijan energy law index
- Projects Map — Active, in-progress, and completed renewable energy projects
- Multi-language — English / Azerbaijani / Russian
- Dark / Light mode
- Deploy to Vercel. The Solar Calculator uses three serverless API routes:
/api/pvgis— Proxies requests to PVGIS (no env var required)./api/ai-analysis— Calls OpenAI for AI insights. SetOPENAI_API_KEYin the Vercel project (Settings → Environment Variables). If unset, AI analysis will show "not configured"./api/solar-calculator-submit— Stores submitted phone numbers and calculator data. SetPOSTGRES_URLorDATABASE_URLto enable database writes.
- No
env-config.jsis needed on Vercel; secrets stay in Vercel env.
- Clone the repo.
- Serve with any static server (e.g.
python3 -m http.server 8080ornpx serve .). - For PVGIS: use a local proxy or run the Vercel dev server (
vercel dev) so/api/pvgisis available; otherwise the calculator will fall back to the Azerbaijan average and show a note. - For AI analysis: either set
OPENAI_API_KEYwhen runningvercel dev, or the UI will show that AI analysis is not configured.
Note: The site must be served (not opened as
file://) forfetch()calls to work.
Vanilla HTML / CSS / JavaScript — no framework, no build step.
External APIs: PVGIS (solar data via /api/pvgis proxy), OpenAI GPT-4o-mini (AI analysis via /api/ai-analysis; key from Vercel env), allorigins.win (CORS proxy for news scraping), ipapi.co (geolocation), Leaflet + OpenStreetMap (map).