AI Powered Code Explainer is a web application that explains Python and JavaScript code in simple English using Google's Gemini Large Language Model (LLM). The application accepts code snippets from users and generates easy-to-understand explanations along with functions used, variables used, key parts of the code, and time/space complexity.
- Explain Python code
- Explain JavaScript code
- AI-generated explanation in simple English
- Displays Functions Used
- Displays Variables Used
- Highlights Key Parts of the Code
- Estimates Time Complexity
- Estimates Space Complexity
- Suggests Optimized Code (when applicable)
- Copy Explanation
- Clear Input
- HTML5
- CSS3
- JavaScript
- Node.js
- Express.js
- Google Gemini 2.5 Flash
AI-Code-Explainer
│
├── public
│ ├── index.html
│ ├── style.css
│ └── script.js
│
├── server.js
├── package.json
├── package-lock.json
├── README.md
└── .env.example
User
│
▼
Frontend (HTML/CSS/JavaScript)
│
HTTP Request
│
▼
Node.js + Express Server
│
Gemini API Request
│
▼
Google Gemini LLM
│
AI Response
│
▼
Browser
Google Gemini 2.5 Flash was selected because it is:
- Fast
- Accurate
- Easy to integrate
- Suitable for explaining source code
- Public Large Language Model
- Express.js was used to create REST APIs.
- HTML, CSS and JavaScript were chosen to keep the frontend lightweight.
- Gemini API was used for AI-powered explanations.
- Environment variables are stored in a
.envfile for security.
Clone the repository
git clone <repository-url>
Install dependencies
npm install
Create a .env file
GEMINI_API_KEY=YOUR_API_KEY
Run the project
node server.js
Open
http://localhost:3000
def add(a,b):
return a+b
print(add(10,20))- Explanation
- Functions Used
- Variables Used
- Key Parts
- Time Complexity
- Space Complexity
- Optimized Code (if applicable)
- Syntax Highlighting
- Download Explanation as PDF
- Dark Mode
- Multi-language Support
- Code Comparison
- File Upload Support
Neha Kale
Bachelor of Engineering (Computer Engineering)
Savitribai Phule Pune University



