No description
Find a file
Oliver Großkloß 44bc9dba7c
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Adjust padding in AppHomeScreen for better layout and update widget test formatting
2025-11-17 20:39:39 +01:00
.woodpecker Add integration test for unpaid orders and fix navigation logic there 2025-11-17 19:46:46 +01:00
android chore: generate launcher icons (adaptive dark blue background) 2025-10-17 12:11:54 +02:00
integration_test Add integration tests for complete user workflows and admin functionalities 2025-11-17 20:15:47 +01:00
ios configured routing and admin frontend 2025-11-13 14:52:55 +01:00
lib Adjust padding in AppHomeScreen for better layout and update widget test formatting 2025-11-17 20:39:39 +01:00
linux initial build of flutter project 2025-10-16 14:29:35 +02:00
macos configured routing and admin frontend 2025-11-13 14:52:55 +01:00
test Adjust padding in AppHomeScreen for better layout and update widget test formatting 2025-11-17 20:39:39 +01:00
test_driver run formatter 2025-11-03 10:49:30 +01:00
ui_drafts add admin view 2025-11-06 14:30:45 +01:00
web chore: generate launcher icons (adaptive dark blue background) 2025-10-17 12:11:54 +02:00
windows initial build of flutter project 2025-10-16 14:29:35 +02:00
.gitignore initial build of flutter project 2025-10-16 14:29:35 +02:00
.metadata initial build of flutter project 2025-10-16 14:29:35 +02:00
analysis_options.yaml Fix CI lint check by suppressing test warning 2025-11-17 18:54:13 +01:00
docker-compose.yml Update README and Docker configuration; add order submission integration tests 2025-11-16 01:21:06 +01:00
Dockerfile Fix lints & add API service 2025-11-15 20:43:05 +01:00
pubspec.lock configured routing and admin frontend 2025-11-13 14:52:55 +01:00
pubspec.yaml configured routing and admin frontend 2025-11-13 14:52:55 +01:00
README.md Adjust padding in AppHomeScreen for better layout and update widget test formatting 2025-11-17 20:39:39 +01:00

WaiterOrder Frontend

WaiterOrder Logo

View Demo

Flutter web application for ordering waiters at restaurants.

🚀 Quick Start

Deploy to olli.info (default)

docker compose up -d

Frontend will be available at: http://localhost:16180
Default backend: https://waiterorderbackend.olli.info

Deploy with local backend

BACKEND_URL=http://localhost:16181 docker compose up -d

Local Testing (CI-style)

Run tests exactly as they run in CI:

# Format check
docker run --rm -v "$PWD":/app -w /app ghcr.io/cirruslabs/flutter:stable sh -c "flutter pub get && dart format --set-exit-if-changed --output=none ."

# Lint check
docker run --rm -v "$PWD":/app -w /app ghcr.io/cirruslabs/flutter:stable sh -c "flutter pub get && flutter analyze --fatal-infos"

# Unit/Widget tests
docker run --rm -v "$PWD":/app -w /app ghcr.io/cirruslabs/flutter:stable sh -c "flutter pub get && flutter test"

# Build web
docker run --rm -v "$PWD":/app -w /app ghcr.io/cirruslabs/flutter:stable sh -c "flutter pub get && flutter build web --release"

🐳 Docker Configuration

The docker-compose.yml file supports flexible backend configuration:

services:
  frontend:
    build:
      context: .
      args:
        BACKEND_URL: ${BACKEND_URL:-https://waiterorderbackend.olli.info}

Usage examples:

# Production (olli.info backend - default)
docker compose up -d

# Local backend
BACKEND_URL=http://localhost:16181 docker compose up -d

# Custom backend
BACKEND_URL=https://custom-backend.example.com docker compose up -d

🔄 Update Deployment

# cd /mnt/Data/Apps/HM_SE/WaiterOrder/frontend

git pull
docker compose down
docker compose build --no-cache
docker compose up -d

🛠️ Environment Variables

🔬 CI/CD

Mirror: https://git.olli.info/Oliver/WaiterOrder_Frontend
CI Pipeline: https://ci.olli.info/repos/2 Build Status

Pipeline steps:

  1. Format check (dart format --set-exit-if-changed)
  2. Lint check (flutter analyze --fatal-infos)
  3. Unit/Widget tests (flutter test)
  4. Integration tests (Chrome + ChromeDriver)
  5. Web build (flutter build web --release)

📁 Project Structure

frontend/
├── lib/
│   ├── main.dart            # App entry point & main UI
│   ├── config/              # Configuration files
│   └── services/
│       └── api_service.dart # Backend API client & DTOs
├── test/
│   └── widget_test.dart     # Unit/Widget tests
├── integration_test/
│   ├── integration_test.dart        # Integration test suite
│   └── order_submission_test.dart   # Order flow tests
├── web/                     # Web-specific files
├── ui_drafts/               # Design assets
├── Dockerfile               # Multi-stage Docker build
└── docker-compose.yml       # Container orchestration

🧪 Development

Prerequisites

  • Flutter SDK (stable channel)
  • Dart SDK
  • Chrome (for web testing)
  • Docker (optional)

Run locally

# Install dependencies
flutter pub get

# Run in Chrome
flutter run -d chrome --web-port 8080

# Or run in your default browser
flutter run -d web-server --web-port 8080

Run tests

# Unit/Widget tests
flutter test

# Integration tests (requires backend running)
flutter drive --driver=test_driver/integration_test.dart \
              --target=integration_test/integration_test.dart \
              -d chrome

Format and lint code

# Auto-format code
dart format .

# Check formatting
dart format --set-exit-if-changed --output=none .

# Run linter
flutter analyze --fatal-infos

Development with Docker

# Build for development with default backend (creates build/web/)
docker run --rm -v "$PWD":/app -w /app ghcr.io/cirruslabs/flutter:stable sh -c "flutter pub get && flutter build web"

# OR build with custom backend
docker run --rm -v "$PWD":/app -w /app ghcr.io/cirruslabs/flutter:stable sh -c "flutter pub get && flutter build web --dart-define=BACKEND_URL=http://localhost:16181"

# Then serve the built app with Python
cd build/web && python3 -m http.server 8080 ; cd ../..

# Run all tests
docker run --rm -v "$PWD":/app -w /app ghcr.io/cirruslabs/flutter:stable sh -c "flutter pub get && flutter test"

# Format code
docker run --rm -v "$PWD":/app -w /app ghcr.io/cirruslabs/flutter:stable sh -c "dart format -o write ."

# Check formatting
docker run --rm -v "$PWD":/app -w /app ghcr.io/cirruslabs/flutter:stable sh -c "dart format --set-exit-if-changed --output=none ."

# Run linter
docker run --rm -v "$PWD":/app -w /app ghcr.io/cirruslabs/flutter:stable sh -c "flutter pub get && flutter analyze"

# Run integration tests (exactly as CI does)
docker run --rm -v "$PWD":/workspace -w /workspace ghcr.io/cirruslabs/flutter:stable bash -c 'flutter pub get && chmod +x .woodpecker/frontend/ci_connect_and_run.sh && chmod +x .woodpecker/frontend/download_chromedriver.sh && apt-get update -qq && apt-get install -y -qq wget unzip xvfb jq curl && wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && apt-get install -y -qq ./google-chrome-stable_current_amd64.deb && rm google-chrome-stable_current_amd64.deb && .woodpecker/frontend/download_chromedriver.sh && .woodpecker/frontend/ci_connect_and_run.sh'