Skip to content
/ numa Public

Multi-tenant restaurant ordering and management platform with QR-based ordering, group sessions, and real-time management

Notifications You must be signed in to change notification settings

mtayyab/numa

Repository files navigation

Numa - Multi-Tenant Restaurant Ordering Platform

A comprehensive restaurant ordering and management platform that enables QR-based ordering, group sessions, bill splitting, and real-time management.

πŸš€ Features

Guest Experience

  • QR Code Ordering: Guests scan QR codes at tables to access menus instantly
  • Group Sessions: Multiple guests can join the same order session
  • Interactive Menu: Browse categories, search items, filter by dietary preferences
  • Real-time Ordering: Place orders that sync instantly with restaurant systems
  • Bill Splitting: Split bills by item, percentage, or custom amounts
  • Waiter Requests: Call waiters directly through the app

Restaurant Management

  • Multi-tenant Architecture: Support for multiple restaurants with isolated data
  • Menu Management: Create categories, items, variations, and pricing
  • Table Management: QR code generation and table status tracking
  • Order Management: Real-time order tracking and status updates
  • Session Management: Monitor active dining sessions
  • Analytics & Reporting: Comprehensive insights into sales and operations

Technical Features

  • Mobile-first Design: Optimized for mobile devices with PWA capabilities
  • Real-time Updates: WebSocket-based real-time synchronization
  • Multi-language Support: Internationalization ready
  • Offline Capability: Works offline with data synchronization
  • Security: JWT-based authentication with multi-tenant isolation

πŸ—οΈ Architecture

Backend (Spring Boot)

src/main/java/com/numa/
β”œβ”€β”€ config/              # Configuration classes
β”œβ”€β”€ controller/          # REST API controllers
β”œβ”€β”€ domain/
β”‚   β”œβ”€β”€ entity/         # JPA entities
β”‚   └── enums/          # Enumerations
β”œβ”€β”€ dto/
β”‚   β”œβ”€β”€ request/        # Request DTOs
β”‚   └── response/       # Response DTOs
β”œβ”€β”€ exception/          # Custom exceptions
β”œβ”€β”€ mapper/             # MapStruct mappers
β”œβ”€β”€ repository/         # JPA repositories
β”œβ”€β”€ security/           # Security configuration and JWT
└── service/            # Business logic services

Frontend (Next.js)

src/
β”œβ”€β”€ app/                # Next.js App Router pages
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ guest/          # Guest-facing components
β”‚   β”œβ”€β”€ admin/          # Admin dashboard components
β”‚   └── ui/             # Reusable UI components
β”œβ”€β”€ services/           # API services and utilities
β”œβ”€β”€ store/              # State management (Zustand)
β”œβ”€β”€ types/              # TypeScript type definitions
β”œβ”€β”€ utils/              # Utility functions
└── styles/             # CSS and styling

Database Schema

  • Multi-tenant: Restaurants are isolated with proper data separation
  • Scalable: Optimized for high-volume operations
  • Flexible: Supports various order types and payment methods
  • Analytics: Built-in tracking for business intelligence

πŸ› οΈ Technology Stack

Backend

  • Framework: Spring Boot 3.2
  • Database: PostgreSQL with Liquibase migrations
  • Security: Spring Security with JWT
  • API Documentation: OpenAPI/Swagger
  • Caching: Redis (optional)
  • Message Queue: RabbitMQ (optional)

Frontend

  • Framework: Next.js 14 with App Router
  • Styling: Tailwind CSS
  • State Management: Zustand + React Query
  • UI Components: Headless UI + Custom components
  • Forms: React Hook Form with Yup validation
  • PWA: Next-PWA for offline capability

DevOps & Infrastructure

  • Containerization: Docker & Docker Compose
  • CI/CD: GitHub Actions
  • Monitoring: Actuator endpoints
  • Logging: Structured logging with correlation IDs

🚦 Getting Started

Prerequisites

  • Java 17+
  • Node.js 18+
  • PostgreSQL 13+
  • Docker (optional)

Backend Setup

  1. Clone the repository

    git clone https://github.com/your-org/numa.git
    cd numa
  2. Database Setup

    # Create PostgreSQL database
    createdb numa_db
    
    # Update application.yml with your database credentials
  3. Run the application

    # Using Maven
    ./mvnw spring-boot:run
    
    # Using Docker
    docker-compose up -d
  4. API Documentation

Frontend Setup

  1. Navigate to frontend directory

    cd frontend
  2. Install dependencies

    npm install
  3. Environment configuration

    cp .env.example .env.local
    # Update environment variables
  4. Run development server

    npm run dev
  5. Access the application

πŸ“± Usage

Restaurant Onboarding

  1. Visit /restaurants/register
  2. Fill in restaurant details and owner information
  3. Verify email and complete setup
  4. Configure menu, tables, and settings

Guest Ordering Flow

  1. Scan QR code at restaurant table
  2. Join or create dining session
  3. Browse menu and add items to cart
  4. Place order and track status
  5. Split bill and complete payment

Restaurant Management

  1. Login to admin dashboard
  2. Manage menu items and categories
  3. Monitor live orders and sessions
  4. Generate QR codes for tables
  5. View analytics and reports

πŸ”§ Configuration

Environment Variables

Backend (.env or application.yml)

# Database
DB_USERNAME=numa_user
DB_PASSWORD=numa_password

# JWT
JWT_SECRET=your-secret-key

# CORS
CORS_ALLOWED_ORIGINS=http://localhost:3000

# File Storage
FILE_STORAGE_PATH=./uploads

# Email (optional)
MAIL_HOST=smtp.gmail.com
MAIL_USERNAME=your-email
MAIL_PASSWORD=your-password

Frontend (.env.local)

NEXT_PUBLIC_API_URL=http://localhost:8080/api/v1
NEXT_PUBLIC_APP_URL=http://localhost:3000
GOOGLE_SITE_VERIFICATION=your-verification-code

πŸ§ͺ Testing

Backend Testing

# Run all tests
./mvnw test

# Run specific test class
./mvnw test -Dtest=RestaurantServiceTest

# Integration tests
./mvnw test -Dtest=**/*IT

Frontend Testing

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage

πŸ“Š Monitoring & Analytics

Application Metrics

  • Health Checks: /actuator/health
  • Metrics: /actuator/metrics
  • Prometheus: /actuator/prometheus

Business Analytics

  • Order volume and revenue tracking
  • Popular items and category analysis
  • Table utilization rates
  • Peak hours identification
  • Customer behavior insights

πŸ” Security

Authentication & Authorization

  • JWT-based authentication
  • Role-based access control (RBAC)
  • Multi-tenant data isolation
  • Session management for guests

Data Protection

  • Input validation and sanitization
  • SQL injection prevention
  • XSS protection
  • CSRF protection
  • Rate limiting

API Security

  • HTTPS enforcement
  • CORS configuration
  • Request/response logging
  • Error handling without data exposure

πŸš€ Deployment

Production Deployment

  1. Build applications

    # Backend
    ./mvnw clean package -DskipTests
    
    # Frontend
    cd frontend && npm run build
  2. Docker deployment

    docker-compose -f docker-compose.prod.yml up -d
  3. Environment setup

    • Configure production database
    • Set up SSL certificates
    • Configure CDN for static assets
    • Set up monitoring and logging

Scaling Considerations

  • Database read replicas
  • Redis caching layer
  • Load balancer configuration
  • CDN for static assets
  • Horizontal scaling with Docker Swarm/Kubernetes

🀝 Contributing

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

Development Guidelines

  • Follow conventional commit messages
  • Write tests for new features
  • Update documentation
  • Ensure code passes linting
  • Follow security best practices

πŸ“„ License

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


Numa - Transforming restaurant operations with modern technology 🍽️✨

About

Multi-tenant restaurant ordering and management platform with QR-based ordering, group sessions, and real-time management

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •