Skip to content

avaninth/food-ordering-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Food Ordering Web Application

A RESTful web application built with Spring Boot for managing online food ordering operations.

Features

  • Browse restaurants and their menus
  • Add items to cart (session-based)
  • Place orders
  • RESTful API architecture
  • MySQL database integration

Tech Stack

  • Backend: Java 17, Spring Boot 3.2.0
  • Frameworks: Spring Web, Spring Data JPA
  • Database: MySQL
  • Build Tool: Maven
  • Additional Libraries: Lombok

Prerequisites

  • Java 17 or higher
  • MySQL 8.0 or higher
  • Maven 3.6+

Setup Instructions

1. Database Setup

Create a MySQL database:

CREATE DATABASE food_ordering;

2. Configure Application

Update src/main/resources/application.yml with your MySQL credentials:

spring:
  datasource:
    username: your_username
    password: your_password

3. Build and Run

# Build the project
./mvnw clean install

# Run the application
./mvnw spring-boot:run

The application will start on http://localhost:8080

API Endpoints

Restaurants

  • GET /api/restaurants - List all restaurants
  • GET /api/restaurants/{id}/menu - Get menu for a specific restaurant

Cart

  • GET /api/cart/{sessionId} - Get cart items for a session
  • POST /api/cart/{sessionId}/items - Add item to cart
    {
      "menuItemId": 1,
      "quantity": 2
    }
  • DELETE /api/cart/{sessionId} - Clear cart

Orders

  • POST /api/orders/{sessionId} - Place order from cart items

Project Structure

src/main/java/com/example/foodordering/
├── controller/         # REST API controllers
├── model/             # JPA entities
├── repository/        # Data access layer
├── service/           # Business logic
└── FoodOrderingApplication.java

Testing

Use Postman or cURL to test the API endpoints.

Example:

curl http://localhost:8080/api/restaurants

Future Enhancements

  • User authentication and authorization
  • Payment gateway integration
  • Order tracking and status updates
  • Restaurant owner dashboard
  • Real-time notifications

Author

Created as part of portfolio projects showcasing Spring Boot and RESTful API development.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages