PotBot simplifies the dining experience by providing a user-friendly chat interface for various restaurant-related services. It helps users find restaurants, browse menus, make reservations, place orders, and more.
Home Page :
Self - Designed logo for the project :
Sign-Up Page :
-
Restaurant Discovery:
- Search for restaurants by cuisine, location, or price range.
- Implemented in
api.jsusing the/api/restaurantsendpoint. - Uses MySQL queries to filter restaurants based on cuisine, price, and location.
- Calculates average ratings for each restaurant.
-
Menu Exploration:
- View digital menus with descriptions and ratings.
- The
/api/restaurant/menuendpoint inapi.jsfetches menu information. - Menus are stored as image URLs in the
restaurantstable, as an image-based menu is more visually appealing to a user than a plain text-based menu.
-
Reservation Management:
- Make and manage reservations with special requests.
- Handled by the
handleReservation,processReservationDetails, andconfirmReservationfunctions inindex.js. - Uses the
/api/reservationsendpoint to interact with the database. - Checks table availability and assigns tables based on party size.
-
Ordering System:
- Place orders for delivery or pickup directly through the bot, adding or removing items with ease.
- Implemented through
handleOrder,processOrderItems, andconfirmOrderfunctions inindex.js. - Utilizes
/api/ordersand/api/menuendpoints for database interactions. - Allows adding/removing items and calculates total price accordingly.
-
Payment Integration:
- Secure payment processing within the chat interface.
- Uses Razorpay API (Only simulated in this version).
initiatePaymentandconfirmPaymentfunctions inindex.jshandle the payment flow.- Integrates with
/api/create-razorpay-orderand/api/verify-razorpay-paymentendpoints.
-
Order Tracking:
- Real-time updates on order status.
- Implemented using the
trackOrderfunction inindex.js. - Uses the
/api/order-status/:orderIdendpoint to fetch real-time status updates.
-
Personalized Recommendations:
- Suggest restaurants based on user preferences and order history.
- The
getPersonalizedRecommendationsfunction inindex.jshandles this feature. - Utilizes the
/api/recommendationsendpoint, which queries theuser_order_historytable.
-
Additional Features:
- Customer reviews: Implemented with
/api/reviews/positiveand/api/reviews/negativeendpoints. - Restaurant descriptions: Fetched using the
/api/restaurant/descriptionendpoint.
- Customer reviews: Implemented with
- Node.js
- Express.js
- MySQL
- Microsoft Bot Framework SDK
- Axios for HTTP requests
- Razorpay for payment processing
- HTML
- CSS
A MySQL database was preffered for this project, as structured tables with dependencies amongst each other were required.
The project uses a MySQL database named restaurant_bot with the following table structure:
-
restaurants
- Stores basic information about restaurants
- Fields: id, name, cuisine, location, description, menu, price
-
menus
- Contains menu items for each restaurant
- Fields: id, restaurant_id, item, price
-
orders
- Tracks customer orders
- Fields: order_id, restaurant_id, username, order_type, order_details, total_price, status
-
reservations
- Manages reservation details
- Fields: reservation_id, restaurant_id, username, reservation_date, reservation_time, special_requests, number_of_people, table_number
-
tables
- Keeps track of restaurant tables and their availability
- Fields: id, restaurant_id, table_number, capacity, availability
-
reviews
- Stores customer reviews for restaurants
- Fields: review_id, restaurant_id, username, review, rating, review_date
-
users
- Manages user account information
- Fields: user_id, username, email, password, address, date_of_birth
-
user_order_history
- Tracks user order history for recommendation purposes
- Fields: id, user_id, restaurant_id, order_date
- Foreign key relationships maintain data integrity between tables
- Use of ENUM types for order status and restaurant price categories
- JSON storage for order details in the
orderstable - Timestamp fields for tracking review and order dates
To set up the database:
- Create a new database named
restaurant_botin your MySQL server - Execute the SQL commands provided in the
database_setup.sqlfile to create the necessary tables and relationships
Note: Ensure that your database connection settings in api.js match your local MySQL configuration.
- Clone the repository
- Install dependencies:
npm install - Set up your MySQL database using XAMPP and phpMyAdmin
- Configure your database connection in
api.js - Start the server:
node index.jsandnode api.js. - Start Apache and MySQL in the XAMPP panel.
- Install microsoft bot framework sdk from link given below, in references.
- Open microsoft bot framework sdk and open the bot by going to the link http://localhost:3978/api/messages.
- Test the bot further.
The api.js file contains various endpoints for different functionalities:
/api/restaurants: Search restaurants based on criteria/api/reviews: Fetch positive and negative reviews/api/restaurant/description: Get restaurant descriptions/api/restaurant/menu: Retrieve menu information/api/reservations: Manage reservations/api/orders: Handle order placement and tracking/api/menu: Match user-entered items to database menu items/api/recommendations: Get personalized restaurant recommendations
The main bot logic is implemented in index.js:
- Handles user interactions and routes requests to appropriate functions
- Manages conversation flow for ordering, reservations, and inquiries
- Integrates with the API endpoints for data retrieval and updates
PotBot uses Razorpay for payment processing. It creates payment orders and verifies payments upon confirmation.
- Implement user authentication
- Deploy the bot on azure
- More robust error handling and input validation
- Add more sophisticated natural language processing
- Build the payment model further
- Implement a loyalty program
- Bot Framework SDK
- MySQL Tutorial
- Node.js Documentation
- Express.js Tutorial
- Bot Framework Emulator
- Azure Language Understanding
Introductory messages:
Restaurant recommendation and filtering:
Menu display:
Reviews and description viewing:
Reservation process:
Ordering Process:













