Restaurant Menu Digitization Platform
QRBites is a modern, full-stack web application that enables restaurants to digitize their menus and provide customers with a seamless, contactless dining experience through QR codes. Built with cutting-edge technologies, QRBites offers a comprehensive solution for restaurant menu management, QR code generation, and customer menu viewing.
- Backend API: https://qrbites-api.vercel.app
- Frontend App: https://qr-bites-api.vercel.app
- API Documentation: https://qrbites-api.vercel.app/api-docs
- π½οΈ Digital Menu Management - Create, update, and organize restaurant menus with ease
- π± QR Code Generation - Automatic QR code creation for instant menu access
- π Secure Authentication - JWT-based authentication with role-based access control
- π₯ Multi-Role Support - Admin, Restaurant Owner, and Customer roles
- πΌοΈ Image Management - Cloudinary integration for efficient image upload and optimization
- π Advanced Search - Powerful menu search and filtering capabilities
- π API Documentation - Interactive Swagger/OpenAPI documentation
- β‘ High Performance - Redis caching and rate limiting for optimal performance
- π¨ Modern UI - Beautiful, responsive interface built with React and Tailwind CSS
- π PWA Ready - Progressive Web App capabilities for mobile experience
QRBites follows a modern monorepo structure with separated frontend and backend:
qrbites/
βββ frontend/ # React + TypeScript + Vite
βββ backend/ # Node.js + Express + MongoDB
βββ .husky/ # Git hooks for code quality
βββ package.json # Root workspace configuration
- Runtime: Node.js 20+
- Framework: Express.js 5.1
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (JSON Web Tokens)
- File Storage: Cloudinary
- Caching: Redis with ioredis
- Documentation: Swagger/OpenAPI
- Testing: Jest with Supertest
- Code Quality: ESLint, Prettier
- Library: React 18
- Language: TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS
- Routing: React Router 7
- State Management: TanStack Query (React Query)
- Forms: React Hook Form + Zod validation
- UI Components: Headless UI, Heroicons
- Notifications: Notistack
- Node.js >= 20.0.0
- npm >= 10.0.0
- MongoDB (local or cloud instance)
- Redis (optional, for caching)
- Cloudinary Account (for image uploads)
-
Clone the repository
git clone https://github.com/yourusername/qrbites.git cd qrbites -
Install root dependencies
npm install
-
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd ../frontend npm install
Create a .env file in the backend directory:
# Server Configuration
NODE_ENV=development
PORT=5000
HOST=localhost
# Database
MONGODB_URI=mongodb://localhost:27017/qrbites
# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key-min-32-characters
JWT_EXPIRES_IN=7d
JWT_REFRESH_EXPIRES_IN=30d
# Cloudinary Configuration
CLOUDINARY_CLOUD_NAME=your-cloudinary-cloud-name
CLOUDINARY_API_KEY=your-cloudinary-api-key
CLOUDINARY_API_SECRET=your-cloudinary-api-secret
# CORS Configuration
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173
# File Upload
MAX_FILE_SIZE=5242880
# Rate Limiting
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100
AUTH_RATE_LIMIT_MAX=5
CREATE_USER_RATE_LIMIT_MAX=3
# Frontend URL
FRONTEND_URL=http://localhost:5173
# Logging
LOG_LEVEL=debugCreate a .env file in the frontend directory:
VITE_API_URL=http://localhost:5000
VITE_DEMO_EMAIL=demo@example.com
VITE_DEMO_PASSWORD=demo123-
Start the backend
cd backend npm run devBackend will run on
http://localhost:5000 -
Start the frontend (in a new terminal)
cd frontend npm run devFrontend will run on
http://localhost:5173
-
Build the frontend
cd frontend npm run build -
Start the backend in production
cd backend npm run start:prod
cd backend
# Build the image
npm run docker:build
# Run the container
npm run docker:runAccess the interactive API documentation:
- Production: https://qrbites-api.vercel.app/api-docs
- Local Development:
http://localhost:5000/api-docs
- Backend Documentation - Detailed backend setup and API information
- Frontend Documentation - Frontend architecture and component guide
cd backend
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watch
# Run specific test suites
npm run test:unit
npm run test:integrationThe backend maintains high test coverage with:
- Unit tests for models, controllers, and services
- Integration tests for API endpoints
- Middleware tests for authentication and validation
The project uses pre-commit hooks via Husky to ensure code quality:
- ESLint - Code linting
- Prettier - Code formatting
- Lint-staged - Run checks on staged files
# Lint backend
npm run lint:backend
# Lint frontend
npm run lint:frontend
# Format backend
npm run format:backend
# Format frontend
npm run format:frontend
# Run all pre-commit checks
npm run prebackend/
βββ src/
β βββ common/ # Shared utilities
β β βββ errors/ # Error classes
β β βββ middlewares/ # Express middlewares
β β βββ services/ # Common services
β β βββ utils/ # Utility functions
β β βββ validation/ # Validation schemas
β βββ config/ # Configuration files
β βββ modules/ # Feature modules
β β βββ users/ # User management
β β βββ restaurants/ # Restaurant management
β β βββ menus/ # Menu management
β β βββ menuItems/ # Menu items management
β β βββ health/ # Health check
β βββ app.js # Express app setup
β βββ server.js # Server entry point
βββ __tests__/ # Test files
βββ docs/ # API documentation
βββ package.json
frontend/
βββ src/
β βββ api/ # API client
β βββ assets/ # Static assets
β βββ components/ # Reusable components
β β βββ common/ # Common UI components
β β βββ app/ # App-level components
β βββ config/ # Configuration
β β βββ routes/ # Route definitions
β βββ contexts/ # React contexts
β βββ features/ # Feature modules
β β βββ auth/ # Authentication
β β βββ restaurants/ # Restaurant management
β β βββ menus/ # Menu management
β β βββ viewer/ # Menu viewer
β β βββ qr/ # QR code generation
β βββ hooks/ # Custom React hooks
β βββ providers/ # App providers
β βββ styles/ # Global styles
β βββ types/ # TypeScript types
β βββ utils/ # Utility functions
β βββ App.tsx # Root component
β βββ main.tsx # Entry point
βββ package.json
QRBites implements multiple security best practices:
- Authentication: JWT-based stateless authentication
- Authorization: Role-based access control (RBAC)
- Password Hashing: Bcrypt with configurable rounds
- Rate Limiting: Protection against brute force attacks
- Input Validation: Joi schemas for request validation
- Sanitization: MongoDB query sanitization
- CORS: Configurable cross-origin resource sharing
- Helmet: Security headers middleware
- File Upload: Validated and restricted file uploads
The backend is configured for Vercel deployment with vercel.json.
cd backend
vercel deployThe frontend is also configured for Vercel deployment.
cd frontend
vercel deployEnsure all required environment variables are configured in your deployment platform.