Skip to content

Open source AI bot builder for Slack. Build slack message triggered workflows with native access to MCP servers and SDKs.

Notifications You must be signed in to change notification settings

DrDroidLab/slack-bot-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Slack Bot Builder

A modular web application for building and managing AI-powered Slack bots with workflow automation capabilities.

Features

  • Workflows: Create and manage automated workflows with code generation
  • Slack Bot: Manage bot installation across Slack channels
  • Integrations: Connect with Kubernetes, Jira, and Grafana
  • Git Repository: Version control and file management
  • PostgreSQL Database: Persistent storage for all application data

Quick Start with Docker

Prerequisites

  • Docker
  • Docker Compose

Running the Application

  1. Clone the repository

    git clone <repository-url>
    cd slack-bot-builder
  2. Build and start all services

    docker-compose up --build
  3. Access the application

Database Credentials

  • Database: slack_bot_db
  • Username: slack_bot_user
  • Password: slack_bot_password
  • Host: postgres (internal) or localhost (external)
  • Port: 5432

Development

Backend Development

The backend is a Flask application with PostgreSQL database support.

Key Files:

  • backend/app.py - Main Flask application
  • backend/db_utils.py - Database utilities and managers
  • backend/init.sql - Database schema and initial data

Database Managers:

  • WorkflowManager - Manage workflows
  • SlackChannelManager - Manage Slack channels
  • IntegrationManager - Manage integrations
  • WorkspaceManager - Manage workspace information

Frontend Development

The frontend is a React TypeScript application with modular page structure.

Key Files:

  • frontend/src/App.tsx - Main application with navigation
  • frontend/src/pages/ - Page components
    • WorkflowsPage.tsx - Workflow management
    • SlackBotPage.tsx - Slack bot management
    • IntegrationsPage.tsx - Integration management
    • GitRepoPage.tsx - Git repository management

Docker Services

PostgreSQL Database

  • Image: postgres:15-alpine
  • Port: 5432
  • Volume: postgres_data (persistent)
  • Initialization: backend/init.sql

Backend API

  • Base Image: python:3.11-slim
  • Port: 5000
  • Dependencies: Flask, psycopg2-binary, python-dotenv
  • Environment: Connected to PostgreSQL database

Frontend

  • Build Stage: node:18-alpine
  • Production Stage: nginx:alpine
  • Port: 80
  • Features: React SPA with API proxy to backend

Database Schema

Tables

  1. workflows - Store workflow configurations and generated code
  2. integrations - Store integration settings and connection status
  3. slack_channels - Store Slack channel information and bot installation status
  4. workspace - Store workspace information

Sample Data

The database is initialized with sample data including:

  • Sample workflows
  • Integration configurations (Kubernetes, Jira, Grafana)
  • Sample Slack channels with bot installation status
  • Workspace information

API Endpoints

Workflows

  • GET /api/workflows - Get all workflows
  • POST /api/workflows - Create new workflow
  • PUT /api/workflows/:id - Update workflow
  • DELETE /api/workflows/:id - Delete workflow

Slack Channels

  • GET /api/slack/channels - Get all channels
  • PUT /api/slack/channels/:id/install - Install/remove bot

Integrations

  • GET /api/integrations - Get all integrations
  • PUT /api/integrations/:id/connect - Connect/disconnect integration

Environment Variables

Backend

  • DATABASE_URL - PostgreSQL connection string
  • FLASK_ENV - Flask environment (development/production)
  • FLASK_APP - Flask application entry point

Database

  • POSTGRES_DB - Database name
  • POSTGRES_USER - Database username
  • POSTGRES_PASSWORD - Database password

Commands

Development

# Start all services
docker-compose up

# Start in background
docker-compose up -d

# View logs
docker-compose logs -f

# Stop all services
docker-compose down

# Rebuild and start
docker-compose up --build

# Access database
docker-compose exec postgres psql -U slack_bot_user -d slack_bot_db

Production

# Build production images
docker-compose -f docker-compose.yml build

# Start production services
docker-compose -f docker-compose.yml up -d

Troubleshooting

Database Connection Issues

  1. Check if PostgreSQL container is running: docker-compose ps
  2. Check database logs: docker-compose logs postgres
  3. Verify environment variables in docker-compose.yml

Frontend Build Issues

  1. Clear node_modules: docker-compose exec frontend rm -rf node_modules
  2. Rebuild frontend: docker-compose build frontend

Backend Issues

  1. Check Python dependencies: docker-compose exec backend pip list
  2. Check application logs: docker-compose logs backend

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test with Docker setup
  5. Submit a pull request

License

This project is licensed under the MIT License.

About

Open source AI bot builder for Slack. Build slack message triggered workflows with native access to MCP servers and SDKs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published