Created November 2024
An application designed to assist developers by providing an interactive chat interface to discuss and analyze their code files.
Ensure you have the following installed on your local machine:
-
Docker and Docker Compose
Docker enables containerization of applications, while Docker Compose allows orchestration of multi-container setups.- Docker: Download Docker
- Docker Compose: Install Docker Compose
-
Node.js (Optional)
If you plan to run the frontend and backend without Docker for development purposes.- Node.js: Download Node.js
Create the backend .env file with the required credentials and configuration:
# backend/.env
PORT=5001
OPENAI_API_KEY=sk-...
PINECONE_API_KEY=pc-...
PINECONE_INDEX=code-embeddings
FRONTEND_ORIGIN=http://localhost:3000
# Optional overrides
# DATABASE_FILE=data/app.db
# MAX_HISTORY_MESSAGES=10
# MAX_CHUNK_TOKENS=800
# CHUNK_OVERLAP_TOKENS=200
# MIN_PINECONE_SCORE=0.75
Install dependencies and launch the stack:
# backend
cd backend
npm install
# frontend
cd ../frontend
npm install
# Docker
cd ..
docker-compose up -d --buildThe React application respects REACT_APP_API_BASE_URL (defaults to http://localhost:5001) so the frontend can proxy to production instances without code changes.
If you prefer to run outside Docker, start each service in separate terminals:
cd backend && npm start # add a start script or use nodemon
cd frontend && npm startThe backend persists metadata in backend/data/app.db (SQLite). Delete that file if you need a clean slate.
- Deterministic file chunking with overlap, deduplicated via SHA-256 prior to embedding.
- Asynchronous Pinecone ingestion queue with detailed status tracking (queued → processing → ready/failed).
- Persistent chat sessions backed by SQLite plus streaming responses over Server-Sent Events.
- Source citations in every answer referencing filename and line ranges.
- Toast-driven UX for uploads/deletions, status badges for file processing, and configurable API base URL.
Run lightweight smoke tests for hashing/chunking logic:
cd backend
npm testEnd-to-end verification still requires valid OpenAI & Pinecone credentials; trigger an upload and /ask request once your API keys are provisioned.
I was recently put into a project with huge extensive codebase and complex code without sufficient documentation and comments, making it really difficult for me to fully understand. This inspired me to create Code Chatbot which utilizes the implementation of RAG that allow users to upload multiple files and chat with them.
Multiple chat rooms, better looking UI, real-time collaboration with multiple users, integrate tools for deeper code analysis
This project was created by Warren Chang - Feel free to contact me if you have any questions :)