This project introduces a chat functionality that supports multiple mediums. The app facilitates chat via WhatsApp using the WhatsApp Cloud API and enables bidirectional communication through Centrifugo. It also features AI-assisted messaging.
-
Backend: The backend component comprises APIs responsible for managing chat-related functionalities.
-
chatbot-context: For generating AI responses using a trained model, with the ability to upload a data source.
-
Authentication Shield: Ensures secure access to the chat app system by implementing robust authentication mechanisms to protect sensitive user data and system functionalities.
Before getting started, ensure the following prerequisites are met:
- Docker installed on your machine
-
Clone Repository: Begin by cloning the repository to your local machine.
-
Install centrifugo: Execute the following command in your project root directory.
curl -sSLf https://centrifugal.dev/install.sh | sh
- Generate config files : Execute the following command in your project root directory. Afterward, customize the configuration according to your preferences.
./centrifugo genconfig
- Replace Meta credentials : Replace the placeholder credentials with your actual Meta credentials in the project table within the provided seed file located in the
backend
->shared
->prisma
->seeder
folder.
import { PrismaClient } from '@prisma/client'
async function addProject(prisma: PrismaClient): Promise<void> {
await prisma.projects.create({
data: {
id: "1",
name: 'Sample project',
webhook_url: 'YOUR_WEBHOOK_URL',
channel_name: 'YOUR_CENTRIFUGO_CHANNEL_NAME',
whatsapp_business_id: 'YOUR_BUSINESS_ID',
whatsapp_phone_number_id: 'YOUR_PHONE_NUMBER_ID',
whatsapp_business_token: 'YOUR_BUSINESS_TOKEN',
webhook_verify_token: 'YOUR_WEHOOK_VERIFY_TOKEN',
},
})
}
export default addProject
-
Add ENV : Add env files in the backend and shield folders. You can find sample in
sample.env.function
andsample.env
, which indicate where they are required. -
Build Docker Compose: Execute the following commands in your terminal:
docker compose build
-
Start the Project: Once the build process is complete, start the project with:
docker compose up
This project is licensed under the MIT License.