Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

CodeXplane

An AI-powered code explanation API that turns pasted code snippets into clear, step-by-step guides. Built with Node.js and Express, it connects to an open-source LLM to generate human-readable explanations of code in any programming language.

Demo

Demo coming soon

CodeXplane Demo

Features

  • Code Explanation API — Send any code snippet and get a plain-English breakdown
  • Multi-Language Support — Explain code in JavaScript, Python, C++, Java, and more
  • Security Hardened — Helmet.js security headers, CORS policy, and IP-based rate limiting
  • Rate Limiting — 100 requests per 15 minutes per IP to prevent abuse
  • LLM Integration — Powered by an open-source 120B parameter model via Nebius API

Tech Stack

  • Runtime: Node.js (ES Modules)
  • Framework: Express.js v5
  • Security: Helmet, CORS, express-rate-limit
  • AI: OpenAI SDK (Nebius-hosted open-source LLM)
  • Config: dotenv

Getting Started

Prerequisites

Installation

# Clone the repo
git clone https://github.com/poudelrohan/CodeXplane.git
cd CodeXplane/server

# Install dependencies
npm install

# Create .env file
cp .env.example .env
# Add your NEBIUS_API_KEY to the .env file

Environment Variables

Create a .env file in the server/ directory:

NEBIUS_API_KEY=your_nebius_api_key_here
FRONTEND_URL=http://localhost:5173
PORT=3001

Run the Server

npm run dev

The API will be available at http://localhost:3001.

API Usage

Explain Code

POST /api/explain-code

Request Body:

{
  "code": "const arr = [1, 2, 3]; arr.map(x => x * 2);",
  "language": "javascript"
}

Response:

{
  "explanation": "This code creates an array [1, 2, 3] and uses the map method to double each element, resulting in [2, 4, 6]..."
}

Example with cURL

curl -X POST http://localhost:3001/api/explain-code \
  -H "Content-Type: application/json" \
  -d '{
    "code": "def fib(n): return n if n <= 1 else fib(n-1) + fib(n-2)",
    "language": "python"
  }'

Project Structure

CodeXplane/
├── server/
│   ├── server.js        # Express server with API routes and LLM integration
│   ├── package.json     # Dependencies and scripts
│   └── .env             # Environment variables (not committed)
├── .gitignore
└── README.md

License

This project is open source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages