Restaurants Qr Project

 RestroQR - Restaurant Digital Menu & Ordering System


A complete QR code-based digital menu and ordering system for restaurants with real-time chat functionality.

     Features

                                    Customer Features

- 📱 **Digital Menu**: Browse menu items with categories (Veg/Non-Veg)

- 🛒 **Shopping Cart**: Add items, adjust quantities, view total

- 💳 **Payment Integration**: UPI payment with QR code generation

- 📊 **Order History**: View past orders and their status

- 💬 **Real-time Chat**: Chat with restaurant staff

- 🏷️ **Table Number**: Enter table number for order tracking



                             Owner Features

- 📋 **Order Management**: View, update, and track orders in real-time

- 🍽️ **Menu Management**: Add, edit, and delete menu items

- 📸 **Image Upload**: Upload dish images with automatic optimization

- 💬 **Customer Chat**: Respond to customer messages

- ⚙️ **Settings**: Configure payment details and restaurant settings

- 📈 **Real-time Updates**: Live order and message notifications

       

                          Technical Features

- 🚀 **Real-time Communication**: Socket.IO for live updates

- 💾 **Database**: SQLite with automatic schema creation

- 🔒 **Security**: Rate limiting, CORS protection, security headers

- 📱 **Responsive Design**: Works on all devices

- 🎨 **Modern UI**: Neumorphic design with smooth animations

- 🔄 **Cross-tab Sync**: Messages and orders sync across browser tabs


 Quick Start

    Local Development

1. **Clone or download the project**

   ```bash

   git clone <repository-url>

   cd restroqr

   ```

2. **Install dependencies**

   ```bash

   npm install

   ```

3. **Start the server**

   ```bash

   npm start

   # or for development with auto-restart

   npm run dev

   ```

4. **Access the application**

   - Customer Interface: http://localhost:3000

   - Owner Dashboard: http://localhost:3000/owner


          Production Deployment


1. **Upload files to your server**

2. **Install dependencies**

   ```bash

   npm install --production

   ```

3. **Start with PM2**

   ```bash

   npm install -g pm2

   pm2 start ecosystem.config.js --env production

   pm2 save

   pm2 startup

   ```

4. **Configure reverse proxy (Nginx)**

   See [DEPLOYMENT.md](DEPLOYMENT.md) for detailed instructions.


## Project Structure


```

restroqr/

├── server.js              # Main server file

├── package.json           # Dependencies and scripts

├── ecosystem.config.js    # PM2 configuration

├── Dockerfile             # Docker configuration

├── docker-compose.yml     # Docker Compose setup

├── nginx.conf             # Nginx configuration

├── index.html             # Customer interface

├── owner.html             # Owner dashboard

├── js/

│   ├── script.js          # Customer functionality

│   ├── owner.js           # Owner functionality

│   ├── chat.js            # Chat system

│   ├── messageStorage.js  # Message persistence

│   ├── menu-data.js       # Default menu items

│   └── api-client.js      # API client

├── css/

│   ├── style.css          # Main styles

│   └── neumorphism.css    # Neumorphic design

├── chat.css               # Chat styles

├── images/                # Static images

└── uploads/               # User uploaded images

```

  API Endpoints

 Menu API

- `GET /api/menu` - Get all menu items

- `POST /api/menu` - Add new menu item

- `PUT /api/menu/:id` - Update menu item

- `DELETE /api/menu/:id` - Delete menu item


   Orders API

- `GET /api/orders` - Get all orders

- `POST /api/orders` - Create new order

- `PUT /api/orders/:id/status` - Update order status

 

   Messages API

- `GET /api/messages` - Get all messages

- `POST /api/messages` - Send new message


   Settings API

- `GET /api/settings` - Get settings

- `POST /api/settings` - Update settings


  Configuration


   Environment Variables


Create a `.env` file:


```env

PORT=3000

NODE_ENV=production

JWT_SECRET=your-secret-key

```


Database


The application uses SQLite by default. The database file (`database.sqlite`) is created automatically with the following tables:


- `menu_items` - Menu items with categories and images

- `orders` - Customer orders with status tracking

- `messages` - Chat messages between customers and owners

- `settings` - Application settings


 Deployment Options


 1. Traditional VPS/Cloud Server

- Upload files via FTP/SFTP

- Install Node.js and dependencies

- Configure reverse proxy (Nginx)

- Set up SSL certificate

- Use PM2 for process management


 2. Docker Deployment

- Use provided Dockerfile

- Deploy with Docker Compose

- Includes Nginx reverse proxy

- Easy scaling and management


 3. Cloud Platforms

- **Heroku**: Deploy with git push

- **DigitalOcean**: Use App Platform

- **AWS**: Use Elastic Beanstalk

- **Google Cloud**: Use App Engine


Browser Support


- Chrome 60+

- Firefox 55+

- Safari 12+

- Edge 79+

- Mobile browsers (iOS Safari, Chrome Mobile)


 Performance


- **Page Load**: < 2 seconds

- **Image Optimization**: Automatic WebP conversion

- **Database**: SQLite with indexing

- **Caching**: Static asset caching

- **Compression**: Gzip compression enabled


   Security Features


- **Rate Limiting**: API and general request limits

- **CORS Protection**: Configurable origins

- **Security Headers**: Helmet.js implementation

- **File Upload**: Type and size validation

- **Input Validation**: Server-side validation

- **SQL Injection**: Parameterized queries


 Contributing


1. Fork the repository

2. Create a feature branch

3. Make your changes

4. Test thoroughly

5. Submit a pull request


License


MIT License - see LICENSE file for details


 Support


For issues and questions:

- Check the [DEPLOYMENT.md](DEPLOYMENT.md) guide

- Review GitHub issues

- Contact the development team


Changelog


Version 1.0.0

- Initial release

- Complete menu and ordering system

- Real-time chat functionality

- Payment integration

- Responsive design

- Docker support

- Production deployment ready


 Roadmap


     Upcoming Features

- [ ] Multi-language support

- [ ] Advanced analytics dashboard

- [ ] Email notifications

- [ ] SMS integration

- [ ] Inventory management

- [ ] Staff management

- [ ] Multiple restaurant support

- [ ] Mobile app (React Native)


---


**RestroQR** - Making restaurant ordering simple and efficient! 🍽️📱


Post a Comment

0 Comments