A full-stack carbon footprint awareness platform where your sustainable choices grow a living ecosystem.
Built for PromptWars Virtual β Challenge 3
π Live Demo Β· π Build Story Β· π Google Drive Β· π» GitHub
https://canopy-git-main-pixel-pirates1.vercel.app
| Asset | Link |
|---|---|
| π Live App | https://canopy-git-main-pixel-pirates1.vercel.app |
| π» GitHub Repo | https://github.com/pallaviXD/Canopy |
| π Google Drive | https://drive.google.com/drive/folders/1PabB5sqnNO0K5PreIf3_R2CIIKIOhGvL?usp=drive_link |
| π Technical Blog | https://canopy-git-main-pixel-pirates1.vercel.app/blog |
| π₯ Demo Video | (see Google Drive) |
Canopy is a sustainability companion built with Google Antigravity (Gemini + Firebase). Every real-world action you take directly transforms a living digital ecosystem. Log a metro ride, eat a vegetarian meal, skip an online order β and watch your tree grow leaves, flowers bloom, birds arrive, and butterflies appear.
"Every choice is a seed."
- Email/Password sign-up and login
- Google OAuth one-tap sign-in
- Protected routes β dashboard requires authentication
- Firestore for real-time cross-device data sync with offline persistence
An organic SVG ecosystem that evolves based on your real behavior. Not a chart β a living world.
| Score | Stage |
|---|---|
| 0β10 | Bare Soil |
| 10β25 | Small Sapling |
| 25β40 | Young Tree |
| 40β55 | Healthy Tree |
| 55β72 | Large Tree β flowers bloom |
| 72β88 | Forest Tree β birds nest |
| 88β100 | Flourishing Ecosystem β butterflies, particles |
Real emission factors from IPCC AR6, MoEFCC India, CEEW across travel, food, energy, and shopping.
Personalized coaching based on your actual activity data. Quantified COβ savings, Indian context, smart offline fallback.
5 auto-tracked challenges, 10 achievement badges across 4 rarity tiers, streak system with particle celebrations.
Original long-form article covering the full technical and product story of building Canopy for PromptWars.
33 passing tests across carbon engine, ecosystem engine, and challenge engine.
| Layer | Technology |
|---|---|
| Framework | Next.js 16.2 (App Router, Turbopack) |
| Language | TypeScript 5.7 |
| Styling | Tailwind CSS v4 |
| State | Zustand 5 with localStorage persistence |
| AI | Google Gemini 2.0 Flash |
| Auth | Firebase Authentication (Email/Password + Google OAuth) |
| Database | Firebase Firestore (offline IndexedDB persistence) |
| Deployment | Vercel |
| Testing | Jest + ts-jest (33 tests) |
| Icons | Lucide React |
| Fonts | DM Sans + Geist Mono |
# 1. Clone
git clone https://github.com/pallaviXD/Canopy.git
cd Canopy
# 2. Install
npm install
# 3. Configure
cp .env.local.example .env.local
# Fill in your Firebase + Gemini keys
# 4. Run
npm run dev
# Open http://localhost:3000
# 5. Test
npm testGEMINI_API_KEY=your_gemini_api_key
NEXT_PUBLIC_FIREBASE_API_KEY=your_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.app
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_idGet a free Gemini key at aistudio.google.com
canopy/
βββ app/
β βββ api/coach/route.ts # Gemini AI proxy
β βββ blog/page.tsx # Build-in-public blog
β βββ blog/[slug]/page.tsx # Full article page
β βββ dashboard/page.tsx # Protected dashboard (auth required)
β βββ login/page.tsx # Firebase login
β βββ signup/page.tsx # Firebase signup
β βββ page.tsx # Public landing page
β
βββ components/canopy/
β βββ auth-guard.tsx # Route protection
β βββ auth-form.tsx # Login/signup with Firebase
β βββ app-provider.tsx # Firebase auth state sync
β βββ ecosystem/ # 8-layer animated SVG ecosystem
β βββ dashboard/ # 5 dashboard panel components
β
βββ lib/
β βββ blog-data.ts # Blog post content
β βββ firebase-config.ts # Firebase singleton
β βββ firebase-service.ts # Auth + Firestore CRUD
β βββ carbon-engine.ts # Emission calculations
β βββ ecosystem-engine.ts # Visual state computation
β βββ challenge-engine.ts # Auto-progress tracking
β βββ achievement-engine.ts # Badge unlock logic
β βββ analytics-engine.ts # Weekly/monthly summaries
β βββ streak-engine.ts # Consecutive day tracking
β βββ gemini-context-builder.ts # AI prompt builder
β βββ store.ts # Zustand global state
β
βββ __tests__/
βββ carbon-engine.test.ts # 14 tests
βββ ecosystem-engine.test.ts # 10 tests
βββ challenge-engine.test.ts # 9 tests
| Route | Auth Required |
|---|---|
/ |
No |
/login |
No |
/signup |
No |
/blog |
No |
/blog/[slug] |
No |
/dashboard |
β Yes |
Sources: IPCC AR6, MoEFCC India, CEEW
| Travel Mode | kg COβ/km |
|---|---|
| Petrol Car | 0.21 |
| Electric Car | 0.12 |
| Bus | 0.089 |
| Metro | 0.041 |
| Domestic Flight | 0.255 |
| Food | kg COβ/meal |
|---|---|
| Beef | 3.0 |
| Chicken | 0.7 |
| Vegetarian | 0.3 |
| Vegan | 0.2 |
MIT License β see LICENSE for details.
- Google AI Studio β Gemini API
- Firebase β Auth and Firestore
- Lucide React β Icons
- Emission data: IPCC AR6, MoEFCC India, CEEW