Skip to content

JayanthGummitha/Swarg-Food-Online-Order-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Swarg-Food - Online Food Delivery Platform

A full-stack online food delivery application that connects restaurants with food enthusiasts. Built with Spring Boot 3 and React 18, Swarg-Food provides a seamless multi-vendor platform for restaurant owners and customers.

Spring Boot React Java MySQL

🌟 Features

For Customers

  • πŸ” Secure user authentication with JWT
  • πŸ• Browse multiple restaurants and their menus
  • ❀️ Add favorite restaurants and dishes
  • πŸ›’ Shopping cart functionality
  • πŸ’³ Secure payment processing with Stripe
  • πŸ“§ Email notifications for order updates
  • πŸ”„ Password reset via email
  • πŸ“± Responsive design for all devices

For Restaurant Owners

  • πŸͺ Restaurant registration and management
  • πŸ“‹ Dedicated admin panel for each restaurant
  • 🍽️ Menu and food category management
  • πŸ₯— Ingredient inventory tracking
  • πŸ“¦ Order management system
  • πŸŽ‰ Event creation and management
  • πŸ“Š Dashboard with analytics

For Platform Administrators

  • πŸ‘‘ Super admin panel
  • πŸ” Role-based access control
  • 🏒 Multi-vendor management
  • πŸ“ˆ Platform-wide analytics

πŸ› οΈ Tech Stack

Backend

  • Spring Boot 3.3.1 - Core framework
  • Spring Security - Authentication & authorization
  • Spring Data JPA - Database operations
  • MySQL - Relational database
  • JWT (JSON Web Tokens) - Secure authentication
  • Stripe API - Payment processing
  • Java 17 - Programming language
  • Lombok - Boilerplate code reduction
  • Maven - Dependency management

Frontend

  • React 18.3.1 - UI library
  • Redux - State management
  • Material-UI (MUI) 5 - Component library
  • Tailwind CSS - Utility-first styling
  • React Router DOM 6 - Navigation
  • Formik & Yup - Form handling and validation
  • React Slick - Carousel component
  • Day.js - Date manipulation

πŸ“‹ Prerequisites

Before running this project, make sure you have:

  • Java 17 or higher
  • Node.js 16 or higher
  • MySQL 8 or higher
  • Maven 3.6 or higher
  • Stripe Account (for payment processing)

πŸš€ Getting Started

Backend Setup

  1. Clone the repository
git clone <repository-url>
cd swarg-food
  1. Configure MySQL Database
CREATE DATABASE swarg_food;
  1. Update application properties

Navigate to backend-app/src/main/resources/application.properties and configure:

spring.datasource.url=jdbc:mysql://localhost:3306/swarg_food
spring.datasource.username=your_mysql_username
spring.datasource.password=your_mysql_password

# JWT Configuration
jwt.secret=your_jwt_secret_key

# Stripe Configuration
stripe.api.key=your_stripe_secret_key

# Email Configuration
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=your_email@gmail.com
spring.mail.password=your_email_password
  1. Run the backend
cd backend-app
./mvnw spring-boot:run

The backend server will start on http://localhost:8080

Frontend Setup

  1. Navigate to frontend directory
cd frontend-app
  1. Install dependencies
npm install
  1. Configure environment variables

Create a .env file in the frontend-app directory:

REACT_APP_API_URL=http://localhost:8080
REACT_APP_STRIPE_PUBLIC_KEY=your_stripe_public_key
  1. Start the development server
npm start

The frontend will start on http://localhost:3000

πŸ“ Project Structure

swarg-food/
β”œβ”€β”€ backend-app/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   β”œβ”€β”€ java/
β”‚   β”‚   β”‚   β”‚   └── com/swarg/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ config/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ controller/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ model/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ repository/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ service/
β”‚   β”‚   β”‚   β”‚       └── security/
β”‚   β”‚   β”‚   └── resources/
β”‚   β”‚   └── test/
β”‚   └── pom.xml
β”‚
└── frontend-app/
    β”œβ”€β”€ public/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ AdminComponent/
    β”‚   β”‚   β”œβ”€β”€ Admin/
    β”‚   β”‚   β”œβ”€β”€ Dashboard/
    β”‚   β”‚   β”œβ”€β”€ Menu/
    β”‚   β”‚   β”œβ”€β”€ Orders/
    β”‚   β”‚   β”œβ”€β”€ Ingredients/
    β”‚   β”‚   β”œβ”€β”€ Events/
    β”‚   β”‚   └── FoodCategory/
    β”‚   β”œβ”€β”€ component/
    β”‚   β”œβ”€β”€ Routers/
    β”‚   β”œβ”€β”€ Theme/
    β”‚   β”œβ”€β”€ App.js
    β”‚   └── index.js
    └── package.json

πŸ”‘ Key Functionalities

Authentication & Authorization

  • JWT-based authentication
  • Role-based access control (Customer, Restaurant Owner, Admin)
  • Secure password encryption
  • Email verification and password reset

Restaurant Management

  • Create and manage restaurant profiles
  • Upload restaurant images and details
  • Set operating hours and delivery areas
  • Manage restaurant status (open/closed)

Menu Management

  • Create food categories
  • Add/edit/delete menu items
  • Manage ingredients and availability
  • Set pricing and discounts

Order Processing

  • Real-time order tracking
  • Order status updates
  • Email notifications
  • Order history

Payment Integration

  • Secure Stripe payment gateway
  • Multiple payment methods
  • Transaction history
  • Refund management

🎨 UI Components

  • Carousel Display - Showcase featured restaurants and dishes
  • Add to Favorites - Save favorite restaurants
  • Shopping Cart - Manage orders before checkout
  • Responsive Design - Mobile-first approach
  • Material-UI Components - Professional and consistent UI
  • Tailwind Utilities - Custom styling flexibility

πŸ”’ Security Features

  • JWT token-based authentication
  • Password encryption with BCrypt
  • CORS configuration
  • SQL injection prevention
  • XSS protection
  • CSRF protection

πŸ“§ Email Notifications

  • Order confirmation emails
  • Order status updates
  • Password reset emails
  • Welcome emails for new users

πŸ§ͺ Testing

Backend Tests

cd backend-app
./mvnw test

Frontend Tests

cd frontend-app
npm test

πŸ“¦ Building for Production

Backend

cd backend-app
./mvnw clean package
java -jar target/Online-Food-Order-0.0.1-SNAPSHOT.jar

Frontend

cd frontend-app
npm run build

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Swarg-Food Team

πŸ™ Acknowledgments

  • Spring Boot community for excellent documentation
  • React team for the powerful UI library
  • Material-UI for beautiful components
  • Stripe for secure payment processing

πŸ“ž Support

For support, email support@swargfood.com or open an issue in the repository.


⭐ If you find this project useful, please consider giving it a star!

Built with ❀️ using Spring Boot and React

About

Swarg-Food is a full-stack, multi-vendor food delivery platform built with Spring Boot 3 and React 18. It supports restaurant management, real-time ordering, and secure Stripe payments with role-based access. Designed with JWT security and a scalable architecture, it demonstrates production-ready full-stack development.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages