Skip to content

Latest commit

 

History

History
211 lines (192 loc) · 9.53 KB

File metadata and controls

211 lines (192 loc) · 9.53 KB


ai-telegram-bot-dashboard

AI-powered Telegram bot with a comprehensive web dashboard for managing and enhancing AI-assisted conversations and content analysis.

Developed with the software and tools below.

Framework used Frontend technologies used Backend technology used AI technologies used

git-last-commit GitHub commit activity GitHub top language

📑 Table of Contents

  • 📍 Overview
  • 📦 Features
  • 📂 Structure
  • 💻 Installation
  • 🏗️ Usage
  • 🌐 Hosting
  • 📄 License
  • 👏 Authors

📍 Overview

This repository houses the "ai-telegram-bot-dashboard" project, which brings together the power of AI and Telegram to provide a sophisticated communication and automation platform. The project features a robust web dashboard that allows for seamless management and configuration of the AI-powered bot.

📦 Features

Feature Description
⚙️ Architecture The project's architecture is designed for modularity, scalability, and maintainability, with separate components for bot logic, web dashboard, and AI integration.
📄 Documentation This README file provides a comprehensive overview of the project, its features, dependencies, and instructions for installation and usage.
🔗 Dependencies The project leverages a range of popular libraries and packages, including Next.js, Express.js, Prisma, OpenAI, and LangChain, to ensure efficient development and integration.
🧩 Modularity The codebase is structured modularly, with distinct directories for frontend (web dashboard), backend (API), and telegram bot functionalities. This approach facilitates easier code maintenance and allows for efficient expansion.
🧪 Testing Thorough testing is implemented to ensure the reliability and robustness of the codebase, utilizing frameworks like Jest.
⚡️ Performance Performance optimization strategies are employed to ensure a smooth and responsive user experience, including caching, database optimization, and efficient resource utilization.
🔐 Security Robust security measures are implemented to protect sensitive user data and ensure secure communication. These measures include input validation, data encryption, and regular security audits.
🔀 Version Control The project utilizes Git for version control, with GitHub Actions workflow files for automated build and release processes.
🔌 Integrations The platform integrates with various services and APIs, including the Telegram Bot API, OpenAI API, weather APIs, news APIs, image processing APIs, and translation APIs.
📶 Scalability The project is designed for scalability to handle increased user loads and data volumes, leveraging cloud-based infrastructure and database optimizations.

📂 Structure

├── src
│   ├── telegram
│   │   ├── utils
│   │   │   └── bot.ts
│   │   ├── services
│   │   │   └── openai.service.ts
│   │   ├── types
│   │   │   └── types.ts
│   │   ├── commands
│   │   │   ├── help.ts
│   │   │   ├── start.ts
│   │   │   └── translate.ts
│   │   ├── events
│   │   │   └── message.ts
│   │   └── index.ts
│   │       └── constants.ts
│   ├── web
│   │   ├── api
│   │   │   ├── controllers
│   │   │   │   ├── user.controller.ts
│   │   │   │   ├── admin.controller.ts
│   │   │   │   ├── image.controller.ts
│   │   │   │   ├── conversation.controller.ts
│   │   │   │   └── bot.controller.ts
│   │   │   ├── middlewares
│   │   │   │   ├── auth.middleware.ts
│   │   │   │   └── validate.middleware.ts
│   │   │   ├── services
│   │   │   │   ├── user.service.ts
│   │   │   │   ├── image.service.ts
│   │   │   │   ├── conversation.service.ts
│   │   │   │   └── bot.service.ts
│   │   │   └── routes.ts
│   │   ├── pages
│   │   │   ├── admin
│   │   │   │   ├── dashboard
│   │   │   │   │   └── index.tsx
│   │   │   │   ├── users
│   │   │   │   │   └── index.tsx
│   │   │   │   └── settings
│   │   │   │       └── index.tsx
│   │   │   ├── auth
│   │   │   │   └── login.tsx
│   │   │   ├── conversations
│   │   │   │   └── index.tsx
│   │   │   └── index.tsx
│   │   ├── config
│   │   │   └── env.ts
│   │   ├── app.tsx
│   │   ├── db.ts
│   │   ├── utils
│   │   │   ├── error.ts
│   │   │   ├── logger.ts
│   │   │   └── response.ts
│   │   ├── types
│   │   │   ├── types.ts
│   │   │   └── user.ts
│   ├── core
│   │   ├── config
│   │   │   └── openai.config.ts
│   │   ├── utils
│   │   │   ├── string.ts
│   │   │   ├── time.ts
│   │   │   └── logger.ts
│   │   ├── types
│   │   │   └── types.ts
│   │   └── constants.ts
│   ├── models
│   │   ├── User.ts
│   │   ├── Conversation.ts
│   │   └── Image.ts
│   └── prisma
│       └── schema.prisma
├── .eslintrc.js
├── tsconfig.json
├── next.config.js
├── tailwind.config.js
└── package.json

💻 Installation

🔧 Prerequisites

  • Node.js
  • npm
  • Docker

🚀 Setup Instructions

  1. Clone the repository:
    • git clone https://github.com/spectra-ai-codegen/ai-telegram-bot-dashboard.git
  2. Navigate to the project directory:
    • cd ai-telegram-bot-dashboard
  3. Install dependencies:
    • npm install

🏗️ Usage

🏃‍♂️ Running the Project

  1. Start the development server:
    • npm start
  2. Open your browser and navigate to http://localhost:3000.

⚙️ Configuration

Adjust configuration settings in config.js or .env.

📚 Examples

  • 📝 Example 1: Send a text message to the bot and receive an AI-generated response.
  • 📝 Example 2: Utilize the image processing features to extract text from an image or generate a caption for an image.
  • 📝 Example 3: Access the web dashboard to manage bot settings, monitor bot usage, and configure user access.

🌐 Hosting

🚀 Deployment Instructions

Docker and Cloud Deployment

  1. Build the Docker image:
    • docker build -t ai-telegram-bot-dashboard .
  2. Run the Docker container:
    • docker run -p 3000:3000 ai-telegram-bot-dashboard

Heroku

  1. Install the Heroku CLI:
    • npm install -g heroku
  2. Login to Heroku:
    • heroku login
  3. Create a new Heroku app:
    • heroku create
  4. Deploy the code:
    • git push heroku main

🔑 Environment Variables

  • TELEGRAM_BOT_TOKEN: Your Telegram bot token
  • OPENAI_API_KEY: Your OpenAI API key
  • DATABASE_URL: Your database connection URL

📜 API Documentation

🔍 Endpoints

  • GET /api/bot/messages: Retrieves a list of messages sent to the bot.
  • POST /api/bot/messages: Sends a message to the bot.
  • GET /api/admin/users: Retrieves a list of users.
  • POST /api/admin/users: Creates a new user.

🔒 Authentication

Use JWT tokens for authentication.

📝 Examples

  • curl -X GET http://localhost:3000/api/bot/messages

📜 License

This project is licensed under the GNU AGPLv3.

👥 Authors

  • Author Name - Spectra.codes

  • Creator Name - DRIX10

    🌐 Spectra.Codes

    Why only generate Code? When you can generate the whole Repository!