Welcome to EatyQ! This project allows users to effortlessly create and manage interactive, QR code-based digital menus. The platform is built with the MERN stack, and it provides a user-friendly interface for menu creation, management, and public display via QR codes.
- User Authentication: Secure login and registration using sessions.
- Menu Management: Create, update, and delete menus.
- Category Management: Organize menu items into categories.
- Item Management: Add, update, and delete items with options for variations.
- Image Uploads: Upload item images using Cloudinary.
- Interactive QR Codes: Generate and download QR codes for public menu pages.
- Public Menu Page: Customer-facing menu view accessible via QR code.
- Search Functionality: Search items by name or description in both admin and public views.
- Responsive Design: User-friendly interface with ShadcnUI and TailwindCSS.
- Frontend: React, TypeScript, TanStack Query, Zustand, ShadcnUI, TailwindCSS
- Backend: Node.js, Express, TypeScript, MongoDB, Mongoose
- Authentication: Express-Session, bcrypt
- Image Uploads: Cloudinary, Multer
- QR Code Generation: qrcode.react
- QR Code Image Generation: html2canvas
mern-eatyq/
├── backend/ # Backend source code
│ ├── src/
│ │ ├── config/ # Configuration files (e.g., Cloudinary)
│ │ ├── controllers/ # Express route controllers
│ │ ├── middleware/ # Express middleware
│ │ ├── models/ # Mongoose models
│ │ ├── routes/ # Express routes
│ │ ├── util/ # Utility functions
│ │ ├── app.ts # Express app setup
│ │ └── server.ts # Server startup script
│ ├── Dockerfile # Backend Docker configuration
│ └── .dockerignore # Backend Docker ignore rules
├── frontend/ # Frontend source code
│ ├── src/
│ │ ├── api/ # API service files
│ │ ├── components/ # Reusable components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── layout/ # Layout components
│ │ ├── pages/ # Application pages
│ │ ├── store/ # Zustand stores
│ │ ├── types/ # TypeScript types
│ │ └── main.tsx # Frontend entry point
│ ├── Dockerfile # Frontend Docker configuration
│ └── .dockerignore # Frontend Docker ignore rules
├── data/ # MongoDB data persistence
├── docker-compose.yml # Docker Compose configuration
└── README.md # Project documentation
-
Clone the repository:
git clone https://github.com/babaygt/eatyq.git cd eatyq -
Set up environment variables: Create a
.envfile in thebackenddirectory with:PORT=5000 SESSION_SECRET=your_session_secret CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
-
Build and run with Docker Compose:
docker-compose up --build
The application will be available at:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:5000 - MongoDB:
mongodb://localhost:37017
- Frontend:
-
Prerequisites:
- Node.js (v14+)
- MongoDB (v4+)
- Cloudinary Account (for image uploads)
-
Clone the repository:
git clone https://github.com/babaygt/eatyq.git cd eatyq -
Install dependencies:
cd backend npm install cd ../frontend npm install
-
Set up environment variables: Create a
.envfile in thebackenddirectory with:MONGO_URI=your_mongo_db_connection_string PORT=5000 SESSION_SECRET=your_session_secret CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
-
Start the backend server:
cd backend npm start -
Start the frontend development server:
cd frontend npm run dev -
Access the application: Open your browser and navigate to
http://localhost:5173
-
Users:
POST /api/users/register: Register a new userPOST /api/users/login: LoginPOST /api/users/logout: LogoutGET /api/users/me: Get the current authenticated user
-
Menus:
GET /api/menus: Get all menus for the authenticated userPOST /api/menus: Create a new menuGET /api/menus/:menuId: Get a specific menuPATCH /api/menus/:menuId: Update a menuDELETE /api/menus/:menuId: Delete a menu
-
Categories:
GET /api/menus/:menuId/categories: Get all categories for a menuPOST /api/menus/:menuId/categories: Create a new categoryPUT /api/menus/:menuId/categories/:categoryId: Update a categoryDELETE /api/menus/:menuId/categories/:categoryId: Delete a category
-
Items:
GET /api/menus/:menuId/categories/:categoryId/items: Get all items for a categoryPOST /api/menus/:menuId/categories/:categoryId/items: Create a new itemPUT /api/menus/:menuId/categories/:categoryId/items/:itemId: Update an itemDELETE /api/menus/:menuId/categories/:categoryId/items/:itemId: Delete an item
-
Images:
POST /api/image/image: Upload an imageDELETE /api/image/image/:publicId: Delete an image
- Register a new account or log in to an existing one.
- From the dashboard, create a new menu.
- Add categories to your menu.
- Add items to your categories, including descriptions, prices, and images.
- Navigate to the menu page for which you want to generate a QR code.
- Click the "Show QR Code" button to display the QR code.
- Use the "Download QR Code" button to save the QR code as an image.
- The QR code can be styled or plain. Toggle between styles using the provided button.
The public menu page is now fully implemented and accessible via a unique URL generated along with the QR code. It displays the restaurant's menu in an interactive format, allowing patrons to:
- Browse categories
- View item details including descriptions, prices, and images
- Search for specific items
- On both the admin menu page and the public menu page, you'll find a search bar above the list of items.
- Enter a search term to filter items by name or description.
- The list of items will update in real-time as you type.
- This feature helps both restaurant managers and customers quickly find specific items.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository.
- Create your feature branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.