A RESTful web application built with Spring Boot for managing online food ordering operations.
- Browse restaurants and their menus
- Add items to cart (session-based)
- Place orders
- RESTful API architecture
- MySQL database integration
- Backend: Java 17, Spring Boot 3.2.0
- Frameworks: Spring Web, Spring Data JPA
- Database: MySQL
- Build Tool: Maven
- Additional Libraries: Lombok
- Java 17 or higher
- MySQL 8.0 or higher
- Maven 3.6+
Create a MySQL database:
CREATE DATABASE food_ordering;Update src/main/resources/application.yml with your MySQL credentials:
spring:
datasource:
username: your_username
password: your_password# Build the project
./mvnw clean install
# Run the application
./mvnw spring-boot:runThe application will start on http://localhost:8080
GET /api/restaurants- List all restaurantsGET /api/restaurants/{id}/menu- Get menu for a specific restaurant
GET /api/cart/{sessionId}- Get cart items for a sessionPOST /api/cart/{sessionId}/items- Add item to cart{ "menuItemId": 1, "quantity": 2 }DELETE /api/cart/{sessionId}- Clear cart
POST /api/orders/{sessionId}- Place order from cart items
src/main/java/com/example/foodordering/
├── controller/ # REST API controllers
├── model/ # JPA entities
├── repository/ # Data access layer
├── service/ # Business logic
└── FoodOrderingApplication.java
Use Postman or cURL to test the API endpoints.
Example:
curl http://localhost:8080/api/restaurants- User authentication and authorization
- Payment gateway integration
- Order tracking and status updates
- Restaurant owner dashboard
- Real-time notifications
Created as part of portfolio projects showcasing Spring Boot and RESTful API development.