Development Process:

  1. Day 1-2: Architecture design, microservices setup
  2. Day 3-5: Discord bot development, API implementation
  3. Day 6-8: CO2 calculation integration, testing accuracy
  4. Day 9-12: Frontend development, dashboard design
  5. Day 13-15: Integration testing, deployment, documentation

Challenges we ran into

1. Discord Bot Intents & Permissions

Problem: Bot couldn't read message content initially.

Solution: Discovered Discord requires MESSAGE_CONTENT_INTENT to be manually enabled in the Developer Portal. Not a code issue—a configuration gotcha that cost us hours of debugging.

Learning: Always verify platform-specific permissions before blaming your code.


2. Carbon Calculation Accuracy

Problem: How do we accurately estimate Discord message carbon without actual network data?

Solution:

  • Researched peer-reviewed studies (Lancaster University, Nature Climate Change)
  • Used industry-standard @tgwf/co2 library (Green Web Foundation)
  • Conservative estimate: 2KB per text message
  • Documented assumptions clearly in code

Learning: When precision isn't possible, transparency about methodology is crucial.


3. Real-Time vs. Polling Trade-off

Problem: WebSockets for real-time updates vs. HTTP polling for simplicity?

Decision: Chose polling (10s intervals) for MVP.

Reasoning:

  • ✅ Simpler implementation
  • ✅ Better compatibility (no WebSocket infrastructure needed)
  • ✅ Sufficient for current use case
  • ⚠️ Future: Will migrate to WebSockets for true real-time

Learning: Choose the right tool for the problem, not the fanciest tool.


4. Microservices Communication Resilience

Problem: CO2 microservice occasionally failed, breaking the entire flow.

Solution: Implemented resilience patterns in Spring Boot:

  • Circuit breaker (opens after 5 failures, 60s cooldown)
  • Retry logic (3 attempts with exponential backoff)
  • Graceful degradation (cache previous results)

Learning: Distributed systems fail—design for failure, not perfection.


5. Frontend State Management

Problem: Synchronizing live data updates across React components was getting messy with prop drilling.

Solution: Integrated Zustand for lightweight state management.

Result: Clean, predictable state updates with minimal boilerplate.

Learning: Sometimes the best solution is the simplest one, not the most popular.


6. Deployment Environment Variables

Problem: Local development worked perfectly; production deployment failed due to missing env vars.

Solution:

  • Created .env.example files for all services
  • Documented every required variable in README
  • Used Railway's environment variable management

Learning: Documentation prevents deployment disasters.


Accomplishments that we're proud of

🏆 Technical Achievements

Fully Functional End-to-End System

  • All four layers working seamlessly
  • Real-time data pipeline from Discord to dashboard
  • Zero critical bugs in final demo

Industry-Standard Carbon Calculations

  • Using peer-reviewed SWD model via @tgwf/co2
  • Transparent methodology with cited sources (IEA, Nature, Lancaster University)
  • Conservative estimates (better to underestimate than exaggerate)

Resilient Microservices Architecture

  • Circuit breaker prevents cascade failures
  • Retry logic handles transient errors
  • Graceful degradation ensures uptime

Clean, Maintainable Codebase

  • Well-documented architecture (ARCHITECTURE.md)
  • Separation of concerns across layers
  • Easy to scale and extend

Responsive, Professional UI

  • Works flawlessly on mobile, tablet, desktop
  • Clean design with Tailwind CSS
  • Accessible and user-friendly

🌟 Impact & Innovation

First Consumer-Facing Digital Carbon Tracker

  • No existing tool tracks individual digital footprints
  • We're creating a new category: Digital Carbon Index (DCI)

Proof of Multi-Platform Potential

  • Discord validates the concept
  • Same architecture works for Instagram, WhatsApp, Netflix, Gmail

Educational Value

  • Makes invisible emissions tangible
  • Provides context with equivalents (car miles, tree days)
  • Raises awareness about digital sustainability

💪 Personal Growth

Learned Spring Boot Microservices

  • First time implementing circuit breakers and retry patterns
  • Deepened understanding of distributed systems

Mastered Discord.js v14

  • Navigated privileged intents and bot permissions
  • Built production-ready Discord bots

Integrated Industry Research

  • Read peer-reviewed papers on digital carbon
  • Learned about SWD model and carbon calculation methodologies

Deployed Full-Stack App

  • Vercel for frontend, Railway for backend
  • Managed environment variables across services

What we learned

Technical Learnings

  1. Microservices Are Powerful but Complex

    • Benefit: Independent scaling, technology flexibility
    • Cost: Network latency, distributed state management, complexity
    • Key Insight: Use microservices when you need them, not because they're trendy
  2. Resilience Patterns Are Non-Negotiable

    • Circuit breakers prevent cascade failures
    • Retries handle transient errors
    • Timeouts prevent indefinite hangs
    • Key Insight: Design for failure from day one
  3. API Design Matters

    • Clear endpoint naming (/api/carbon/discord/batch)
    • Consistent response formats
    • Proper HTTP status codes
    • Key Insight: Good API design = fewer integration bugs
  4. Real-Time Polling Trade-offs

    • 10-second polling: Simple, works everywhere
    • WebSockets: True real-time, more complex
    • Key Insight: Start simple, optimize later

