An AI-powered tool that generates meaningful comments for code snippets written in Python, C++, and Java. It comes with:
- A Flask backend API for programmatic access.
- A Streamlit frontend UI for an interactive experience.
- Generate comments for Python, C++ and Java code.
- Simple REST API endpoints.
- Clean Streamlit interface with Lottie animations.
- Modular code structure for easy extension.
π Project Structure Auto_Comments-main βββ routes β βββ cpp_route.py β βββ java_route.py β βββ main_route.py β βββ python_route.py βββ src β βββ cpp β βββ java β βββ python βββ static β βββ type_lottie.json βββ LICENSE βββ README.md βββ app.py # Streamlit UI βββ requirements.txt βββ server.py # Flask API server
βοΈ Installation
-
Clone the repository: git clone https://github.com/your-username/auto-comments.git cd auto-comments
-
Create and activate a virtual environment: python -m venv venv source venv/bin/activate # Mac/Linux venv\Scripts\activate # Windows
-
Install dependencies: pip install -r requirements.txt
Option 2 β Run Flask API python server.py Server runs at: http://127.0.0.1:5000
Available endpoints: /python β Generate comments for Python code /cpp β Generate comments for C++ code /java β Generate comments for Java code
π Example (API) POST β /python { "code_snippet": "def add(a, b): return a + b" }
Response:
def add(a, b): return a + b
π¨ UI Preview Landing page shows an animation when no language is selected. Paste your code in the text area. Get instant AI-generated comments.
π οΈ Tech Stack Backend: Flask Frontend: Streamlit + Lottie animations Languages Supported: Python, C++, Java