A powerful backend service that powers the Codinsight VS Code extension, helping developers understand code through AI-powered explanations.
The extension is available to use from this link.
Codinsight is a VS Code extension that provides intelligent code explanations. It leverages Large Language Models to analyze and explain code snippets, making code comprehension faster and easier.
This repo is the backend of the extension.
- Code explanation generation using LLMs
- Support for multiple programming languages
- Fast API responses for real-time code analysis
- Docker containerization for easy deployment
- Multi-architecture support (AMD64/ARM64)
- Framework: FastAPI, Pydantic
- Language: Python
- Database: MongoDB
- Containerization: Docker
- CI/CD: GitHub Actions
- Cloud: AWS ECR for container registry, AWS ECS for container deployment
- AI: LLM Integration
- Python 3.9 or higher
- Docker
- AWS CLI (for deployment)
- Clone the repository:
git clone https://github.com/yourusername/codinsight.git
cd codinsight
- 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
- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration
- Run the development server:
fastapi dev src/main.py
- Build the Docker image:
docker build -t codinsight .
- Run the container:
docker run -p 80:80 --env-file .env codinsight
http://localhost/
The project uses GitHub Actions for CI/CD, automatically building and pushing Docker images to Amazon ECR (and Docker hub).
The project provide Docker images versionning using specific commit hash for better traceability and reproducibility.
- Create an ECR repository
- Configure AWS credentials in GitHub secrets
- Set up necessary IAM roles and permissions
Required environment variables:
DATABASE_URL=
API_V1_STR=
PROJECT_NAME=
DESCRIPTION=
VERSION=
SECRET_KEY=
ACCESS_TOKEN_EXPIRE_MINUTES=
ALLOWED_ORIGINS=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
LLM_API_KEY=
MODEL=
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
[Your chosen license]