CHATBOT
Objective:
To Develop a RESTful API using Express.js framework backed by SQLite and Sequelize ORM. The API will serve as the backend for a platform where users can create chatbots. These chatbots will have conversations with end users.
Entities:
- User
- Chatbot
- Conversation
- EndUser (The individual interacting with the chatbot)
Entity Relationships:
- A User can have multiple Chatbots.
- A Chatbot belongs to a User and can have multiple Conversations.
- A Conversation belongs to a Chatbot and involves an EndUser.
- An EndUser is identified by a name and an email.
Endpoints:
-
Users
POST /users
- Create a new userGET /users
- List all usersGET /users/:id
- Retrieve a single userPUT /users/:id
- Update a userDELETE /users/:id
- Delete a user
-
Chatbots
POST /users/:userId/chatbots
- Create a new chatbot for a userGET /users/:userId/chatbots
- List all chatbots for a userGET /chatbots/:chatbotId
- Retrieve a single chatbotPUT /chatbots/:chatbotId
- Update a chatbotDELETE /chatbots/:chatbotId
- Delete a chatbot
-
Conversations
POST /chatbots/:chatbotId/conversations
- Start a new conversation for a chatbotGET /chatbots/:chatbotId/conversations
- List all conversations for a chatbotGET /conversations/:conversationId
- Retrieve a single conversationPUT /conversations/:conversationId
- Update a conversation (for instance, to mark it as completed)DELETE /conversations/:conversationId
- End/delete a conversation
-
EndUsers
POST /endusers
- Register a new end userGET /endusers
- List all end usersGET /endusers/:endUserId
- Retrieve details of a single end userPUT /endusers/:endUserId
- Update end user detailsDELETE /endusers/:endUserId
- Delete an end user