This is the frontend for the Little Lemon web application, built using React and Vite. The application interacts with a Django REST Framework (DRF) backend to provide restaurant-related features like menu display and table booking.
- Displays menu items fetched from the backend API.
- Allows users to book tables via a booking form.
- Fully responsive design.
- React Router-based navigation.
- Frontend Framework: React (with Vite)
- Styling: CSS (external stylesheets)
- HTTP Client: Axios
Ensure you have the following installed on your system:
- Node.js (v16 or higher)
- npm or yarn
-
Clone the repository:
git clone <https://github.com/Xerx81/LittleLemon-Frontend> cd LittleLemon-Frontend
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open the application in your browser at:
http://localhost:5173
littlelemon-frontend/
├── public/ # Static files
│ ├── favicon.ico
├── src/ # Main source code
│ ├── assets/ # Images and assets
│ ├── components/ # Reusable React components
│ ├── pages/ # Page components for routes
│ ├── styles/ # CSS files
│ ├── App.jsx # Main app component
│ ├── main.jsx # Entry point
├── index.html # HTML template
├── package.json # Dependencies and scripts
├── vite.config.js # Vite configuration
- Start Development Server:
npm run dev
- Build for Production:
npm run build
- Preview Production Build:
npm run preview
The frontend communicates with the backend through RESTful APIs. Ensure the backend is running before starting the frontend.
- Menu Items:
GET /restaurant/menu/items/
- Single Menu Item:
GET /restaurant/menu/items/:id/
- Bookings:
POST /restaurant/booking/tables/
Update the base URL in Axios if necessary:
axios.defaults.baseURL = 'http://127.0.0.1:8000';