KodlaBak is an AI-powered code mentor application designed to help software learners improve their code quality. It analyzes user-submitted code using Google Gemini and provides feedback based on SOLID principles, Clean Code practices, and refactoring suggestions.
- ✅ User authentication (JWT-based)
- 🤖 AI-based code analysis using Gemini Pro
- 📝 Markdown-rendered feedback
- 🌈 Syntax-highlighted code suggestions (collapsible)
- 🗂️ History of past analyses organized by AI-generated titles
- 💻 Built with React (frontend) and FastAPI (backend)
git clone https://github.com/yourusername/kodlabak.git
cd backend
python -m venv venv
source venv/bin/activate # For Windows: venv\Scripts\activate
pip install -r requirements.txtDATABASE_URL=sqlite:///./kodlabak.db
SECRET_KEY=your-secret-key
GEMINI_API_KEY=your-gemini-api-keycd kodla-bak
uvicorn backend.app:app --reloadcd frontend
npm install
npm start🧠 How AI Code Analysis Works
-
The user writes code and selects the programming language.
-
The backend sends the code to Gemini Pro with a custom prompt.
-
AI returns a response structured in sections:
-
What the code does
-
Issues based on SOLID and Clean Code
-
mprovement suggestions
-
Code block (shown only when requested)
kodla-bak/
├── backend/ # FastAPI backend
│ ├── ai/ # AI logic for code analysis
│ ├── api/ # API endpoints
│ ├── auth/ # Authentication and JWT handling
│ ├── db/ # Database session and models
│ ├── models/ # Pydantic data models
│ ├── schemas/ # Request/response schemas
│ ├── venv/ # Virtual environment (excluded from version control)
│ ├── app.py # FastAPI app entry point
│ └── requirements.txt # Python dependencies
├── frontend/ # React frontend
│ ├── public/ # Static files
│ └── src/
│ ├── components/ # Reusable UI components
│ ├── pages/ # Page-level React components
│ ├── services/ # API interaction functions
│ ├── utils/ # Utility/helper functions
│ ├── App.js # Main React component
│ ├── index.js # React entry point
│ └── ... # Other config/test/style files
├── .env # Environment variables
├── .env.example # Example env file
├── kodlabak.db # SQLite DB (development only)
├── package.json # Frontend dependencies
├── tailwind.config.js # TailwindCSS config
└── README.md # Project documentation