A comprehensive web application for code analysis, management, and AI-powered assistance using Google Gemini API.
- Code Upload & Analysis: Upload code files and get instant AI-powered analysis
- AI Chat Assistant: Chat with an intelligent code assistant powered by Google Gemini
- RAG System: Retrieval-Augmented Generation for context-aware responses
- User Authentication: Secure login/signup system
- Code Management: Store and manage code files in SQLite database
- Real-time Analysis: Get quality assessment, bug detection, and optimization suggestions
- Backend: Flask (Python)
- Database: SQLite3
- AI Integration: Google Gemini API
- Frontend: HTML5, CSS3, JavaScript, Bootstrap 5
- Authentication: Session-based authentication
-
Clone the repository
git clone https://github.com/Samviksanjee/Code-Analysier cd code-analyser -
Create a virtual environment
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
- Copy
env_example.txtto.env - Update the API key and secret key in
.env:
GEMINI_API_KEY=your_gemini_api_key_here SECRET_KEY=your_secret_key_here - Copy
-
Run the application
python app.py
-
Access the application
- Open your browser and go to
http://localhost:5000
- Open your browser and go to
- Sign Up: Create a new account or login with existing credentials
- Upload Code: Go to the Upload Code section and paste your code
- View Analysis: Check the analysis results in your dashboard
- Chat with Bot: Use the chat feature to ask questions about your code
- Upload code files with filename and language specification
- Get comprehensive AI analysis including:
- Code quality assessment
- Bug detection and potential issues
- Performance optimization suggestions
- Security considerations
- Best practices recommendations
- Ask questions about your uploaded code
- Get help with programming concepts
- Debugging assistance
- Code optimization suggestions
- Context-aware responses using RAG system
- View all uploaded code files
- Access analysis results
- Manage your code library
- Quick access to all features
The application uses Google Gemini API for:
- Code analysis and quality assessment
- AI-powered chat responses
- RAG (Retrieval-Augmented Generation) system
- Go to Google AI Studio
- Create a new API key
- Add the key to your
.envfile
The application uses SQLite3 with the following tables:
- users: User authentication and profile information
- code_files: Stored code files with analysis results
- chat_history: Chat conversation history
code-analyser/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── env_example.txt # Environment variables template
├── README.md # This file
├── templates/ # HTML templates
│ ├── base.html
│ ├── index.html
│ ├── login.html
│ ├── signup.html
│ ├── dashboard.html
│ ├── upload.html
│ ├── chat.html
│ └── analysis.html
└── static/ # Static files
├── style.css
└── script.js
- Password hashing using SHA-256
- Session-based authentication
- SQL injection protection
- Input validation and sanitization
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
For support and questions, please open an issue in the repository.
- File upload support (drag & drop)
- Multiple programming language support
- Code comparison features
- Export analysis reports
- Team collaboration features
- Advanced code metrics
- Integration with version control systems