LetMeBook is a RESTful API built with Express.js that implements a chatbot capable of handling hotel booking queries. The chatbot uses OpenAI's API for natural language processing and maintains conversation history using Sequelize with SQLite or MySQL. Additionally, it sends booking confirmation emails to users using Nodemailer.
- RESTful API using Express.js
- Natural Language Processing with OpenAI API
- Conversation history storage with Sequelize
- Room booking simulation
- Email confirmation using Nodemailer
- Error handling for invalid user inputs or API failures
- Clone the repository
git clone https://github.com/yourusername/LetMeBook.git
cd LetMeBook
- Install dependencies
npm install
- Create a
.envfile in the project root and add your API keys and database configuration
OPENAI_API_KEY='your-openai-api-key'
EMAIL_USER='[email protected]'
EMAIL_PASS='your-email-password'
- Ensure you have Node.js installed (v18 or higher is recommended).
- Update the
.envfile with your OpenAI API key, email credentials, and database configuration.
- Start the server
node src/app.js
-
Send a POST request to the chatbot endpoint
- URL:
http://localhost:4000/chat - Request Body:
- URL:
{
"userId": "1",
"message": "I want to book a room"
}
Handle user messages and return chatbot responses.
Request:
{
"userId": "1",
"message": "I want to book a room"
}
Response:
{
"response": "Here are the available room options..."
}
- Node.js
- Express.js
- Sequelize
- SQLite/MySQL
- OpenAI API
- Nodemailer