chore(readme): update on readme

This commit is contained in:
Davidson Gomes 2024-08-03 10:00:26 -03:00
parent 7ad96f54ca
commit 385307edc6
2 changed files with 49 additions and 109 deletions

156
README.md
View File

@ -14,131 +14,69 @@
<div align="center"><img src="./public/images/cover.png"></div>
## Evolution API - Whatsapp API Node JS
## Evolution API
This project is based on the [CodeChat](https://github.com/code-chat-br/whatsapp-api). The original project is an implementation of [Baileys](https://github.com/WhiskeySockets/Baileys), serving as a Restful API service that controls WhatsApp functions.</br>
The code allows the creation of multiservice chats, service bots, or any other system that utilizes WhatsApp. The documentation provides instructions on how to set up and use the project, as well as additional information about its features and configuration options.
The Evolution API has direct integration with [Typebot](https://github.com/baptisteArno/typebot.io) and [Chatwoot](https://github.com/chatwoot/chatwoot)
## Types of Connections
The Evolution API supports multiple types of connections to WhatsApp, allowing for flexible and powerful integration options:
- **WhatsApp API - Baileys**:
- A free WhatsApp API based on WhatsApp Web, leveraging the [Baileys library](https://github.com/WhiskeySockets/Baileys).
- This connection type allows you to control WhatsApp Web functionalities through a RESTful API, making it suitable for multi-service chats, service bots, or any other systems utilizing WhatsApp.
- Note: This method relies on the web version of WhatsApp and may have limitations compared to official APIs.
- **WhatsApp Cloud API**:
- The official WhatsApp API provided by Meta (formerly Facebook).
- This connection type offers a more robust and reliable solution, designed for businesses needing higher volumes of messaging and better integration support.
- The Cloud API supports features such as end-to-end encryption, advanced analytics, and more comprehensive customer service tools.
- To use this API, you must comply with Meta's policies and potentially pay for usage based on message volume and other factors.
## Integrations
Evolution API supports various integrations to enhance its functionality. Below is a list of available integrations and their uses:
- [Typebot](https://typebot.io/)
- Build conversational bots using Typebot, integrated directly into Evolution with trigger management.
- [Chatwoot](https://www.chatwoot.com/)
- Direct integration with Chatwoot for handling customer service for your business.
- [RabbitMQ](https://www.rabbitmq.com/)
- Receive events from the Evolution API via RabbitMQ.
- [Amazon SQS](https://aws.amazon.com/pt/sqs/)
- Receive events from the Evolution API via Amazon SQS.
- [Socket.io](https://socket.io/)
- Receive events from the Evolution API via WebSocket.
- [Dify](https://dify.ai/)
- Integrate your Evolution API directly with Dify AI for seamless trigger management and multiple agents.
- [OpenAI](https://openai.com/)
- Integrate your Evolution API with OpenAI for AI capabilities, including audio-to-text conversion, available across all Evolution integrations.
- Amazon S3 / Minio
- Store media files received in [Amazon S3](https://aws.amazon.com/pt/s3/) or [Minio](https://min.io/).
## Telemetry Notice
To continuously improve our services, we have implemented telemetry that collects data on the routes used, the most accessed routes, and the version of the API in use. We would like to assure you that no sensitive or personal data is collected during this process. The telemetry helps us identify improvements and provide a better experience for users.
## Evolution Pro Community
## Evolution Support Premium
Join our Evolution Pro community for expert support and a weekly call to answer questions. Visit the link below to learn more and subscribe:
[Click here to learn more](https://pay.kiwify.com.br/SzPrarM)
[Click here to learn more](https://evolution-api.com/suporte-pro)
<br>
<a href="https://pay.kiwify.com.br/SzPrarM">
<a href="https://evolution-api.com/suporte-pro">
<img src="./public/images/evolution-pro.png" alt="Subscribe" width="600">
</a>
# Instalation
### Installing NVM (Node Version Manager)
NVM allows you to install and manage multiple versions of Node.js. This is particularly useful for maintaining compatibility across different projects.
```sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
```
### Installing Node.js
```sh
nvm install v20.10.0 && nvm use v20.10.0
```
### Initializing the Application
Clone the repository:
```sh
git clone https://github.com/EvolutionAPI/evolution-api.git
```
Configure the environment variables in the [.env](./.env.example) file.
### Installing Application Dependencies
```sh
cd evolution-api
npm install
npm run build
```
### Env
> OBS: Rename the [.env.example](./.env.example) file to **.env**
```sh
cp .env.example .env
```
### Database Setup
The application supports PostgreSQL, MySQL, MariaDB.
Run one of the commands below for the non-existence of a database.
- **MySQL or MariaDB**:
```sh
npm run db:migrate:mysql
```
- **PostgreSQL**:
```sh
npm run db:migrate:postgres
```
#### Deploying
> For production environments.
For existing relational databases such as PostgreSQL, MySQL, or MariaDB, the setup involves two essential steps:
1. **Setting the Environment Variable**: Initially, it's imperative to define the `DATABASE_PROVIDER` environment variable in alignment with your relational database type. Use `postgresql` for PostgreSQL, and `mysql` for MySQL or MariaDB. This configuration is crucial as it directs the Prisma ORM regarding the specific relational database in use.
2. **Deploying Schema Changes**: Following this, execute the `npm run db:migrate:postgres` command. This command serves as a shortcut for the `prisma deploy` command, whose main role is to examine the current schema of the relational database and implement necessary modifications. A key feature of this command is its ability to update the database schema without affecting the existing data. This ensures that your current data remains intact while the database schema is updated to meet the latest requirements of the application.
#### Prisma Studio
- **View your data**
```sh
npm run db:studio:mysql
# or
npm run db:studio:postgres
```
This will sync your data models to your database, creating tables as needed.
### Running the Application
- **Development Mode**:
```sh
npm run dev:server
```
- **Production Mode**:
```sh
npm run build
npm run start:prod
```
# Note
This code is in no way affiliated with WhatsApp. Use at your own discretion. Don't spam this.
This code was produced based on the baileys library and it is still under development.
# Donate to the project.
#### PicPay

View File

@ -367,6 +367,7 @@ model OpenaiCreds {
model OpenaiBot {
id String @id @default(cuid())
enabled Boolean @default(true) @db.Boolean
description String? @db.VarChar(255)
botType OpenaiBotType
assistantId String? @db.VarChar(255)
model String? @db.VarChar(100)
@ -448,6 +449,7 @@ model Template {
model Dify {
id String @id @default(cuid())
enabled Boolean @default(true) @db.Boolean
description String? @db.VarChar(255)
botType DifyBotType
apiUrl String? @db.VarChar(255)
apiKey String? @db.VarChar(255)