This directory contains the frontend for the Hunguryy restaurant ordering system, built with HTML, CSS, and vanilla JavaScript.
The frontend provides the user interface for customers to browse the menu, place orders, and make payments. It also includes an admin panel for restaurant staff to manage orders.
- Dynamic Menu: Fetches and displays the menu from the backend API.
- Shopping Cart: Allows users to add, remove, and update items in their cart.
- Order Placement: Submits orders to the backend and handles the payment process with Razorpay.
- Order Status Tracking: Shows the real-time status of a customer's order.
- Admin Dashboard: A view for staff to see and manage incoming orders.
There are two ways to run the frontend:
Since the frontend is built with static files, you can simply open the .html files (e.g., index.html, menu.html) in your web browser.
Note: For the API calls to the backend to work, the backend server must be running (by default at http://127.0.0.1:5000). You may also need to handle CORS (Cross-Origin Resource Sharing) issues, which can be done by using a browser extension for development or by ensuring the Flask backend is configured to allow requests from the frontend's origin.
A Dockerfile is provided to run the frontend in a containerized Nginx server.
-
Build the Docker image:
docker build -t hungury-frontend . -
Run the Docker container:
docker run -d -p 8080:80 --name hungury-frontend-container hungury-frontend
The frontend will then be accessible at http://localhost:8080. This method is recommended as it mimics a production environment and avoids potential CORS issues.
The JavaScript files are configured to connect to the backend API at http://127.0.0.1:5000/api. If your backend is running on a different address, you will need to update the API_URL constant in the <script> sections of the HTML files.