Domain Knowledge

  1. Digital Carbon Is a Real Problem

    • ICT sector: 3.7-4% of global emissions (IEA, 2024)
    • More than aviation industry (2.5%)
    • Growing 9% annually
    • Key Insight: Nobody's tracking it at the consumer level—huge opportunity
  2. Carbon Calculation Complexity

    • SWD model accounts for: data transfer, device energy, network, data centers
    • Conservative estimates are better than inflated claims
    • Transparency about methodology builds trust
    • Key Insight: Accuracy matters, but so does honesty about limitations

Product Strategy

  1. Discord Was the Right MVP

    • Active communities = engaged users
    • Bot ecosystem = easy integration
    • Real-time data = perfect for proof of concept
    • Key Insight: Choose your first platform strategically
  2. Multi-Platform Vision Matters

    • Judges care about scalability
    • Users care about comprehensive tracking
    • Platforms care about industry standards
    • Key Insight: Discord is the demo, DCI is the product

Soft Skills

  1. Research Validates Ideas

    • Reading IEA reports, Nature papers, Lancaster studies
    • Citing credible sources in pitch
    • Key Insight: Data-driven arguments win debates
  2. Documentation Saves Time

    • ARCHITECTURE.md prevented countless "how does this work?" questions
    • README.md made deployment painless
    • Key Insight: Write docs as you build, not after

What's next for Carbon Pulse

Phase 1: User Validation (Months 1-3)

  • 🎯 Goal: Get 500-1,000 active Discord users
  • 📊 Metrics:
    • Measure baseline usage patterns
    • Survey: "Did you learn something about digital carbon?"
    • A/B test: Dashboard vs. no dashboard—does visibility change behavior?
  • 📝 Deliverable: Case study proving awareness leads to behavior change

Phase 2: Multi-Platform Integration (Months 3-6)

Instagram Integration

  • Connect via Instagram Graph API
  • Track: Posts, stories, reels, messages
  • Calculate: Data transfer per media type
  • Display: Per-post carbon cost

WhatsApp Tracking

  • End-to-end encrypted metadata analysis
  • Message count (not content)
  • Media file sizes
  • Group chat optimization tips

Gmail Plugin

  • Browser extension
  • Track sent/received emails
  • Calculate: Text vs. attachment carbon
  • Feature: "Carbon cost" badge on emails

Netflix/Streaming

  • Partner with streaming platforms OR
  • Browser extension tracking watch time
  • Calculate: SD vs. HD vs. 4K carbon cost
  • Recommendations: "Save CO₂ by streaming in HD"

Phase 3: Universal Platform (Months 6-12)

Digital Carbon Index (DCI)

  • One Dashboard: All platforms in one view
  • Daily Summary: "Today you created 450g CO₂ across all apps"
  • Weekly Trends: See your digital carbon over time
  • Leaderboards: Compare with friends (gamification)
  • Challenges: "Reduce 10% this week"

API for Developers

  • Public API for third-party integrations
  • Plugins for Slack, Teams, Zoom
  • White-label for enterprises

Phase 4: Actionable Recommendations (Month 12+)

Smart Suggestions

  • "Delete 5GB of old emails → Save 140g CO₂"
  • "Switch to dark mode → 30% reduction"
  • "Enable Discord data saver → 25% less carbon"
  • "Move files to eco-friendly cloud storage"

Carbon Offset Integration

  • Partner with verified offset programs
  • "Offset your monthly digital carbon for $2"
  • Track offset impact

Phase 5: Industry Impact (Year 2+)

Platform Pressure

  • When millions track digital carbon, platforms respond
  • Instagram adds "eco mode"
  • Netflix optimizes streaming algorithms
  • Gmail warns about large attachments

Standard Creation

  • Work with W3C, Green Web Foundation
  • Establish Digital Carbon Index as industry standard
  • Like nutrition labels for food → DCI for apps

Long-Term Vision

5 years from now:

  • Every app displays carbon cost by default
  • DCI is as common as AQI
  • Digital carbon literacy is taught in schools
  • Industry optimizes for efficiency, not just features

Carbon Pulse isn't just a product—it's the start of a movement toward digital sustainability.


Immediate Next Steps (Post-Hackathon)

  1. ✅ Open-source the codebase (already on GitHub)
  2. ✅ Deploy production version on Railway
  3. ⬜ Launch beta with 100 Discord servers
  4. ⬜ Collect user feedback via surveys
  5. ⬜ Publish whitepaper on digital carbon methodology
  6. ⬜ Apply to accelerators (Y Combinator, Techstars)
  7. ⬜ Build Instagram integration prototype
  8. ⬜ Partner with environmental organizations

Carbon Pulse is more than a hackathon project. It's the foundation for making digital carbon emissions as normal to track as checking the weather.

The future of sustainability is transparency. We're building that future.

Built With

  • axios-?-backend:-spring-boot-3.5
  • batch
  • circuit-breaker
  • co2.js-(green-web-foundation)-?-patterns:-microservices
  • discord-api
  • discord-api-?-deployment:-vercel-(frontend)
  • express.js
  • frontend:-react-18
  • h2-database
  • java-17
  • maven
  • railway-(backend)-?-apis:-rest-api
  • recharts
  • retry-logic
  • spring-retry-?-microservice:-node.js
  • tailwind-css
  • tgwf/co2-?-bots:-discord.js-v14
  • vite
  • zustand
Share this project:

Updates