This repository contains a Code Commenter application, which helps generate comments for your code to enhance its readability and maintainability. The project consists of two main parts:
- Frontend: A React-based user interface.
- Backend: A Flask-based server.
- Generate code comments programmatically.
- Seamless integration between frontend and backend.
- Supports Google Gemini API for enhanced comment generation.
Ensure you have the following installed on your machine:
- Node.js (for the frontend): Download Node.js
- Python (for the backend): Download Python
- Google Gemini API Key: Follow the instructions below to obtain an API key.
-
Follow the steps provided to generate your API key.
-
Once obtained, store the API key in a
.env
file in thebackend
folder:API_KEY=your_api_key_here
git clone https://github.com/vinay-s36/code-commenter.git
cd code-commenter
-
Navigate to the
backend
folder:cd backend
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the backend server:
python main.py
The backend server will start on http://127.0.0.1:5000
by default.
-
Navigate to the
frontend
folder:cd frontend
-
Install dependencies:
npm install
-
Start the React development server:
npm run dev
The frontend will start on http://localhost:3000
by default.
- Ensure both the backend and frontend servers are running.
- Open a browser and navigate to
http://localhost:3000
. - Upload your code or input the text to generate comments using the interface.
code-commenter/
├── frontend/ # React frontend code
└── backend/ # Flask backend code