Vera is a Next.js emissions insights app with an AI Copilot for exploring facility and regional emissions data on an interactive map and dashboard.
- AI Copilot (
/copilot): ask natural-language questions, see results as action cards (locations, stats, charts), and visualize results on a Mapbox map. - Dashboard (
/dashboard): filter and explore assets and sector breakdowns. - Landing / hero pages (
/,/hero).
Primary sectors include power, transportation, manufacturing, agriculture, buildings, waste, land use, and more (via upstream datasets).
- Node.js: 18+ recommended
- npm: comes with Node
Create .env.local in the project root:
# Required: OpenAI (AI Copilot + facility research)
OPENAI_API_KEY=your_openai_api_key_here
# Required: Mapbox (map rendering in /copilot)
NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN=your_mapbox_access_token_here
# Optional: Tavily (enables web search for some Q&A flows, if wired)
TAVILY_API_KEY=your_tavily_api_key_here- Get an OpenAI key:
https://platform.openai.com/api-keys - Get a Mapbox token:
https://account.mapbox.com
npm install
npm run devOpen:
http://localhost:3000(landing)http://localhost:3000/copilot(AI Copilot)http://localhost:3000/dashboard(dashboard)
Show me the top 5 most polluted places in Louisiana
Show me power plants in Texas
Compare emissions between Texas and California
Get emissions statistics for New York
Find manufacturing facilities in Illinois
POST /api/copilot: AI chat endpoint (function/tool calling + streaming responses).POST /api/facility-research: “Learn more with AI” facility research used from the map popups.
npm run dev # Start dev server (Turbopack)
npm run build # Production build (Turbopack)
npm run start # Start production server
npm run lint # ESLint
npm run generate:api # Generate fetch client from openapi.json -> lib/api/
npm run generate:types # Generate types from openapi.json -> lib/api/types.tsapp/: Next.js App Router pages and API routesapp/copilot/page.tsx: Copilot UI (map + prompt + action sidebar)app/dashboard/page.tsx: Dashboard UIapp/api/*/route.ts: server endpoints
components/: UI + action cards + layout componentslib/: API client, types, and climate/emissions utilitiesopenapi.json: OpenAPI spec used to generate the typed client
- Emissions/assets: Climate TRACE (
https://climatetrace.org/) - Map rendering: Mapbox GL JS (requires
NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN) - County/parish boundaries (Copilot overlay): fetched at runtime from a public GeoJSON dataset
- Troubleshooting: see
TROUBLESHOOTING.md - Implementation notes: see
IMPLEMENTATION_SUMMARY.md