help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
code-assistant-bot
RSK World
code-assistant-bot
Code Assistant Bot - Python + Flask + OpenAI API + Code Generation + Debugging + Code Analysis + GitHub Integration
code-assistant-bot
  • __pycache__
  • static
  • templates
  • utils
  • .env.example755 B
  • .gitignore956 B
  • CHANGELOG.md3.6 KB
  • DEPLOYMENT.md1.9 KB
  • FEATURES.md5 KB
  • GITHUB_RELEASE_INSTRUCTIONS.md3.9 KB
  • LICENSE1.2 KB
  • Procfile44 B
  • README.md10 KB
  • README_DEPLOYMENT.md2.3 KB
  • RELEASE_NOTES.md3.9 KB
  • app.py18.5 KB
  • code-assistant-bot.png1.1 MB
  • config.py3.2 KB
  • requirements.txt851 B
  • run.py1.6 KB
  • runtime.txt15 B
  • vercel.json314 B
  • wsgi.py271 B
README.md
README.md
Raw Download

README.md

# Code Assistant Bot

**AI-powered coding assistant for code generation, debugging, and explanations**

![Code Assistant Bot](code-assistant-bot.png)

**Author:** RSK World
**Founder:** Molla Samser
**Designer & Tester:** Rima Khatun
**Contact:** help@rskworld.in | +91 93305 39277
**Website:** [https://rskworld.in](https://rskworld.in)
**Year:** 2026

---

## ๐Ÿ“‹ Project Overview

Code Assistant Bot is an advanced AI-powered coding assistant that helps developers with:
- **Code Generation** - Generate code from natural language descriptions
- **Debugging Assistance** - Find bugs and get suggestions for fixes
- **Code Explanations** - Understand complex code with detailed explanations
- **Syntax Checking** - Validate syntax across multiple programming languages
- **Code Analysis** - Analyze code quality, complexity, and metrics
- **GitHub Integration** - Search and explore repositories

Perfect for coding platforms, developer tools, and programming education.

---

## ๐Ÿš€ Features

### Core Features
- โœ… **Code Generation** - Generate code in 16+ programming languages
- โœ… **Debugging Help** - Identify and fix code errors
- โœ… **Code Explanations** - Get detailed explanations of code logic
- โœ… **Syntax Validation** - Check syntax errors in real-time
- โœ… **Code Analysis** - Analyze code quality and complexity
- โœ… **GitHub Search** - Search repositories by language and keywords

### Supported Languages
- Python, JavaScript, TypeScript, Java
- C++, C, C#, PHP, Ruby, Go, Rust
- HTML, CSS, SQL, Swift, Kotlin

### Advanced Features
- ๐ŸŽฏ **Intelligent Code Analysis** - Cyclomatic complexity, cognitive complexity
- ๐Ÿ” **Security Scanning** - Detect common security vulnerabilities
- ๐Ÿ“Š **Quality Metrics** - Code quality scoring and suggestions
- ๐ŸŒ **GitHub Integration** - Search and explore repositories
- ๐Ÿ“ฑ **Responsive Design** - Works on all devices
- ๐ŸŽจ **Modern UI** - Beautiful, intuitive interface

---

## ๐Ÿ› ๏ธ Technologies Used

### Backend
- **Python 3.8+** - Core programming language
- **Flask** - Web framework
- **OpenAI API** - AI-powered code processing
- **AST** - Python code analysis
- **Requests** - HTTP client for GitHub API

### Frontend
- **HTML5** - Semantic markup
- **CSS3** - Modern styling with animations
- **JavaScript ES6+** - Interactive functionality
- **Bootstrap 5** - Responsive UI framework
- **Font Awesome** - Icon library
- **Prism.js** - Syntax highlighting

### Development Tools
- **pytest** - Testing framework
- **black** - Code formatting
- **flake8** - Linting
- **python-dotenv** - Environment management

---

## ๐Ÿ“ฆ Installation

### Prerequisites
- Python 3.8 or higher
- pip (Python package manager)
- OpenAI API key

### Step 1: Clone the Repository
```bash
git clone https://github.com/your-repo/code-assistant-bot.git
cd code-assistant-bot
```

### Step 2: Create Virtual Environment
```bash
python -m venv venv

# Windows
venv\Scripts\activate

# macOS/Linux
source venv/bin/activate
```

### Step 3: Install Dependencies
```bash
pip install -r requirements.txt
```

### Step 4: Environment Configuration
```bash
# Copy environment template
cp .env.example .env

# Edit .env file with your configuration
# Add your OpenAI API key
OPENAI_API_KEY=your_openai_api_key_here
```

### Step 5: Run the Application
```bash
python app.py
```

The application will be available at `http://localhost:5000`

---

## ๐Ÿ”ง Configuration

### Environment Variables
Create a `.env` file with the following variables:

```env
# OpenAI API Configuration
OPENAI_API_KEY=your_openai_api_key_here

# Flask Configuration
SECRET_KEY=your_secret_key_here
FLASK_ENV=development
PORT=5000

# GitHub API Configuration (Optional)
GITHUB_TOKEN=your_github_personal_access_token_here

# Application Configuration
MAX_CODE_LENGTH=10000
RATE_LIMIT_PER_MINUTE=60
LOG_LEVEL=INFO
```

### OpenAI API Setup
1. Visit [OpenAI Platform](https://platform.openai.com/)
2. Create an account or sign in
3. Generate an API key
4. Add the API key to your `.env` file

### GitHub Token Setup (Optional)
1. Visit [GitHub Settings > Developer settings > Personal access tokens](https://github.com/settings/tokens)
2. Generate a new token with `public_repo` scope
3. Add the token to your `.env` file for higher rate limits

---

## ๐Ÿ“– Usage Guide

### Code Generation
1. Select "Generate Code" from the action dropdown
2. Choose your programming language
3. Describe the code you want to generate
4. Click "Generate Code"

### Debugging
1. Select "Debug Code" from the action dropdown
2. Paste your code in the input area
3. Optionally add any error messages
4. Click "Debug Code"

### Code Explanation
1. Select "Explain Code" from the action dropdown
2. Paste the code you want to understand
3. Click "Explain Code"

### Syntax Checking
1. Select "Check Syntax" from the action dropdown
2. Paste your code
3. Click "Check Syntax"

### GitHub Search
1. Enter search terms in the GitHub search box
2. Optionally filter by programming language
3. Click "Search" to explore repositories

---

## ๐Ÿ—๏ธ Project Structure

```
code-assistant-bot/
โ”œโ”€โ”€ app.py # Main Flask application
โ”œโ”€โ”€ config.py # Configuration settings
โ”œโ”€โ”€ requirements.txt # Python dependencies
โ”œโ”€โ”€ .env.example # Environment template
โ”œโ”€โ”€ utils/ # Utility modules
โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”œโ”€โ”€ code_analyzer.py # Code analysis utilities
โ”‚ โ”œโ”€โ”€ github_integration.py # GitHub API integration
โ”‚ โ””โ”€โ”€ syntax_checker.py # Syntax checking utilities
โ”œโ”€โ”€ templates/ # HTML templates
โ”‚ โ””โ”€โ”€ index.html # Main frontend interface
โ”œโ”€โ”€ static/ # Static assets
โ”‚ โ”œโ”€โ”€ css/
โ”‚ โ”‚ โ””โ”€โ”€ style.css # Custom styling
โ”‚ โ””โ”€โ”€ js/
โ”‚ โ””โ”€โ”€ app.js # Frontend JavaScript
โ”œโ”€โ”€ tests/ # Test files (optional)
โ””โ”€โ”€ README.md # This file
```

---

## ๐Ÿ”Œ API Endpoints

### Core Endpoints
- `POST /api/generate` - Generate code from prompt
- `POST /api/debug` - Debug code and provide fixes
- `POST /api/explain` - Explain code functionality
- `POST /api/syntax-check` - Check code syntax
- `POST /api/analyze` - Analyze code quality
- `POST /api/github/search` - Search GitHub repositories
- `GET /api/languages` - Get supported languages
- `GET /health` - Health check endpoint

### Request Format
```json
{
"code": "your code here",
"language": "python",
"prompt": "description for code generation",
"error_message": "optional error message for debugging"
}
```

### Response Format
```json
{
"success": true,
"result": "processed result",
"language": "python",
"timestamp": "2026-01-09T22:33:00"
}
```

---

## ๐Ÿงช Testing

### Run Tests
```bash
# Install test dependencies
pip install pytest pytest-flask

# Run all tests
pytest

# Run with coverage
pytest --cov=utils
```

### Manual Testing
1. Start the application: `python app.py`
2. Open browser to `http://localhost:5000`
3. Test each feature through the web interface
4. Verify API endpoints using tools like Postman

---

## ๐Ÿš€ Deployment

### Production Deployment

#### Using Docker
```dockerfile
FROM python:3.9-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .
EXPOSE 5000

CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"]
```

#### Using Gunicorn
```bash
# Install gunicorn
pip install gunicorn

# Run production server
gunicorn --bind 0.0.0.0:5000 app:app
```

#### Environment Setup
- Set `FLASK_ENV=production`
- Use a proper WSGI server like Gunicorn
- Configure reverse proxy (Nginx/Apache)
- Set up SSL certificates
- Configure monitoring and logging

---

## ๐Ÿ”’ Security Considerations

### API Key Security
- Never expose OpenAI API keys in frontend code
- Use environment variables for sensitive data
- Rotate API keys regularly
- Monitor API usage for unusual activity

### Input Validation
- Code length is limited to 10,000 characters
- Input sanitization for all user inputs
- Rate limiting to prevent abuse
- Error handling without exposing system details

### Best Practices
- Use HTTPS in production
- Implement proper authentication if needed
- Regular security updates
- Monitor for vulnerabilities

---

## ๐Ÿค Contributing

We welcome contributions! Please follow these guidelines:

### Development Setup
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests for new functionality
5. Submit a pull request

### Code Style
- Follow PEP 8 for Python code
- Use Black for code formatting
- Add comments for complex logic
- Include docstrings for functions

### Commit Messages
- Use clear, descriptive commit messages
- Start with a verb (Fix, Add, Update, etc.)
- Include issue numbers when applicable

---

## ๐Ÿ“ License

This project is part of RSK World's educational resources.

**ยฉ 2026 RSK World. All rights reserved.**

**Developed by:** Molla Samser
**Designed & Tested by:** Rima Khatun

**Contact Information:**
- **Email:** help@rskworld.in
- **Phone:** +91 93305 39277
- **Address:** Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India - 713147
- **Website:** [https://rskworld.in](https://rskworld.in)

---

## ๐ŸŒŸ Acknowledgments

- **OpenAI** - For providing the powerful GPT API
- **GitHub** - For repository search functionality
- **Bootstrap** - For the responsive UI framework
- **Prism.js** - For syntax highlighting
- **Font Awesome** - For beautiful icons

---

## ๐Ÿ“ž Support

For support, questions, or feedback:

- ๐Ÿ“ง **Email:** help@rskworld.in
- ๐ŸŒ **Website:** [https://rskworld.in](https://rskworld.in)
- ๐Ÿ“ฑ **Phone:** +91 93305 39277

---

**Made with โค๏ธ by RSK World**

*Empowering developers with AI-powered tools since 2026*

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer