π Food Delivery Application π A java based food delivery web application that allows users to browse restaurants, order food, and manage their orders.
π Features π User Authentication Page β Allows users to log in or sign up π Home Page β Displays a list of restaurants π Menu Page β Shows menus of a selected restaurant π Cart β Users can add/remove items β Checkout Page β Users can place an order by providing address details and selecting a payment method. π Order History β Displays past orders π Order Confirmation β Shows order details π Technologies Used Frontend: JSP, CSS Backend: Java (JDBC,Servlets) Database: MySQL IDE: Eclipse Server: Apache Tomcat π Project Structure π FoodDeliveryApplication βββ π src/main/java β βββ π dao β βββ π daoimplementation β βββ π model β βββ π servlets β βββ π utility β βββ π webapp β βββ .jsp files β βββ .css files β βββ π WEB-INF β βββ web.xml β βββ π lib β βββ mysql-connector-j-8.0.33.jar π How to Run the Project To run this project, ensure you have the following installed on your system:
Eclipse IDE Java JDK 11 or higher Apache Tomcat 9 or higher MySQL Database MySQL Connector JAR (Add to WEB-INF/lib folder) β Step 1: Clone the Repository git clone https://github.com/MoneSwathi/Food-Delivery-Application β Step 2: Set Up MySQL Database Open MySQL Workbench or Command Line. Create the database using the following command: CREATE DATABASE FoodDelivery; Select the Database: USE FoodDelivery; Create required tables: CREATE TABLE user ( userId INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(50), username VARCHAR(20), password VARCHAR(25), email VARCHAR(100) UNIQUE, phone VARCHAR(15), address VARCHAR(200), role enum('admin','customer','restaurantOwner','deliveryPartner'), createdDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP, lastLoginDate TIMESTAMP );
CREATE TABLE restaurant ( restaurantId INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(50), address VARCHAR(60), phone varchar(20), rating float, cusineType varchar(45), isActive tinyint, eta varchar(45), adminUserId int, imagePath varchar(200), FOREIGN KEY (adminUserId) REFERENCES user(userId) );
CREATE TABLE menu ( menuId INT AUTO_INCREMENT PRIMARY KEY, restaurantId INT, itemName VARCHAR(30), description varchar(100), price float, ratings float, isAvailable tinyint, imagePath varchar(200), FOREIGN KEY (restaurantId) REFERENCES restaurant(restaurantId) );
CREATE TABLE order ( orderId INT AUTO_INCREMENT PRIMARY KEY, userId INT, restaurantId int, order_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, totalAmount float, status enum('placed','shipped','delivered','cancelled') DEFAULT "placed", address varchar(500), phone varchar(20), paymentMode enum('upi','cod','card') DEFAULT "cod", FOREIGN KEY (userId) REFERENCES user(userId), FOREIGN KEY (restaurantId) REFERENCES restaurant(restaurantId) );
CREATE TABLE orderitem ( orderItemId INT AUTO_INCREMENT PRIMARY KEY, orderId INT, menuId int, quantity int, totalPrice float, FOREIGN KEY (orderId) REFERENCES order(orderId), FOREIGN KEY (menuId) REFERENCES menu(menuId) ); Update the database connection details in DBConnection.java: String url = "jdbc:mysql://localhost:3306/your_database_name"; String user = "root"; String password = "your_password";
β Step 3: Open the Project in Eclipse Open Eclipse IDE. Go to File β Import β Existing Projects into Workspace. Select "Select root directory" and browse to the cloned project folder. Click Finish to import the project. β Step 4: Add MySQL Connector JAR Download MySQL Connector JAR from the MySQL Official Website. Copy the JAR file to the WEB-INF/lib folder inside your project. Add the JAR to the Build Path in Eclipse: Right-click the project in Eclipse β Build Path β Configure Build Path. Click Add External JARs. Select the MySQL Connector JAR file and click Apply and Close. β Step 5: Configure the Apache Tomcat Server In Eclipse, go to Window β Show View β Servers. Click "No servers are available. Click this link to create a new server...". Select Apache Tomcat 9 or higher and click Next. Browse and select the Tomcat installation directory. Click Finish to complete the setup. β Step 6: Run the Project Right-click the project in Eclipse β Run As β Run on Server. Select Apache Tomcat Server and click Finish. Open your browser and go to: http://localhost:8080/ProjectName π€ Contributing Feel free to contribute by creating a pull request if any issuse.
π§ Contact For any queries or suggestions, feel free to reach out at: π© moneswathilatha@gmail.com