AI Group Chat Bot

  1. Install dependencies:
npm install
  1. Set up environment variables:

· Create a .env file in the root of your project.

· Add the necessary environment variables, such as database connection details.

  1. Start the development server:
  npm start

This will start your application on the specified port.

Running Migrations

  1. Create a migration:
npm run migrate

This will generate a new migration file in the migrations directory.

  1. Apply migrations:
npm run migrate:apply

This will run all pending migrations and update your database schema.

Opening Drizzle Studio

  1. Start Drizzle Studio:
npx drizzle-kit studio

This will open the Drizzle Studio interface in your default web browser.

  1. Use Drizzle Studio:
  • Explore your database schema and tables.

  • Generate code for your models based on the schema.

  • Run SQL queries and view results.

Available Routes

The following routes have been implemented in the project:

User Routes

  • POST /api/users: Create a new user

  • GET /api/users: Get all users

  • GET /api/users/:id: Get a user by ID

  • PUT /api/users/:id: Update a user

  • DELETE /api/users/:id: Delete a user

Chatbot Routes

  • POST /api/chatbots: Create a new chatbot

  • GET /api/chatbots: Get all chatbots

  • GET /api/chatbots/:id: Get a chatbot by ID

  • DELETE /api/chatbots/:id: Delete a chatbot

  • POST /api/chatbots/add-to-group: Add a chatbot to a group

  • DELETE /api/chatbots/remove-from-group: Remove a chatbot from a group

Group Routes

  • POST /api/groups: Create a new group

  • GET /api/groups: Get all groups

  • GET /api/groups/:id: Get a group by ID

  • DELETE /api/groups/:id: Delete a group

Message Routes

  • POST /api/messages: Create a new message

  • GET /api/messages/:groupId: Get messages for a specific group

Swagger Documentation

  1. The project includes Swagger documentation for the API. You can access the documentation by navigating to /api-docs in your browser after starting the application