Skip to content

thxgp/codecontext

Repository files navigation

CodeContext

Understand any codebase in hours, not weeks.

Live Demo License TypeScript React

AI-powered codebase exploration tool that helps developers onboard to new projects faster.

CodeContext Desktop CodeContext Mobile

Features

  • AI Q&A — Ask questions like "Where is authentication handled?" and get instant answers with file references
  • Visual File Tree — Interactive codebase explorer with AI-generated summaries
  • Architecture Detection — Auto-detect frameworks, patterns, and structure
  • Powered by NVIDIA NIM — Free AI APIs (Llama 3.1 70B)

Tech Stack

Layer Technologies
Frontend React, TypeScript, Vite, Tailwind CSS
Backend Node.js, Express, TypeScript
Database Supabase (PostgreSQL)
AI NVIDIA NIM (Llama 3.1 for chat, embeddings for search)
Auth GitHub OAuth
Hosting Render

Getting Started

Prerequisites

Setup

  1. Clone and install dependencies:
git clone https://github.com/thxgp/codecontext.git
cd codecontext
npm run install:all
  1. Configure environment variables:
cp .env.example server/.env

Edit server/.env with your credentials:

SUPABASE_URL=your_supabase_project_url
SUPABASE_ANON_KEY=your_supabase_anon_key
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
NVIDIA_API_KEY=your_nvidia_api_key
JWT_SECRET=your_random_secret_key
  1. Create GitHub OAuth App:

    • Go to GitHub Settings → Developer Settings → OAuth Apps
    • Create new app with:
      • Homepage URL: http://localhost:5173
      • Callback URL: http://localhost:5000/api/auth/github/callback
  2. Get NVIDIA NIM API Key:

  3. Run the app:

npm run dev

Project Structure

codecontext/
├── client/                 # React frontend
│   ├── src/
│   │   ├── components/     # UI components
│   │   ├── pages/          # Page components
│   │   ├── stores/         # Zustand state
│   │   ├── services/       # API calls
│   │   └── types/          # TypeScript types
│   └── ...
├── server/                 # Express backend
│   ├── src/
│   │   ├── config/         # Configuration
│   │   ├── models/         # Database models
│   │   ├── routes/         # API routes
│   │   ├── services/       # Business logic
│   │   └── middleware/     # Auth, error handling
│   ├── supabase/           # Database migrations
│   └── ...
└── ...

API Endpoints

Auth

  • GET /api/auth/github — Initiate OAuth
  • GET /api/auth/me — Get current user

Repositories

  • GET /api/repos — List imported repos
  • POST /api/repos — Import new repo
  • GET /api/repos/:id — Get repo details
  • GET /api/repos/:id/structure — Get file tree
  • DELETE /api/repos/:id — Delete repo

AI

  • POST /api/ai/:repoId/ask — Ask question about codebase
  • GET /api/ai/:repoId/search — Search files
  • GET /api/ai/:repoId/chat — Get chat history

License

This project is licensed under the MIT License — see the LICENSE file for details.

About

AI-powered codebase exploration tool. Connect GitHub repos, ask questions in plain English, get answers with file references. Built with React, TypeScript, Tailwind CSS, Node.js, Express, and NVIDIA NIM AI.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors