Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A responsive cafe menu app built with Bun, customizable via YAML, and deployable with Docker.

License

Notifications You must be signed in to change notification settings

raritysoftware/OpenCafeMenu

Repository files navigation

β˜• Open Cafe Menu

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.

🎯 Features

  • 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-yaml for 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 serve for minimal container size
  • Dark/Light Mode Toggle for better user experience

πŸš€ Quick Start

Prerequisites

  • Bun (recommended) or Node.js 16+
  • Docker (optional, for containerized deployment)

Development

# 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)

Docker Deployment

# 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

βš™οΈ Configuration

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"

πŸ—οΈ Architecture

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

🎨 Theming

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.

🐳 Docker

The application uses a multi-stage Docker build:

  1. Builder Stage: Uses oven/bun:1 to install dependencies and build the application
  2. Production Stage: Uses node:18-alpine with serve to serve static files

Features:

  • Minimal container size
  • serve static file server with SPA support
  • No nginx complexity
  • Simple and lightweight deployment

πŸ› οΈ Development Scripts

  • bun install - Install dependencies
  • bun dev - Start development server with hot reload
  • bun build - Build for production
  • bun preview - Preview production build locally (Vite's preview)
  • bun serve - Serve production build using serve package

πŸ“ Error Handling

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

🌍 Browser Support

  • Modern browsers with ES2020 support
  • Mobile-responsive design
  • Progressive Web App features ready

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Made with ❀️ for coffee lovers worldwide.

About

A responsive cafe menu app built with Bun, customizable via YAML, and deployable with Docker.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /