Skip to content

Latest commit

Β 

History

History
154 lines (114 loc) Β· 4.49 KB

File metadata and controls

154 lines (114 loc) Β· 4.49 KB

QR Menu Generator

A full-stack web application for restaurants to create, manage, and share digital menus via QR codes. Built with Java Spring Boot (backend) and React + Vite (frontend).


πŸš€ Features

  • Digital Menu Management: Create, edit, and organize restaurant menus and categories.
  • QR Code Generation: Instantly generate QR codes for menus.
  • User Roles: Admin, Manager, Co-Manager, and User roles with fine-grained permissions.
  • Order Management: Place and track orders, including public order confirmation.
  • Favorites & Cart: Users can favorite products and manage a shopping cart.
  • Profile Management: Upload and update profile pictures.
  • Allergen Information: Display allergen icons for menu items.
  • Multi-language Support: Easily switch between supported languages.
  • Responsive UI: Modern, mobile-friendly interface.

πŸ—‚οΈ Project Structure

QR_Menu_Generator/
β”‚
β”œβ”€β”€ src/                # Backend (Java Spring Boot)
β”‚   └── main/java/com/example/qr_menu/
β”‚       β”œβ”€β”€ configurations/   # Security, CORS, Web config
β”‚       β”œβ”€β”€ controllers/      # REST API endpoints
β”‚       β”œβ”€β”€ dto/              # Data Transfer Objects
β”‚       β”œβ”€β”€ entities/         # JPA Entities
β”‚       β”œβ”€β”€ exceptions/       # Global error handling
β”‚       β”œβ”€β”€ repositories/     # Spring Data JPA Repos
β”‚       β”œβ”€β”€ security/         # JWT, filters, utils
β”‚       β”œβ”€β”€ services/         # Business logic
β”‚       └── utils/            # Utility classes
β”‚
β”œβ”€β”€ front_end/          # Frontend (React + Vite)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/        # API calls
β”‚   β”‚   β”œβ”€β”€ components/ # React components
β”‚   β”‚   β”œβ”€β”€ contexts/   # React context providers
β”‚   β”‚   β”œβ”€β”€ pages/      # Page components
β”‚   β”‚   β”œβ”€β”€ translations/ # i18n files
β”‚   β”‚   └── utils/      # Utility functions
β”‚   β”œβ”€β”€ public/         # Static assets (images, icons)
β”‚   β”œβ”€β”€ index.html
β”‚   └── package.json
β”‚
β”œβ”€β”€ uploads/            # Uploaded images (profile, menu, products)
└── README.md           # Project documentation

πŸ› οΈ Backend (Spring Boot)

Prerequisites

  • Java 17+
  • Maven 3.6+
  • MySQL or compatible database

Setup & Run

  1. Configure Database:
    Edit src/main/resources/application.properties with your DB credentials and JWT secret.

  2. Database Migration:
    Flyway is used for DB migrations (see src/main/resources/db/migration/).

  3. Run the Application:

    ./mvnw spring-boot:run

    The backend runs at http://localhost:8080.

API Overview

  • Authentication: /api/auth/**
  • Accounts: /api/accounts/**
  • Menus: /api/menus/**
  • Products: /api/products/**
  • Categories: /api/categories/**
  • Orders: /api/orders/**
  • Favorites: /api/favorites/**
  • Manager Assignments: /api/manager-assignments/**
  • Uploads: /uploads/** (static files)

See controller classes in src/main/java/com/example/qr_menu/controllers/ for details.


πŸ’» Frontend (React + Vite)

Prerequisites

  • Node.js 18+
  • npm 9+

Setup & Run

  1. Install dependencies:

    cd front_end
    npm install
  2. Start the development server:

    npm run dev

    The frontend runs at http://localhost:5173.

  3. Build for production:

    npm run build

πŸ”’ Authentication & Authorization

  • Uses JWT for stateless authentication.
  • Role-based access control is enforced in SecurityConfig.java.
  • Public endpoints: login, registration, menu viewing, QR code generation, and static uploads.
  • Protected endpoints: menu management, orders, favorites, account updates, etc.

πŸ–ΌοΈ File Uploads & Static Files

  • Uploaded images (profile pictures, menu images, product images) are stored in the uploads/ directory.
  • Static files are served via /uploads/** endpoints.
  • Default images are available for products and profiles.

🀝 Contributing

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature).
  3. Commit your changes.
  4. Push to your branch and open a Pull Request.

πŸ“„ License

This project is licensed under the MIT License.


For more details, see the code and comments in each module. If you have questions or need help, please open an issue or contact the maintainer.