Skip to content

Hari19hk/DevBuddy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevBuddy

An AI-powered codebase assistant that understands your code through Retrieval-Augmented Generation (RAG)


Project Overview

DevBuddy is an intelligent codebase assistant that lets developers upload their project as a ZIP file and ask natural language questions to get contextual, code-aware answers powered by RAG and Gemini AI.


Problem Statement

The Challenge

Modern software development teams face a critical bottleneck: understanding large, complex codebases. Whether you're:

  • Onboarding to a new project - Spending days or weeks reading through thousands of lines of code
  • Debugging unfamiliar code - Struggling to trace functionality across multiple files
  • Learning from existing projects - Needing to understand architecture and patterns without direct mentorship
  • Reviewing legacy code - Deciphering undocumented or poorly documented systems

Traditional approaches like:

  • Manual code reading and documentation
  • Generic AI chatbots without code context
  • Static documentation that quickly becomes outdated

...are time-consuming, error-prone, and don't scale with project complexity.

Why This Solution Matters

DevBuddy bridges the gap between code and understanding by:

  1. Instant Contextual Understanding - Upload your codebase once, ask questions anytime
  2. Code-Aware Intelligence - RAG ensures answers are grounded in your actual code, not generic responses
  3. Beginner-Friendly Explanations - Tailored responses that help developers at all skill levels
  4. Time Efficiency - Reduce onboarding time from weeks to hours
  5. Always Up-to-Date - Works with your latest codebase, no manual documentation updates needed

Core Features

User Authentication & Security

  • Secure sign-up and sign-in with JWT-based authentication
  • Email verification system with token-based validation
  • Password reset functionality with secure token expiration
  • Protected routes and session management

Codebase Upload

  • Upload entire projects as ZIP files
  • Automatic extraction and file processing
  • Support for multiple file types (.js, .jsx, .css, .html)
  • Intelligent filtering (excludes node_modules, .git, build artifacts)

Intelligent Code Analysis

  • RAG-Powered Q&A - Retrieval-Augmented Generation for contextually accurate answers
  • Semantic Search - FAISS-based vector similarity search across codebase
  • Smart Chunking - Line-based chunking with overlap for better context preservation
  • Metadata Tracking - Answers include file names and line numbers for easy reference

Interactive Chat Interface

  • Real-time chat interface with markdown rendering
  • Syntax-highlighted code blocks in responses
  • Smooth scrolling and message history
  • File upload integration directly in chat

Modern UI/UX

  • Beautiful, responsive React interface
  • Smooth animations with Framer Motion and GSAP
  • Toast notifications for user feedback
  • Spline 3D graphics integration

Tech Stack

Frontend

  • React 19 - Modern UI library with latest features
  • Vite - Lightning-fast build tool and dev server
  • React Router DOM - Client-side routing
  • Zustand - Lightweight state management
  • Framer Motion - Animation library
  • GSAP - Advanced animation toolkit
  • React Markdown - Markdown rendering for AI responses
  • React Syntax Highlighter - Code syntax highlighting
  • Axios - HTTP client for API calls
  • React Hot Toast - Toast notifications
  • Spline - 3D graphics integration

Backend (Node.js)

  • Express.js - Web application framework
  • MongoDB - NoSQL database for user data
  • Mongoose - MongoDB object modeling
  • JWT (jsonwebtoken) - Authentication tokens
  • bcryptjs - Password hashing
  • Cookie Parser - Cookie management
  • Nodemailer - Email sending (via Mailtrap)
  • CORS - Cross-origin resource sharing

AI/ML Backend (Python)

  • Python HTTP Server - RESTful API for RAG operations
  • Sentence Transformers - Text embeddings (all-mpnet-base-v2)
  • FAISS - Vector similarity search and clustering
  • Google Gemini 2.5 Pro - Large language model for generation
  • Pandas & NumPy - Data processing and manipulation

Infrastructure

  • MongoDB Atlas (or local) - Database hosting
  • Mailtrap - Email testing service

System Architecture

High-Level Overview

┌─────────────────┐
│   React Frontend │
│   (Port 5173)    │
└────────┬─────────┘
         │
         ├─────────────────┐
         │                 │
         ▼                 ▼
┌─────────────────┐  ┌─────────────────┐
│  Node.js Backend │  │  Python Backend  │
│  (Port 5000)     │  │  (Port 8000)    │
│                  │  │                 │
│  - Auth Routes   │  │  - File Upload  │
│  - User Mgmt     │  │  - RAG Pipeline │
│  - JWT Tokens    │  │  - Embeddings   │
└────────┬─────────┘  └────────┬────────┘
         │                     │
         ▼                     │
┌─────────────────┐            │
│    MongoDB      │            │
│  (User Data)    │            │
└─────────────────┘            │
                               │
                               ▼
                    ┌─────────────────┐
                    │  RAG Pipeline    │
                    │                  │
                    │  1. Extract ZIP  │
                    │  2. Chunk Files  │
                    │  3. Generate     │
                    │     Embeddings  │
                    │  4. FAISS Index │
                    │  5. Query Search │
                    │  6. Gemini LLM  │
                    └─────────────────┘

How to Run

Prerequisites

  • Node.js (v18 or higher)
  • Python (v3.9 or higher)
  • MongoDB (local installation or MongoDB Atlas account)
  • npm or yarn package manager
  • pip or uv for Python dependencies

Step 1: Clone the Repository

git clone <repository-url>
cd DevBuddy

Step 2: Backend Setup (Node.js)

# Install dependencies
npm install

# Create .env file in backend directory
cd backend
touch .env

Add to backend/.env:

PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
CLIENT_URL=http://localhost:5173
MAILTRAP_HOST=smtp.mailtrap.io
MAILTRAP_PORT=2525
MAILTRAP_USER=your_mailtrap_username
MAILTRAP_PASS=your_mailtrap_password
# Start the Node.js backend
npm run dev

Backend will run on http://localhost:5000

Step 3: Python Backend Setup (RAG Service)

# Navigate to Python backend
cd python_backend

# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Set Gemini API key (or add to .env)
export GOOGLE_API_KEY=your_gemini_api_key

# Start Python server
python main.py
# Or use your preferred Python HTTP server

Python backend will run on http://localhost:8000

Step 4: Frontend Setup

# Navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

Frontend will run on http://localhost:5173

Step 5: Verify Setup

  1. Node.js Backend: Visit http://localhost:5000 - should see "Welcome to DevBuddy Backend"
  2. Python Backend: Verify it's running on http://localhost:8000
  3. Frontend: Visit http://localhost:5173 - should see sign-up page

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published