Skip to content

Repository files navigation

🍕 Food Fiesta - Production-Grade Full-Stack Spring Boot Project

🌐 Live Application: Food Fiesta | Culinary Excellence

Welcome to Food Fiesta, a modern, high-performance dining management and ordering platform. Built on Spring Boot 3.4.2 and Java 21, this application is designed for cloud-native deployment, supporting both quick-start in-memory databases (H2) and production-grade persistent databases (PostgreSQL).

This guide walks you through local development, architectural concepts, production configuration, and step-by-step cloud deployment (Render & Docker).


🏗️ Architecture & Technology Stack

The application adheres to clean layered architecture design principles:

  • Presentation Layer (Thymeleaf, CSS, JS): Server-side HTML rendering utilizing custom visual utility classes, glassmorphic UI elements, and dynamic loops.
  • Controller Layer (Spring Web): RESTful APIs and traditional Web MVC routing controls handling requests, user session binding, and OAuth flows.
  • Service Layer (Spring Component): Business logic, order calculations, and verification handlers.
  • Data Access Layer (Spring Data JPA / Hibernate): Object-Relational Mapping (ORM) translating Java objects directly to database tables.
  • Security Filter Chain (Spring Security): Built-in filters handling OAuth2, CORS policy setup, endpoint authorizations, and resource control.

Layer Diagram

[ Browser ] ──▶ [ Controller / MVC ] ──▶ [ Services ] ──▶ [ JPA Repositories ] ──▶ [ Database ]
                      │                                          │
                      ▼                                          ▼
            [ Thymeleaf Templates ]                      [ H2 / PostgreSQL ]

🖥️ Application Preview

🏠 Home Page

Home Page

🍛 Interactive Menu Grid

Menu Page

📖 Story & About Page

Story Page

🔑 Authentication Systems

Sign In page Register page

👤 Customer & Admin Dashboards

Customer Dashboard Admin Control Console

🛠️ Swagger API Documentation

Swagger API documentation UI


📋 Prerequisites

Before setting up or deploying, verify you have the following installed locally:

  • Java Development Kit (JDK) 21
  • Note: Maven is not required to be installed manually, as the Maven Wrapper (mvnw / mvnw.cmd) is preloaded in the project.

⚙️ Environment Variables Registry

In production, avoid hardcoding values. Use this table to configure environment variables for deployment on Render, Docker, or your preferred cloud host:

Variable Name Purpose Example Value / Default
JAVA_HOME Points to Java installation directory C:\Program Files\Java\jdk-21
PORT Web port Spring Boot listens on 8080
SPRING_DATASOURCE_URL JDBC database connection string jdbc:postgresql://db:5432/foodfiesta
SPRING_DATASOURCE_USERNAME Database username credentials postgres
SPRING_DATASOURCE_PASSWORD Database password credentials your_password
GOOGLE_CLIENT_ID Google OAuth Web App Client ID your_client_id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET Google OAuth Web App Client Secret GOCSPX-your_secret

🚀 Local Quick-Start (H2 Database)

1. Clone & Navigate

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

2. Configure Environment .env

Create a file named .env in the root directory (this is automatically ignored by Git) to store your local credentials:

GOOGLE_CLIENT_ID=your_id_here.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your_secret_here

3. Run Locally

  • Windows (PowerShell):
    Get-Content .env | ForEach-Object { $name, $value = $_.Split('=', 2); if ($name -and $value) { [System.Environment]::SetEnvironmentVariable($name.Trim(), $value.Trim()) } }; .\mvnw.cmd spring-boot:run
  • macOS / Linux:
    export $(cat .env | xargs) && ./mvnw spring-boot:run

4. Port Access


🗄️ Database Configurations (H2 vs. PostgreSQL)

Option A: Local Dev / Quick Demo (H2 In-Memory)

By default, the application runs on H2. It auto-seeds default administrators and catalog entries on startup:

Note: In-memory data resets every time the application stops or sleeps.

Option B: Production Setup (PostgreSQL)

To run a persistent database locally or in production, configure the environment variables or update src/main/resources/application.properties with:

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

☁️ Deploying on Render (Cloud Deployment)

Render parses the project's Dockerfile to compile and containerize the Spring Boot application.

Setup Guide A: H2 Database (Quick Demo)

  1. Go to your Render Dashboard, click New > Web Service.
  2. Link your Food-Fiesta GitHub repository.
  3. Select Docker as the Runtime environment.
  4. Go to Advanced settings, add the following environment variables:
    • PORT: 8080
    • GOOGLE_CLIENT_ID: [Your Client ID]
    • GOOGLE_CLIENT_SECRET: [Your Client Secret]
  5. Click Create Web Service.

Setup Guide B: PostgreSQL (Production Persistence)

  1. Go to Render, click New > PostgreSQL to create a persistent database. Copy the Internal Database URL.
  2. Create a new Web Service, link your repository, and select Docker as the Runtime.
  3. Under Advanced, add the environment variables:
    • PORT: 8080
    • GOOGLE_CLIENT_ID: [Your Client ID]
    • GOOGLE_CLIENT_SECRET: [Your Client Secret]
    • SPRING_DATASOURCE_URL: jdbc:postgresql://<HOST>:<PORT>/foodfiesta (parsed from your Internal Database URL)
    • SPRING_DATASOURCE_USERNAME: postgres
    • SPRING_DATASOURCE_PASSWORD: [Your DB Password]
  4. Click Create Web Service.

🐳 Docker Deployment (Local Containerized)

  1. Build the production-ready Docker image:
    docker build -t food-fiesta .
  2. Run the container locally:
    docker run -p 8080:8080 --env-file .env food-fiesta

📄 License

This project is licensed 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

Stars

27 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages