Skip to content

imrajeevnayan/Food-Fiesta

Repository files navigation

Food Fiesta - Spring Boot Fullstack Project

Food Fiesta is a Spring Boot fullstack dining management application built with Java 21, Spring Boot 3.4.2, Thymeleaf, Spring Security, Spring Data JPA, and H2 for quick local development.

The project can also be configured to use PostgreSQL for deployment or production-style testing.

Project Tags

#SpringBoot #Java21 #RestAPI #BackendProject #H2Database #PostgreSQL #Thymeleaf #FullstackProject


Spring Boot Java H2 Swagger License


Interface Preview

Home Page

Home Page

About Page

About Page

Authentication & Security

Dual Login System User Registration

Products

Products Page

User Experience & Dashboard

User Personalized Dashboard

Admin Management Console

Admin Dashboard Overview

API Documentation

Swagger OpenAPI Docs


Core Features

  • Premium Thymeleaf UI with modern CSS and JavaScript.
  • Role-based admin and customer flows.
  • Product inventory management.
  • User registration and login.
  • Order placement and order history.
  • Spring Data JPA persistence.
  • H2 database for fast local startup.
  • Swagger/OpenAPI documentation.
  • Optional Google OAuth2 login configuration.

Technology Stack

Layer Technology
Backend Java 21, Spring Boot 3.4.2, Spring Security, Hibernate
Database H2 for local development, PostgreSQL optional
Documentation SpringDoc OpenAPI / Swagger UI
Frontend Thymeleaf, CSS, JavaScript
Build Tool Maven Wrapper
API Testing Swagger, Postman

Database Architecture

erDiagram
    USER ||--o{ ORDERS : "places"
    USER {
        int u_id PK
        string uname
        string uemail
        string upassword
        long unumber
    }
    ADMIN {
        int adminId PK
        string adminName
        string adminEmail
        string adminPassword
        string adminNumber
    }
    PRODUCT {
        int pid PK
        string pname
        double pprice
        string pdescription
    }
    ORDERS {
        int oId PK
        string oName
        double oPrice
        int oQuantity
        date orderDate
        double totalAmmout
        int user_u_id FK
    }
Loading

Prerequisites

  • JDK 21
  • Maven is optional because the Maven wrapper is included

Docker and PostgreSQL are only needed if you choose the PostgreSQL/Docker setup.


Quick Start With H2

Clone the project:

git clone https://github.com/imrajeevnayan/Food-Fiesta.git
cd Food-Fiesta

Run the application:

./mvnw spring-boot:run

On Windows PowerShell:

.\mvnw.cmd spring-boot:run

If JAVA_HOME is not set on Windows, set it before running Maven:

$env:JAVA_HOME="C:\Program Files\Java\jdk-21.0.11"
.\mvnw.cmd spring-boot:run

Open the app:

H2 console connection:

JDBC URL: jdbc:h2:mem:foodfiesta
User Name: sa
Password:

The H2 database is in-memory, so data resets when the application stops.


Default Seeded Data

The app seeds sample products and a default admin account on startup.

Admin email: admin@foodfiesta.com
Admin password: admin123

Current Local Database Configuration

The default src/main/resources/application.properties uses H2:

spring.datasource.url=jdbc:h2:mem:foodfiesta
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
spring.jpa.hibernate.ddl-auto=create-drop

Optional PostgreSQL Configuration

To use PostgreSQL instead of H2, update src/main/resources/application.properties:

spring.datasource.url=jdbc:postgresql://localhost:5432/foodfiesta
spring.datasource.username=postgres
spring.datasource.password=YOUR_PASSWORD
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=update

PostgreSQL should be running on port 5432, and the foodfiesta database should exist.


Optional Google OAuth2

To enable Google login:

  1. Go to Google Cloud Console.
  2. Create an OAuth 2.0 Client ID.
  3. Add this authorized redirect URI:
http://localhost:8080/login/oauth2/code/google
  1. Update src/main/resources/application.properties:
spring.security.oauth2.client.registration.google.client-id=YOUR_CLIENT_ID
spring.security.oauth2.client.registration.google.client-secret=YOUR_CLIENT_SECRET

Docker Deployment

Build the image:

docker build -t food-fiesta .

Run with Docker:

docker run -p 8080:8080 --name food-fiesta-app food-fiesta

Run app and PostgreSQL together:

docker compose up -d

Follow logs:

docker compose logs -f app

Build

./mvnw clean package

On Windows:

.\mvnw.cmd clean package

License

Distributed under the MIT License. See LICENSE for details.


Developed by imrajeevnayan

About

Food Fiesta is a Spring Boot-based web application for online food ordering. It enables users to browse menus, add items to cart, and place orders, while admins manage food items and orders. Built with REST APIs, JPA, and Postgress for efficient and scalable backend operations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors