Skip to content

fatoumo/hacktogone2025

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hacktogone Toulouse 2025

A Turborepo monorepo for carbon footprint tracking and conversational AI agents integration. This project combines Next.js web applications with ElevenLabs voice agents, carbon data RAG (Retrieval-Augmented Generation) module, and Snowflake-based carbon scoring API.

Package Manager: Bun (v1.3.1) Build System: Turborepo Framework: Next.js 16 (App Router), React 19

Quick Start

# Install dependencies
bun install

# Run all applications (Next.js + Python)
bun run dev

# Run specific application
bun run dev --filter=web                    # Web app (port 3000)
bun run dev --filter=carbon-data-rag        # RAG API (port 8000)
bun run dev --filter=scoring-api            # Scoring API (port 8501)
bun run dev --filter=eleven-agent-acceuil   # CLI agent

What's inside?

This Turborepo includes the following applications and packages:

Next.js Applications

  • web: Main Next.js app with ElevenLabs agents integration, voice chat UI, and carbon scoring features
  • admin: Admin Next.js app

Python Applications

  • carbon-data-rag: FastAPI-based RAG service with ChromaDB for semantic search over DEFRA 2024 emission factors
  • scoring-api: Streamlit-based carbon footprint calculator for Snowflake deployment
  • eleven_agent_acceuil: CLI agent for carbon footprint onboarding with ElevenLabs integration

Shared Packages

  • @repo/elevenlabs-agents: Shared ElevenLabs agent client & utilities (TypeScript)
  • @repo/ui: React component library (shadcn/ui)
  • @repo/eslint-config: ESLint configurations
  • @repo/typescript-config: Shared TypeScript configurations

Development

Running All Applications

# Start all dev servers (Next.js + Python)
bun run dev

This will start:

Running Specific Applications

# Next.js applications
bun run dev --filter=web
bun run dev --filter=admin

# Python applications
bun run dev --filter=carbon-data-rag        # FastAPI
bun run dev --filter=scoring-api            # Streamlit
bun run dev --filter=eleven-agent-acceuil   # CLI

# Multiple specific apps
bun run dev --filter=web --filter=carbon-data-rag

Building

# Build all apps
bun run build

# Build specific app
bun run build --filter=web

Code Quality

# Lint all workspaces
bun run lint

# Type check all TypeScript workspaces
bun run check-types

# Format code
bun run format

Python Applications Setup

Prerequisites

Each Python application requires a virtual environment and dependencies installation:

# Carbon Data RAG
cd carbon-data-rag
python -m venv .venv
.venv\Scripts\activate  # Windows (.venv/bin/activate on Unix)
pip install -r requirements.txt
python src/ingest.py  # One-time data ingestion (~30 min)

# Scoring API
cd scoring-api
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt

# ElevenLabs Accueil Agent
cd eleven_agent_acceuil
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt

Environment Variables

Create .env files in each Python module:

carbon-data-rag/.env:

# Optional: Add custom configuration

scoring-api/.env:

SNOWFLAKE_ACCOUNT=your_account
SNOWFLAKE_USER=your_user
SNOWFLAKE_PASSWORD=your_password
# ... (or use app_demo.py which requires no credentials)

eleven_agent_acceuil/.env:

ELEVENLABS_API_KEY=your_elevenlabs_key  # Optional

apps/web/.env.local:

ELEVENLABS_API_KEY=your_elevenlabs_key
HUGGINGFACE_API_KEY=your_hf_key  # Optional
HUGGINGFACE_WHISPER_ENDPOINT=your_endpoint  # Optional

Remote Caching

Tip

Vercel Remote Cache is free for all plans. Get started today at vercel.com.

Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.

By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:

cd my-turborepo

# With [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation) installed (recommended)
turbo login

# Without [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation), use your package manager
npx turbo login
yarn exec turbo login
pnpm exec turbo login

This will authenticate the Turborepo CLI with your Vercel account.

Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:

# With [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation) installed (recommended)
turbo link

# Without [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation), use your package manager
npx turbo link
yarn exec turbo link
pnpm exec turbo link

Key Features

1. ElevenLabs Voice Agents Integration

  • Dashboard for managing conversational AI agents (apps/web/app/agents/)
  • Real-time voice chat interface using @elevenlabs/react
  • Agent configuration import/export with Zod validation

2. Carbon Data RAG Module

  • Semantic search over DEFRA 2024 emission factors using ChromaDB
  • FastAPI REST API for natural language queries
  • Vectorized database for intelligent carbon factor matching

3. Carbon Scoring API

  • Streamlit-based calculator for energy, transport, and waste metrics
  • Snowflake integration for data persistence
  • Demo and production modes

4. CLI Onboarding Agent

  • Interactive questionnaire for carbon footprint assessment
  • Heuristic scoring across 4 categories
  • ClickUp integration for CRM workflow automation

Project Documentation

Technology Stack

  • Frontend: Next.js 16, React 19, Tailwind CSS v4, shadcn/ui
  • Backend: FastAPI, Streamlit, Next.js API Routes
  • AI/ML: ElevenLabs API, OpenAI API, ChromaDB, sentence-transformers
  • Data: Snowflake, DEFRA 2024 emission factors
  • Build: Turborepo, Bun, TypeScript

Useful Links

Learn more about the technologies used:

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors