Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/coslynx/ai-telegram-bot-dashboard

Project: AI-Powered Telegram Bot with Web Dashboard. Created at https://spectra.codes, which is owned by @Drix10
https://github.com/coslynx/ai-telegram-bot-dashboard

ai-telegram-bot api-integration code-generation code-quality context-aware-chat developer-tools devops express-js image-processing javascript machine-learning multi-model-chat next-js node-js openai-api postgresql software-development typescript user-database web-dashboard

Last synced: 12 days ago
JSON representation

Project: AI-Powered Telegram Bot with Web Dashboard. Created at https://spectra.codes, which is owned by @Drix10

Awesome Lists containing this project

README

        




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](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](https://choosealicense.com/licenses/agpl-3.0/).

## ๐Ÿ‘ฅ Authors
- Author Name - [Spectra.codes](https://spectra.codes)
- Creator Name - [DRIX10](https://github.com/Drix10)


๐ŸŒ Spectra.Codes




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