Skip to content

djleamen/DevDuck

Repository files navigation

DevDuck πŸ¦†

Rubber duck debugging is a beloved hacker tradition β€” just by explaining your code out loud, you often discover the solution. We asked ourselves: what if the duck could actually respond? With one of us passionate about hardware (Mechatronics Engineering) and the other passionate about AI/ML (Computer Science), we set out to bring a rubber duck to life.

DevDuck is a sentiment-aware chatbot paired with a physical duck:

-πŸ—£οΈ Hackers chat with DevDuck like they would with a debugging buddy.

-πŸ€– DevDuck analyzes the tone and sentiment of the conversation.

-πŸ¦† The physical duck reacts with movements that match the mood β€” encouragement if you’re frustrated, celebration if you’re excited, calm nods when things make sense.

-πŸ’¬ On top of that, DevDuck can support general coding-related discussions and is designed to expand into deeper debugging assistance.

Features

  • Voice Listening Toggle - Start/stop listening with a simple button
  • Conversation History - Track all interactions in a dropdown
  • Basic Sentiment Analysis - Understand developer mood from text
  • Web API - RESTful endpoints for frontend communication
  • Electron Frontend - Clean, minimal desktop interface

Quick Start

1. Install Python Dependencies

pip install -r requirements.txt

2. Start the API Server

python scripts/start_api.py

The API will be available at: http://localhost:8001

3. Start the Frontend

cd frontend
npm install

npm start

4. Start the API gateway

ngrok http 8001

Don't forget to update VAPI variables in renderer.js!

API Endpoints

  • GET / - Root; lists available endpoints
  • POST /listening/toggle - Toggle listening state
  • GET /history - Get conversation history
  • POST /history/clear - Clear conversation history
  • GET /status - Get current system status
  • GET /health - Health check
  • POST /webhook/vapi - VAPI webhook endpoint
  • POST /duck/talk/start - Start duck talking animation
  • POST /duck/talk/stop - Stop duck talking animation
  • POST /duck/gesture/{name} - Trigger a gesture (nod, shake, left, right, greet, goodluck)
  • POST /get_code_snippet - Read and return file contents
  • POST /store_context - Store a snippet/context payload
  • POST /retrieve_context - Retrieve a stored context by snippet id

Project Structure

DevDuck/
β”œβ”€β”€ arduino/                 # Arduino servo controller
β”‚   └── devduck_controller/
β”‚       └── devduck_controller.ino
β”œβ”€β”€ devduck/                 # Python backend
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ main.py
β”‚   β”œβ”€β”€ ai/
β”‚   β”‚   └── __init__.py      # VAPI integration hooks
β”‚   β”œβ”€β”€ analysis/
β”‚   β”‚   └── __init__.py      # Sentiment analysis
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ assistant_config.py
β”‚   β”‚   └── vapi_webhook.py  # FastAPI app & endpoints
β”‚   β”œβ”€β”€ hardware/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   └── usb_communication.py
β”‚   └── utils/
β”‚       β”œβ”€β”€ __init__.py
β”‚       └── security.py
β”œβ”€β”€ frontend/                # Electron desktop app
β”‚   β”œβ”€β”€ main.js              # Electron main process
β”‚   β”œβ”€β”€ package.json         # Frontend dependencies
β”‚   β”œβ”€β”€ package-lock.json
β”‚   └── renderer/            # Frontend UI files
β”‚       β”œβ”€β”€ index.html
β”‚       β”œβ”€β”€ renderer.js
β”‚       └── styles.css
β”œβ”€β”€ scripts/
β”‚   └── start_api.py         # Starts FastAPI on port 8001

Hardware Setup

The Arduino controller manages servo movements for the physical duck. See arduino/devduck_controller/ for the servo control code.

License

MIT License - see LICENSE for details.

Authors

  • DJ Leamen
  • Nahl Farhan

Releases

No releases published

Packages

No packages published

Contributors 5