This is a chatbot-based hotel booking system built with Node.js, Express, Sequelize (SQLite), OpenAI, and Nodemailer. The chatbot assists users in booking hotel rooms by providing available room options and sending booking confirmation emails.
Demo - https://drive.google.com/file/d/1ThACTHVWWozlBa-_nOPFD0uXdl71NsrG/view
To set up and run this project locally, follow these steps:
Clone the repository to your local machine using the following command:
git clone https://github.com/CodeMaverick2/BOT9.gitcd BOT9Install the necessary dependencies using npm:
npm install dotenv express nodemailer nodemon openai sequelize sqlite3 validatorCreate a .env file in the root directory of the project and add the necessary environment variables. Here is an example .env file:
PORT=3000
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=[email protected]
SMTP_PASS=ypjx sazh xoeu ntaw
FROM_EMAIL=[email protected]
OPENAI_API_KEY=your-openai-api-keyReplace the placeholder values with your actual configuration.
Start the server in development mode:
npm run devThe server will be running on http://localhost:3000.
Open your web browser and navigate to http://localhost:3000 to interact with the chatbot.
The following environment variables need to be set in the .env file:
PORT: The port number on which the server will run.SMTP_HOST: The SMTP host for sending emails (e.g.,smtp.gmail.com).SMTP_PORT: The SMTP port for sending emails (e.g.,587).SMTP_SECURE: Whether to use secure SMTP (true/false).SMTP_USER: The SMTP user for sending emails (e.g.,[email protected]).SMTP_PASS: The SMTP password for sending emails.FROM_EMAIL: The email address from which booking confirmation emails will be sent (e.g.,[email protected]).OPENAI_API_KEY: Your OpenAI API key.
Handles the chatbot interactions.
{
"message": "User's message",
"userId": "Unique user identifier"
}{
"response": "Chatbot's response"
}To install the required dependencies, run the following command:
npm install dotenv express nodemailer nodemon openai sequelize sqlite3 validatorList of dependencies:
- dotenv: ^16.4.5
- express: ^4.19.2
- nodemailer: ^6.9.14
- nodemon: ^3.1.4
- openai: ^4.52.3
- sequelize: ^6.37.3
- sqlite3: ^5.1.7
- validator: ^13.12.0
This project is licensed under the ISC License.