Inspiration

Cities often collect structured data — traffic, air quality, crime reports — but citizen emotions and micro-signals of stress or joy are invisible. We wanted to give communities a voice that algorithms can understand: a map that listens, feels, and responds. Inspired by mental-health check-in tools and civic engagement dashboards, EchoSense (aka Urban Echo) translates everyday emotions into a real-time “empathy map” for the city.

What it does

Residents anonymously submit short mood or feedback phrases (e.g. “Feeling anxious walking home”). EchoSense’s AI: 1. Classifies the emotional tone (positive / neutral / negative). 2. Visualizes the emotion as heatmap and emoji markers on the live city map. 3. Triggers 3D celebration animations for positive sharing and gentle soothing visuals for negative ones. 4. Generates empathetic responses and provides relevant local resources (hotlines, community links). 5. Aggregates weak emotional signals into early-warning indicators for policy makers — a “human sensor network.”

How we built it

We built EchoSense (Urban Echo) inside GitHub Codespaces, working entirely in a shared online VS Code environment. Our goal was to create a real-time emotional feedback map using FastAPI, vanilla JavaScript, and Three.js for visualization.

Backend (FastAPI + Local DB) All backend code lives in the /api folder: • main.py — defines all API routes (/api/reports, /api/heatmap, /api/alerts) and background data aggregation. • db.py — uses SQLAlchemy with a local SQLite database file to store user reports and AI-generated results. • ai.py — connects to OpenAI / Azure OpenAI API to analyze emotions, risk level, and empathy responses. • schemas.py — defines request/response models for FastAPI.

Challenges we ran into

Challenges we ran into • CORS + Codespaces ports: Frontend (Port 5500) couldn’t fetch the API (Port 8000) at first; fixed with explicit allow_origins and using the public port URL. • Leaflet sizing after overlays: The map disappeared after intro/celebration because the container size changed; solved with map.invalidateSize() on reveal/cleanup. • State sync between modules: Getting intro.js, ui.js, map.js, and celebration3d.js to coordinate (no race conditions, no double-init). • K-anonymous heatmap: Designing a safe aggregation that shows useful trends without exposing individuals; tuned thresholds and geohash precision. • Merge conflicts during fast dev: Rebases while swapping demo assets and JS modules; established a small branching convention to keep velocity.

Accomplishments that we're proud of

End-to-end working demo: Anonymous mood check-in → AI analysis → live heatmap + alerts, all running in GitHub Codespaces. • Beautiful, lightweight UX: Particle background + 3D celebration (Three.js) with emotion-aware palettes and shapes. • Privacy by design: No raw locations shown; data bucketed by geohash with k-anonymity and volume/risk thresholds. • Human-in-the-loop: Review endpoint to acknowledge/dismiss alerts and record notes for accountability. • Resilient frontend: Clean UI glue, clear error messages, and graceful fallbacks when the API is slow or unreachable.

What we learned

Operational: How to make Codespaces APIs public, and why CORS must explicitly match origins in cloud dev. • Mapping: Practical Leaflet tips (invalidate size, layering order, icon performance) for smooth, mobile-friendly maps. • WebGL ergonomics: Keeping Three.js effects non-blocking (pointer-events:none), and clamping animation speeds for comfort. • Responsible analytics: The trade-offs between utility and privacy, and the value of alert rules that require sufficient volume. • Team flow: Small modules + “single-purpose” files made it easier to parallelize work and resolve conflicts quickly.

What's next for Echo Sense

Our next step is to make EchoSense scalable and community-ready. Right now, it runs entirely on FastAPI + SQLite inside GitHub Codespaces, but our roadmap includes: • Real-time city dashboards: expanding to live updates across different Calgary communities with more granular heatmaps. •Database migration: moving from local SQLite to a managed PostgreSQL or NeonDB backend for persistence and analytics. • Smarter AI feedback: training emotion and empathy models on real community data (with privacy protection). • Mobile-friendly interface: adapting the current UI and 3D celebration system for mobile devices. • Community alert API: notifying local partners and services when emotional risk levels rise in specific areas.

Our long-term vision is to make EchoSense a real-time emotional pulse of cities — helping communities listen, respond, and heal faster.

Built With

Share this project:

Updates