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 coming soon
- 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
- 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
- Node.js v18+
- A Nebius API key (get one here)
# 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 fileCreate a .env file in the server/ directory:
NEBIUS_API_KEY=your_nebius_api_key_here
FRONTEND_URL=http://localhost:5173
PORT=3001npm run devThe API will be available at http://localhost:3001.
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]..."
}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"
}'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
This project is open source and available under the MIT License.