CanopySense

Canopy Sense 🌳

Intelligent Geo-Spatial Afforestation Planning

An MVP for Smart India Hackathon 2026 (Internal Qualifying Round). Given any location on a map + a carbon offset target, returns:


Stack

Layer Tech
Frontend Next.js 14, React-Leaflet, Recharts
Backend FastAPI, SQLAlchemy, Pydantic v2
Database PostgreSQL (Neon/Supabase for prod)
Geo Data Google Earth Engine (NDVI, CHIRPS, SoilGrids, ESA WorldCover)
ML Scikit-learn / XGBoost (species suitability scoring)
Deploy Vercel (frontend) + Render (backend) + Docker

Project Structure

canopy-sense/
├── backend/              # FastAPI backend
│   ├── app/
│   │   ├── api/          # Route handlers
│   │   ├── core/         # Config, settings
│   │   ├── db/           # SQLAlchemy models, session, init
│   │   ├── models/       # Pydantic schemas
│   │   └── services/     # GEE, species scoring, carbon calc
│   ├── Dockerfile
│   └── requirements.txt
├── frontend/             # Next.js frontend
├── data/                 # Species dataset (CSV + seed script)
├── ml/                   # Model training scripts
└── docker-compose.yml

Quick Start

1. Clone & setup

git clone <repo-url>
cd canopysense

2. Configure environment

cp backend/.env.example backend/.env
# Edit backend/.env with your DB URL and GEE credentials

3. Run with Docker

docker-compose up --build

4. Initialize the database

docker exec canopy_sense_backend python -m app.db.init_db

5. Seed species data

docker exec canopy_sense_backend python data/seed_species.py

6. Access


API Endpoints

Method Endpoint Description
POST /api/v1/analyze-location Main analysis endpoint
GET /api/v1/species List all species in dataset
GET /api/v1/demo-locations Pre-cached demo locations
GET /health Health check

Example Request

POST /api/v1/analyze-location
{
  "lat": 28.6139,
  "lon": 77.2090,
  "carbon_target_tonnes": 100.0
}

Demo Locations (pre-cached for judging)

City Lat Lon Zone
Delhi 28.6139 77.2090 Semi-arid, BSh
Bangalore 12.9716 77.5946 Tropical savanna, Aw
Chennai 13.0827 80.2707 Tropical wet/dry, Aw

Team

Built for SIH 2026 Internal Hackathon — Smart Automation theme.