Skip to content

codeformuenster/time2falafel

Repository files navigation

Time 2 Falafel - Queue Tracker

A real-time queue tracking application for falafel restaurants, built with FastAPI and WebSockets.

Features

  • Real-time Queue Management: Join and leave the queue with live updates
  • Queue Statistics: Track current queue length, average wait times, and completed orders
  • Wait Time History: View recent completed wait times with timestamps
  • Visual Analytics: Graph showing wait time trends
  • German Interface: Fully localized German user interface
  • Responsive Design: Works on desktop and mobile devices

Technology Stack

  • Backend: FastAPI (Python)
  • Database: Redis
  • Frontend: Vanilla JavaScript with WebSockets
  • Styling: Custom CSS with German falafel shop theme
  • Containerization: Docker & Docker Compose

Quick Start

Using Docker Compose (Recommended)

  1. Clone the repository
  2. Run the application:
    docker-compose up
  3. Open your browser to http://localhost:5000

Manual Setup

  1. Install dependencies:

    pip install fastapi uvicorn redis
  2. Start Redis server:

    redis-server
  3. Run the application:

    python app.py
  4. Open your browser to http://localhost:5000

Usage

  1. Join Queue: Enter your name (optional) and the number of people ahead of you
  2. Track Progress: Watch real-time updates of queue statistics
  3. Leave Queue: Click "Warteschlange verlassen" when you're served
  4. View Analytics: Check the wait time graph and history

Configuration

Environment variables:

  • REDIS_HOST: Redis server hostname (default: localhost)
  • REDIS_PORT: Redis server port (default: 6379)

API Endpoints

  • GET /: Main application interface
  • WebSocket /ws: Real-time communication for queue updates

WebSocket Messages

Client to Server:

  • join_queue: Add user to queue
  • leave_queue: Remove user from queue
  • get_stats: Request current statistics

Server to Client:

  • queue_updated: Broadcast queue state changes

Development

The application uses:

  • FastAPI for the web framework
  • Redis for data persistence
  • WebSockets for real-time updates
  • Jinja2 templates for HTML rendering

License

MIT License

About

A webapp to measure the waiting time in a falafel queue (or any queue really)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •