Skip to content

Latest commit

ย 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ” Foody Guys โ€” Online Food Ordering Web Application

Foody Guys is a full-stack Java web application for online food ordering, inspired by modern food delivery platforms such as Swiggy and Zomato.

The project was developed to understand how a real-world food ordering platform works by implementing the frontend, backend, database connectivity, authentication, restaurant browsing, wishlist management, and shopping-cart functionality using Java web technologies.


๐Ÿš€ Project Overview

Foody Guys allows users to:

  • Create an account and log in
  • Browse restaurants
  • Search for restaurants
  • Filter restaurants by food categories
  • View restaurant menus
  • View food images, descriptions, prices, and availability
  • Add restaurants/menu items to wishlist
  • Add food items to cart without leaving the menu page
  • Increase or decrease food quantity directly from the menu
  • View a floating cart with live item count and total price
  • Manage cart items
  • Navigate to the cart and continue with the ordering process

The application focuses not only on functionality but also on creating a modern and attractive food-delivery-style user interface.


โœจ Key Features

๐Ÿ‘ค User Authentication

  • User registration
  • User login
  • Session-based user management
  • Personalized wishlist and cart handling

๐Ÿช Restaurant Browsing

  • Display available restaurants
  • Search restaurants
  • Category-based filtering
  • Dynamically calculated restaurant ratings
  • Restaurant cards with modern UI
  • Smooth scrolling to restaurant sections

๐Ÿฝ๏ธ Menu Management

Users can open a restaurant and view its menu.

Each menu item displays:

  • Food image
  • Item name
  • Category
  • Description
  • Price
  • Availability
  • Wishlist option
  • Add to Cart option

โค๏ธ Wishlist

Users can add menu items to their wishlist and access their saved items later.

๐Ÿ›’ Modern Shopping Cart

The project includes a dynamic shopping-cart experience.

Instead of redirecting users to the cart immediately after clicking Add to Cart, the item is added asynchronously using JavaScript Fetch API.

The button changes from:

Add to Cart

to:

-   1   +

Users can then increase or decrease the quantity directly from the menu page.

โšก AJAX / Fetch API

Cart operations are performed asynchronously without refreshing the page.

The frontend communicates with the Java Servlet backend using:

Fetch API

This provides a smoother and faster user experience.

๐ŸŸข Floating Cart

A floating cart appears when users add items.

It displays:

3 Items
โ‚น477

View Cart โ†’

The item count and total price are updated dynamically as quantities change.

๐ŸŽจ Modern UI

The frontend includes:

  • Glassmorphism design
  • Gradient backgrounds
  • Food-focused visual design
  • Hover animations
  • Card animations
  • Image zoom effects
  • Hero banner slider
  • Smooth transitions
  • Interactive buttons
  • Responsive layouts

๐Ÿ–ผ๏ธ Homepage

The homepage contains an animated food banner that automatically changes between multiple food-themed promotional images.

Users can explore restaurants from the homepage and navigate through different food categories.


๐Ÿ—๏ธ Project Architecture

The project follows a layered/MVC-style structure.

Foody Guys
โ”‚
โ”œโ”€โ”€ Java Model Classes
โ”‚   โ”œโ”€โ”€ User
โ”‚   โ”œโ”€โ”€ Restaurant
โ”‚   โ”œโ”€โ”€ Menu
โ”‚   โ”œโ”€โ”€ Cart
โ”‚   โ””โ”€โ”€ CartItem
โ”‚
โ”œโ”€โ”€ DAO Layer
โ”‚   โ”œโ”€โ”€ RestaurantDAO
โ”‚   โ”œโ”€โ”€ MenuDAO
โ”‚   โ”œโ”€โ”€ WishlistDAO
โ”‚   โ””โ”€โ”€ DAO Implementations
โ”‚
โ”œโ”€โ”€ Servlet Layer
โ”‚   โ”œโ”€โ”€ RestaurantServlet
โ”‚   โ”œโ”€โ”€ CartServlet
โ”‚   โ”œโ”€โ”€ Wishlist Servlets
โ”‚   โ””โ”€โ”€ Authentication Servlets
โ”‚
โ”œโ”€โ”€ JSP Pages
โ”‚   โ”œโ”€โ”€ restaurant.jsp
โ”‚   โ”œโ”€โ”€ menu.jsp
โ”‚   โ”œโ”€โ”€ cart.jsp
โ”‚   โ”œโ”€โ”€ login.jsp
โ”‚   โ””โ”€โ”€ registration.jsp
โ”‚
โ””โ”€โ”€ Database
    โ””โ”€โ”€ MySQL

๐Ÿ› ๏ธ Technologies Used

Backend

  • Java
  • Java Servlets
  • JSP
  • JDBC
  • Apache Tomcat

Frontend

  • HTML5
  • CSS3
  • JavaScript
  • Fetch API

Database

  • MySQL

Build Tool

  • Maven

๐Ÿ—„๏ธ Database

The application uses MySQL for persistent data storage.

The database manages application data such as:

  • Users
  • Restaurants
  • Menu items
  • Wishlist information
  • Ratings
  • Other food-ordering related data

JDBC is used to communicate between the Java application and MySQL database.


๐Ÿ”„ Cart Flow

The cart functionality works approximately as follows:

User clicks "Add to Cart"
          โ†“
JavaScript intercepts request
          โ†“
Fetch API sends request
          โ†“
CartServlet receives request
          โ†“
Cart is updated in HTTP Session
          โ†“
Servlet returns response
          โ†“
JavaScript updates UI
          โ†“
"Add to Cart" โ†’ "- 1 +"
          โ†“
Floating cart updates

When the user clicks + or -, the quantity is updated asynchronously without reloading the page.


๐Ÿ“Š Restaurant Rating

Restaurant ratings are calculated dynamically from stored rating information.

The application retrieves the average rating for each restaurant and displays it on the restaurant card.


๐Ÿ” Session Management

HTTP sessions are used to maintain user-specific information such as:

  • Logged-in user
  • Shopping cart
  • Restaurant associated with the current cart

This allows the application to maintain state while the user navigates through different pages.


๐Ÿ“ Main Components

RestaurantServlet

Responsible for:

  • Restaurant retrieval
  • Restaurant search
  • Category filtering
  • Restaurant rating retrieval
  • Wishlist information

CartServlet

Responsible for:

  • Adding items
  • Updating quantities
  • Removing items
  • Maintaining the cart in the session

Cart

Represents the user's shopping cart and maintains cart items.

CartItem

Represents an individual item inside the shopping cart.

DAO Layer

The DAO classes separate database operations from servlet/business logic.


๐ŸŽฏ Learning Objectives

This project helped me gain practical experience in:

  • Java web development
  • Servlets
  • JSP
  • JDBC
  • MySQL
  • MVC architecture
  • DAO pattern
  • HTTP session management
  • CRUD operations
  • AJAX
  • Fetch API
  • DOM manipulation
  • Dynamic UI updates
  • Responsive web design
  • Frontend animations
  • Full-stack application development

๐Ÿ”ฎ Future Enhancements

Planned improvements include:

  • ๐Ÿ’ณ Online payment gateway
  • ๐Ÿ“ฆ Complete order management
  • ๐Ÿšš Live order tracking
  • ๐Ÿ‘จโ€๐Ÿ’ผ Admin dashboard
  • ๐Ÿช Restaurant management panel
  • โญ Customer reviews and ratings
  • ๐Ÿ”” Order notifications
  • ๐Ÿ“ฑ Improved mobile responsiveness
  • ๐Ÿ“Š Admin analytics
  • ๐Ÿ” Additional security improvements

โ–ถ๏ธ How to Run the Project

Prerequisites

Install:

  • Java JDK
  • Apache Tomcat 10+
  • MySQL
  • Maven
  • Eclipse / IntelliJ IDEA / another Java IDE

Steps

  1. Clone the repository.
git clone <your-github-repository-url>
  1. Import the project into your IDE.

  2. Create the MySQL database.

  3. Configure the database connection inside the project.

  4. Update the database credentials.

  5. Run the project using Apache Tomcat.

  6. Open the application in your browser.

http://localhost:8080/foody/

๐Ÿ‘จโ€๐Ÿ’ป Developer

Developed as a Java Full Stack Web Development project to gain practical experience in building a real-world food ordering application.


โญ Project Highlights

Foody Guys combines Java backend development, MySQL database management, JSP/Servlet architecture, AJAX-based cart functionality, and modern frontend design into a complete food ordering experience.

If you find this project useful or interesting, feel free to โญ the repository.


๐Ÿ“Œ Project Status

๐Ÿšง Currently under development

The core restaurant browsing, menu, wishlist, and dynamic cart functionality has been implemented, with additional ordering and payment features planned for future versions.

About

Full-stack Java web application for online food ordering with authentication, restaurant browsing, wishlist, and shopping cart functionality.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages