Skip to content
 
 

Repository files navigation

🍽️ Restaurant Management System

A full-stack restaurant management system with table reservations, pre-ordering, menu management, and admin dashboard.

🏗️ Project Structure

├── backend/          # Spring Boot REST API
├── frontend/         # React + Vite frontend
└── README.md

🚀 Tech Stack

Backend

  • Framework: Spring Boot 3.5.7
  • Language: Java 21
  • Database: PostgreSQL
  • ORM: Spring Data JPA
  • Migration: Flyway
  • Security: Spring Security + JWT
  • Build Tool: Maven

Frontend

  • Framework: React 18
  • Build Tool: Vite 7
  • Router: React Router v7
  • Styling: Tailwind CSS 4
  • UI Components: Radix UI, Custom Components
  • State Management: Context API
  • HTTP Client: Axios

📦 Features

  • 🔐 Authentication & Authorization - JWT-based auth with role-based access control (Admin/Customer)
  • 🪑 Table Reservation System - Interactive seating map with real-time availability
  • 🍕 Menu Management - Browse menu items, add reviews, and manage cart
  • 🛒 Pre-Order System - Order food in advance for pickup/dine-in
  • 👤 User Profiles - Manage personal information and view order history
  • 📊 Admin Dashboard - Manage users, tables, menu items, and reservations
  • 🌙 Dark Mode - System-wide dark mode support

🛠️ Getting Started

Prerequisites

  • Java: JDK 21+
  • Node.js: v18+
  • PostgreSQL: 14+
  • Maven: 3.8+

Backend Setup

  1. Navigate to backend directory:
cd backend
  1. Configure database in src/main/resources/application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/restaurant_db
spring.datasource.username=your_username
spring.datasource.password=your_password
  1. Run the application:
./mvnw spring-boot:run

Backend will start on http://localhost:8080

Frontend Setup

  1. Navigate to frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Start development server:
npm run dev

Frontend will start on http://localhost:5173

📁 Project Organization

Frontend Structure

frontend/src/
├── assets/           # Images and static assets
├── components/       # Reusable components
│   ├── common/       # Shared utilities (LoadingSpinner, etc.)
│   ├── ui/           # UI component library
│   ├── admin/        # Admin-specific components
│   ├── menu/         # Menu-related components
│   ├── seating2d/    # Seating map components
│   └── preorder-ui/  # Pre-order components
├── context/          # React Context providers
├── hooks/            # Custom React hooks
├── lib/              # Utilities and API client
├── pages/            # Page components
│   ├── homePage/     # Home page with components
│   ├── loginPage/    # Authentication pages
│   ├── menuPage/     # Menu browsing
│   ├── cartPage/     # Shopping cart
│   ├── preOrderPage/ # Pre-order system
│   ├── seatingMap/   # Table reservation
│   ├── profilePage/  # User profile
│   └── adminPage/    # Admin dashboard
├── services/         # API service layer
├── styles/           # Global styles
└── types/            # TypeScript type definitions

Backend Structure

backend/src/main/java/com/restaurantmanager/
├── backend/
│   ├── config/       # Security & app configuration
│   ├── controller/   # REST API endpoints
│   ├── dto/          # Data Transfer Objects
│   ├── model/        # JPA entities
│   ├── repository/   # Data access layer
│   ├── security/     # JWT & authentication
│   └── service/      # Business logic
└── resources/
    ├── application.properties
    └── db/migration/ # Flyway migrations

🔑 API Endpoints

Authentication

  • POST /api/auth/login - User login
  • POST /api/auth/register - User registration
  • POST /api/auth/refresh - Refresh JWT token

User Management

  • GET /api/user/me - Get current user
  • PUT /api/user/profile - Update profile
  • GET /api/admin/users - List all users (Admin)

Menu

  • GET /api/menu - Get menu items
  • POST /api/menu - Create menu item (Admin)
  • PUT /api/menu/{id} - Update menu item (Admin)
  • DELETE /api/menu/{id} - Delete menu item (Admin)

Reservations

  • GET /api/reservations - Get user reservations
  • POST /api/reservations - Create reservation
  • GET /api/tables - Get available tables

Cart & Orders

  • GET /api/cart - Get cart items
  • POST /api/cart - Add to cart
  • POST /api/orders - Place order

🧪 Testing

Backend Tests

cd backend
./mvnw test

Frontend Tests

cd frontend
npm test

🚢 Deployment

Backend

cd backend
./mvnw clean package
java -jar target/backend-0.0.1-SNAPSHOT.jar

Frontend

cd frontend
npm run build
# Deploy dist/ folder to your hosting service

👥 Team

SLIIT Year 2 Semester 2 - Software Engineering Project

📄 License

This project is for educational purposes.


Built with ❤️ by Team GustoMare

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages