Skip to content

prithidevghosh/simpleBot

Repository files navigation

simpleBot

This repository contains a RESTful API built using Express.js, SQLite, and Sequelize ORM. The API serves as the backend for a platform where users can create chatbots that have conversations with end users.

Installation

  1. Clone the repository:

    git clone https://github.com/prithidevghosh/simpleBot.git
    cd simpleBot
  2. Install dependencies:

    npm install
  3. Start the server:

    nodemon

    The API will be available at http://localhost:3000.

API Endpoints

Users

  • POST /users: Create a new user
  • GET /users: List all users
  • GET /users/:id: Retrieve a single user
  • PUT /users/:id: Update a user
  • DELETE /users/:id: Delete a user

Chatbots

  • POST /users/:userId/chatbots: Create a new chatbot for a user
  • GET /users/:userId/chatbots: List all chatbots for a user
  • GET /chatbots/:chatbotId: Retrieve a single chatbot
  • PUT /chatbots/:chatbotId: Update a chatbot
  • DELETE /chatbots/:chatbotId: Delete a chatbot

Conversations

  • POST /chatbots/:chatbotId/conversations: Start a new conversation for a chatbot
  • GET /chatbots/:chatbotId/conversations: List all conversations for a chatbot
  • GET /conversations/:conversationId: Retrieve a single conversation
  • PUT /conversations/:conversationId: Update a conversation (e.g., mark as completed)
  • DELETE /conversations/:conversationId: End/delete a conversation

EndUsers

  • POST /endusers: Register a new end user
  • GET /endusers: List all end users
  • GET /endusers/:endUserId: Retrieve details of a single end user
  • PUT /endusers/:endUserId: Update end user details
  • DELETE /endusers/:endUserId: Delete an end user

Bonus Feature: Pagination

The API endpoints that return multiple items (such as users, chatbots, conversations, and end users) include pagination for a better user experience. Use the limit and offset query parameters to navigate through the paginated results.

Usage

  1. Use tools like Postman or cURL to make requests to the API endpoints.
  2. Replace :userId, :chatbotId, :conversationId, and :endUserId with actual IDs in the URL.

About

This repository contains a RESTful API built using Express.js, SQLite, and Sequelize ORM. The API serves as the backend for a platform where users can create chatbots that have conversations with end users.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors