Skip to content

livecodebase/little-lemon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Little Lemon Restaurant - Table Reservation Web App

A modern, accessible web application for the Little Lemon restaurant that allows customers to reserve tables online. Built with React and designed with UX/UI best practices, semantic HTML, and comprehensive accessibility features.

πŸ‹ Project Overview

Little Lemon is a family-owned Mediterranean restaurant in Chicago. This web app provides:

  • An elegant homepage showcasing the restaurant
  • A functional table reservation system with real-time availability
  • Form validation with helpful error messages
  • Fully responsive design for mobile, tablet, and desktop
  • Accessibility-first approach following WCAG guidelines

✨ Features

Homepage

  • Hero section with call-to-action
  • Weekly specials showcase (3 menu items)
  • Customer testimonials section
  • Mobile-responsive navigation
  • Semantic HTML structure

About Page

  • Dedicated page for restaurant information
  • Detailed restaurant story and history
  • Chef information and images

Booking System

  • Date picker with validation (no past dates)
  • Time slot selection with availability
  • Guest count selection (1-10 people)
  • Occasion selection for special events
  • Real-time form validation with clear error messages
  • Booking confirmation page with details

Accessibility

  • Semantic HTML5 elements (<nav>, <main>, <footer>, <section>)
  • ARIA labels and roles throughout
  • Proper heading hierarchy
  • Keyboard navigation support
  • Form validation with screen reader announcements
  • Focus management and visible focus indicators

Testing

  • Unit tests for components
  • Form validation tests
  • Accessibility attribute tests
  • 100% test coverage for booking form logic

πŸš€ Getting Started

Prerequisites

  • Node.js (version 14 or higher)
  • npm or yarn package manager

Installation

  1. Clone the repository:
git clone <your-repository-url>
cd lemon-app
  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev
  1. Open your browser and navigate to:
http://localhost:5173

πŸ“¦ Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm test - Run unit tests
  • npm run lint - Run ESLint for code quality

πŸ§ͺ Running Tests

The project includes comprehensive unit tests using Vitest and React Testing Library:

npm test

Tests cover:

  • Component rendering
  • Form validation logic
  • User interactions
  • Accessibility attributes
  • Error handling

πŸ“ Project Structure

lemon-app/
β”œβ”€β”€ public/                  # Static assets
β”‚   └── images/             # Restaurant images
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/         # React components
β”‚   β”‚   β”œβ”€β”€ Header.jsx      # Navigation header
β”‚   β”‚   β”œβ”€β”€ Hero.jsx        # Hero section
β”‚   β”‚   β”œβ”€β”€ About.jsx       # About section
β”‚   β”‚   β”œβ”€β”€ Specials.jsx    # Weekly specials menu
β”‚   β”‚   β”œβ”€β”€ Testimonials.jsx # Customer reviews
β”‚   β”‚   β”œβ”€β”€ Footer.jsx      # Footer with contact info
β”‚   β”‚   └── BookingForm.jsx # Booking form with validation
β”‚   β”œβ”€β”€ pages/              # Page components
β”‚   β”‚   β”œβ”€β”€ HomePage.jsx    # Main landing page
β”‚   β”‚   β”œβ”€β”€ AboutPage.jsx   # About restaurant page
β”‚   β”‚   β”œβ”€β”€ BookingPage.jsx # Reservation page
β”‚   β”‚   └── ConfirmationPage.jsx # Booking confirmation
β”‚   β”œβ”€β”€ tests/              # Unit tests
β”‚   β”‚   β”œβ”€β”€ Header.test.jsx
β”‚   β”‚   β”œβ”€β”€ Hero.test.jsx
β”‚   β”‚   β”œβ”€β”€ BookingForm.test.jsx
β”‚   β”‚   └── setup.js        # Test configuration
β”‚   β”œβ”€β”€ App.jsx             # Main app component with routing
β”‚   β”œβ”€β”€ App.css             # Component styles
β”‚   β”œβ”€β”€ index.css           # Global styles
β”‚   └── main.jsx            # App entry point
β”œβ”€β”€ index.html              # HTML template
β”œβ”€β”€ package.json            # Dependencies and scripts
β”œβ”€β”€ vite.config.js          # Vite configuration
└── README.md               # This file

🎨 Design & UX

Color Palette

  • Primary Green: #495e57 (Restaurant branding)
  • Primary Yellow: #f4ce14 (Accent color)
  • Light Background: #edefee
  • Dark Text: #333

Typography

  • Headings: Markazi Text (serif)
  • Body: Karla (sans-serif)

Responsive Breakpoints

  • Mobile: < 480px
  • Tablet: 480px - 768px
  • Desktop: > 768px

πŸ”§ Form Validation Rules

The booking form implements the following validation:

  • Date: Must be today or a future date
  • Time: Required selection from available slots
  • Guests: Must be between 1 and 10
  • Occasion: Optional selection

Error messages are displayed inline with clear, actionable text.

β™Ώ Accessibility Features

  • Semantic HTML5 structure
  • ARIA labels on all interactive elements
  • Proper form labels and field associations
  • Error messages announced to screen readers
  • Keyboard navigation support
  • Focus indicators on all interactive elements
  • Alt text for images
  • Proper heading hierarchy (h1 β†’ h6)

🌐 Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

πŸ“ Code Quality

The codebase follows these principles:

  • Clean Code: Clear variable and function names
  • Comments: Comprehensive JSDoc comments
  • Simplicity: Beginner-friendly code structure
  • Maintainability: Modular component architecture
  • No Extra Code: Only essential features included

🀝 Contributing

This is a learning project. When making contributions:

  1. Follow the existing code style
  2. Add comments for complex logic
  3. Write tests for new features
  4. Ensure accessibility is maintained

πŸ“„ License

This project is created for educational purposes as part of the Meta Front-End Developer Certificate program.

πŸ‘¨β€πŸ’» Developer Notes

Future Enhancements

  • Connect to a backend API for real booking management
  • Add user authentication
  • Implement email confirmations
  • Add menu section
  • Add customer reviews section
  • Integrate payment processing

Known Limitations

  • Currently uses simulated API calls
  • Time slots are static (not database-driven)
  • No persistent storage for bookings

πŸ“š Learning Resources

This project demonstrates:

  • React component architecture
  • State management with useState and useReducer
  • Form handling and validation
  • React Router for navigation
  • Responsive CSS design
  • Unit testing with Vitest
  • Accessibility best practices

πŸ™ Acknowledgments

Built as part of the Meta Front-End Developer Certificate program on Coursera.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors