Skip to content

Latest commit

Β 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Canopy

Canopy

Grow your impact. Shrink your footprint.

A full-stack carbon footprint awareness platform where your sustainable choices grow a living ecosystem.

Next.js TypeScript Tailwind CSS Gemini AI Firebase Vercel Tests License: MIT

Built for PromptWars Virtual β€” Challenge 3

🌐 Live Demo Β· πŸ“ Build Story Β· πŸ“ Google Drive Β· πŸ’» GitHub


🌐 Live App

https://canopy-git-main-pixel-pirates1.vercel.app

Page URL
Landing https://canopy-git-main-pixel-pirates1.vercel.app
Sign Up https://canopy-git-main-pixel-pirates1.vercel.app/signup
Login https://canopy-git-main-pixel-pirates1.vercel.app/login
Dashboard https://canopy-git-main-pixel-pirates1.vercel.app/dashboard
Blog https://canopy-git-main-pixel-pirates1.vercel.app/blog

πŸ“ Submission Assets

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)

What is Canopy?

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."


✨ Features

πŸ” Firebase Authentication

  • 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

🌳 Living Ecosystem β€” 7 Growth Stages

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

πŸ“Š Carbon Engine β€” India Calibrated

Real emission factors from IPCC AR6, MoEFCC India, CEEW across travel, food, energy, and shopping.

πŸ€– AI Coach β€” Google Gemini 2.0 Flash

Personalized coaching based on your actual activity data. Quantified COβ‚‚ savings, Indian context, smart offline fallback.

πŸ† Challenges, Achievements & Streaks

5 auto-tracked challenges, 10 achievement badges across 4 rarity tiers, streak system with particle celebrations.

πŸ“ Build-in-Public Blog

Original long-form article covering the full technical and product story of building Canopy for PromptWars.

πŸ§ͺ Test Coverage

33 passing tests across carbon engine, ecosystem engine, and challenge engine.


πŸ› οΈ Tech Stack

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

πŸš€ Getting Started

# 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 test

Environment Variables

GEMINI_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_id

Get a free Gemini key at aistudio.google.com


πŸ“ Project Structure

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

🌐 Routes

Route Auth Required
/ No
/login No
/signup No
/blog No
/blog/[slug] No
/dashboard βœ… Yes

πŸ“Š Emission Factors (India-calibrated)

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

πŸ“„ License

MIT License β€” see LICENSE for details.


πŸ™ Acknowledgements


Built with 🌱 for PromptWars Virtual β€” Challenge 3

Canopy β€” Grow your impact. Shrink your footprint.

Live Demo Google Drive

About

Canopy :- Carbon footprint awareness platform where your sustainable actions grow a living ecosystem. Log travel, food, energy & shopping β†’ watch your tree evolve through 7 stages with organic animations. Built with Next.js, Gemini AI Coach, and real Indian emission benchmarks. 🌱

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages