crs7617 / Code-Reviewer

An automated code review tool that uses LLMs to review and suggest improvements for code submissions in real-time

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Automated Code Review Tool

License Node.js TypeScript

An automated code review tool that uses LLMs to review and suggest improvements for code submissions in real-time. This tool checks for syntax and style issues, provides performance optimization suggestions, detects security vulnerabilities, and integrates seamlessly with CI/CD pipelines.

Table of Contents

Features

  • Syntax and Style Checking: Ensure code follows best practices.
  • Performance Optimization: Suggest improvements for better performance.
  • Security Vulnerability Detection: Identify potential security risks.
  • CI/CD Integration: Seamlessly integrates with CI/CD pipelines.

Tech Stack

  • Backend: Node.js with TypeScript, Express.js
  • API Integration: GitHub API, OpenAI Codex
  • Caching: Redis
  • CI/CD: Webhook support for CI/CD pipeline integration

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/automated-code-review-tool.git
    cd automated-code-review-tool
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    • Create a .env file in the root directory:
      GITHUB_TOKEN=your_github_token
      OPENAI_API_KEY=your_openai_api_key
      REDIS_URL=redis://localhost:6379
      PORT=3000
  4. Compile TypeScript code:

    tsc
  5. Start the server:

    node dist/app.js

Usage

  1. Analyze Code:

    • Send a POST request to /analyze with the code you want to analyze in the request body.
    curl -X POST http://localhost:3000/analyze -H "Content-Type: application/json" -d '{"code": "your_code_here"}'
  2. Get Repository Info:

    • Send a GET request to /repo/:owner/:repo to get information about a specific GitHub repository.
    curl http://localhost:3000/repo/owner/repo

API Endpoints

Analyze Code

  • URL: /analyze
  • Method: POST
  • Request Body:
    {
        "code": "your_code_here"
    }
  • Response:
    {
        "analysis": "Analysis result here"
    }

Get Repository Info

  • URL: /repo/:owner/:repo
  • Method: GET
  • Response:
    {
        "id": 123456789,
        "name": "repository_name",
        "full_name": "owner/repository_name",
        ...
    }

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Steps to Contribute

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature/your-feature).
  6. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.


By following this structure, you provide a clear and comprehensive README that covers the most important aspects of your project, making it easy for others to understand and contribute.

About

An automated code review tool that uses LLMs to review and suggest improvements for code submissions in real-time


Languages

Language:TypeScript 100.0%