Skip to content

An intelligent system that automatically generates insightful comments for code commits and sends notifications through Slack, powered by DeepSeek AI.

License

Notifications You must be signed in to change notification settings

ctkqiang/devbot

Repository files navigation

DevBot 🤖

License: MIT C Spring Boot

An intelligent system that automatically generates insightful comments for code commits and sends notifications through Slack, powered by DeepSeek AI.

📚 Table of Contents

✨ Features

  • 🔄 Real-time commit analysis
  • 🤖 AI-powered code review comments
  • 💬 Slack integration
  • 🛡️ Robust error handling
  • 💾 Efficient memory management
  • 🔒 Secure API handling

🏗 System Architecture

system_arch

Data Flow

data_flow

Mathematical Model

$$M_{total} = M_{base} + (N_{chars} × S_{char}) B_{size} = min(4096, max(1024, L_{input} × 2))$$

🚀 Installation

Prerequisites

  • C Compiler (GCC recommended)
  • Make
  • libcurl

Quick Start

# Clone the repository
git clone https://github.com/ctkqiang/devbot.git

# Navigate to project directory
cd devbot

# Compile the project
gcc -Wall -Wextra -I. -o dev_bot main.c deepseek_api.c slack_api.c -lcurl

# Run the application
./dev_bot

Note: Make sure you have GCC and libcurl installed on your system:

For Ubuntu/Debian:

sudo apt-get install gcc libcurl4-openssl-dev

For macOS (using Homebrew):

brew install gcc curl

💻 Usage

Environment Setup

export OPENROUTER_API_KEY="your-api-key"
export SLACK_WEBHOOK_URL="your-webhook-url"

Example Implementation

void handlePushEvent(const PushEvent* event) {
    for (int i = 0; i < event->commitCount; i++) {
        char* comment = generateComment(event->commits[i].message);
        sendMessage(slackMessage);
    }
}

🔧 Technical Details

Core Components

  1. HTTP Utilities

    • Memory-safe callback mechanisms
    • Dynamic buffer management
    • Robust error handling
  2. DeepSeek AI Integration

    • Natural language processing
    • Contextual code analysis
    • Intelligent comment generation
  3. Slack Integration

    • Real-time notifications
    • Webhook communication
    • Message formatting

Memory Management

*response = realloc(*response, strlen(*response) + realsize + 1);

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

🔮 Future Enhancements

  • Multiple AI model support
  • Enhanced context awareness
  • Additional platform integrations
  • CI/CD pipeline integration

📄 License

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

💝 Support

If you find this project helpful and would like to support its continued development and maintenance, 🥰 I deeply appreciate your generosity. Your donation will help me continue to improve and add new features to this project. Through financial contributions, you'll help ensure this project remains free and open to everyone. Even a small donation can make a big impact and serves as personal encouragement.

You can scan the following Alipay QR codes to make a personal donation:


ko-fi

Donations

🔗 Connect


Made with ❤️ by 钟智强

About

An intelligent system that automatically generates insightful comments for code commits and sends notifications through Slack, powered by DeepSeek AI.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published