Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

CodeSage AI 🧠⚡

AI-powered GitHub repository analyzer with codebase explanation, debugging assistance, and file-level chat.

Tech Stack

  • Frontend: React (Vite) + Tailwind CSS + React Flow
  • Backend: Node.js + Express + OpenAI API + GitHub REST API
  • Database: MongoDB

Setup

1. Environment Variables

# server/.env
OPENAI_API_KEY=sk-your-openai-api-key
GITHUB_TOKEN=ghp_your-github-token
MONGO_URI=mongodb://localhost:27017/codesage
PORT=5000
# client/.env
VITE_API_URL=http://localhost:5000/api

2. Install Dependencies

cd server && npm install
cd ../client && npm install

3. Start MongoDB

mongod

4. Run

# Terminal 1 - Backend
cd server && npm run dev

# Terminal 2 - Frontend
cd client && npm run dev

Open http://localhost:5173

API Endpoints

Method Endpoint Description
POST /api/analyze-repo Analyze a GitHub repo (structure, tech stack, AI summary)
POST /api/explain-code Explain a specific file
POST /api/debug Debug an error with AI suggestions
POST /api/chat-file Chat about a file with context

Project Structure

/server
  /controllers    - Request handlers
  /models         - MongoDB schemas (Repo, ChatHistory)
  /routes         - Express routes
  /services       - GitHub API, OpenAI, file parser
  /utils          - Prompts, text chunker
  index.js        - Server entry point

/client
  /src
    /components   - Navbar, FileTree, CodeViewer, GraphView
    /pages        - Home, Dashboard, Debug, FileChat
    /utils        - API client, helpers
    App.jsx       - Root component with routing

About

An AI-powered GitHub repository intelligence platform that helps developers understand, debug, and interact with complex codebases using LLMs.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages