A minimal, aesthetic cafe menu selection web application designed for universal appeal. The application features a beautiful, user-friendly interface with customizable themes and reads configuration from YAML files.
- Modern React TypeScript Application with React Router for navigation
- Bun Runtime for fast dependency management and development
- Dynamic Theming via CSS variables (no Tailwind, no PostCSS)
- YAML Configuration using
js-yamlfor easy menu management - Multi-Currency Support - Display prices in any currency (βΊ, ,γγ« ,γγ« ,γγ« ,ε etc.)
- Business Hours Display - Show opening/closing times for each day
- Contact Information - Phone, email, and social media integration
- Responsive Design that works on all devices
- Error Handling with informative user messages
- Docker Support with multi-stage builds using
servefor minimal container size - Dark/Light Mode Toggle for better user experience
- Bun (recommended) or Node.js 16+
- Docker (optional, for containerized deployment)
# Install dependencies bun install # Start development server bun dev # Build for production bun run build # Preview production build locally bun run preview # Serve production build with serve bun run serve
The application will be available at http://localhost:3000 (dev) or http://localhost:5000 (serve)
# Build the Docker image docker build -t opencafemenu . # Run the container docker run --rm -p 5000:5000 opencafemenu
The application will be available at http://localhost:5000
Create a cafe.yml or cafe.yaml file in the public/ directory with the following structure:
name: "Your Cafe Name" location: address: "123 Coffee Street" city: "Your City" country: "Your Country" about: "A description of your cafe and what makes it special." currency: "βΊ" # Can be ,γγ« ,γγ« βΊ, ,γγ« ,ε etc. hours: monday: "07:00 - 22:00" tuesday: "07:00 - 22:00" wednesday: "07:00 - 22:00" thursday: "07:00 - 22:00" friday: "07:00 - 23:00" saturday: "08:00 - 23:00" sunday: "08:00 - 21:00" contact: phone: "+1 555 123 4567" email: "hello@yourcafe.com" instagram: "@yourcafe" categories: - "Coffee" - "Tea" - "Pastries" - "Cold Drinks" items: - name: "Espresso" category: "Coffee" price: 22 - name: "Cappuccino" category: "Coffee" price: 25 - name: "Earl Grey" category: "Tea" price: 18 theme: primaryColor: "#8B4513" secondaryColor: "#F5F5DC" font: "Georgia, serif"
The application follows a clean, modular architecture:
src/
βββ components/
β βββ Layout.tsx # Header, Footer, Navigation
β βββ CategoryList.tsx # Menu category filtering
β βββ ItemCard.tsx # Individual menu item display
β βββ ErrorBoundary.tsx # Error handling component
βββ pages/
β βββ Home.tsx # Landing page
β βββ About.tsx # About page
β βββ Menu.tsx # Menu page
βββ services/
β βββ configService.ts # YAML configuration loading
β βββ themeService.ts # Theme management
βββ types/
β βββ index.ts # TypeScript interfaces
βββ styles/
β βββ variables.css # CSS custom properties
βββ App.tsx # Main application component
βββ main.tsx # Application entry point
The application uses CSS custom properties for theming without any CSS frameworks:
- Primary Color: Main brand color for buttons, headers, etc.
- Secondary Color: Background color for cards and sections
- Font Family: Custom font selection for typography
- Dark Mode: Toggle between light and dark themes
Themes are applied dynamically at runtime through the ThemeService.
The application uses a multi-stage Docker build:
- Builder Stage: Uses
oven/bun:1to install dependencies and build the application - Production Stage: Uses
node:18-alpinewithserveto serve static files
Features:
- Minimal container size
servestatic file server with SPA support- No nginx complexity
- Simple and lightweight deployment
bun install- Install dependenciesbun dev- Start development server with hot reloadbun build- Build for productionbun preview- Preview production build locally (Vite's preview)bun serve- Serve production build usingservepackage
The application includes comprehensive error handling:
- Configuration Errors: Clear messages when YAML files are missing or malformed
- Error Boundary: Catches and displays React component errors gracefully
- Network Errors: Handles failed configuration loading with retry options
- Validation: Ensures configuration data meets required schema
- Modern browsers with ES2020 support
- Mobile-responsive design
- Progressive Web App features ready
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Made with β€οΈ for coffee lovers worldwide.