You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Guillermo Pages 13097541f1
continuous-integration/drone/push Build is passing Details
feat(bookings): add provider-aware UI components for booking management
Implemented complete UI foundation for booking drawer with provider gating:

**Components Created:**

1. **ProviderBanner** (src/components/bookings/ProviderBanner.tsx)
   - Displays informational banner for FairPlay clubs
   - "This club is managed by {provider}" messaging
   - Only shows for non-local providers
   - Blue theme with Info icon

2. **CapacityDisplay** (src/components/bookings/CapacityDisplay.tsx)
   - Shows "X / Y booked · Z remaining" format
   - Three variants: default, compact, inline
   - Color-coded availability (red=full, orange=low, gray=available)
   - Responsive text sizing

3. **NotifyPlayersToggle** (src/components/bookings/NotifyPlayersToggle.tsx)
   - Toggle for controlling player notifications
   - Defaults to ON (true)
   - Persists preference to localStorage (key: booking_admin_notify_players)
   - SSR-safe with hydration protection
   - Bell/BellOff icon feedback
   - Exports getStoredNotifyPreference() helper

4. **BookingDrawer** (src/components/bookings/BookingDrawer.tsx)
   - Main booking management UI (360+ lines)
   - Provider-aware: disables actions for FairPlay clubs
   - Displays: time, location, capacity, attendees, booked_by
   - Status badges (confirmed/cancelled/no_show)
   - Attendee type badges (app_user/guest/remote_member)
   - Action buttons: Move, Edit Attendees, Cancel (hidden for FairPlay)
   - ETag support for optimistic concurrency
   - Loading and error states
   - Integrates all sub-components

**Features:**
- Read-only mode for FairPlay bookings (provider.manages_slot_storage === false)
- Capacity display with color-coded availability
- Notification toggle with localStorage persistence
- Professional slate theme matching existing UI
- Fully typed with BookingDetail interface
- Error handling with user-friendly messages

**TODO Placeholders:**
- Move booking flow (button wired, implementation pending)
- Edit attendees flow (button wired, implementation pending)
- Cancel booking flow (button wired, implementation pending)

Related: Phase 3, Booking Admin API v1.1, BUILD #22
1 month ago
dictionaries feat(slot-definitions): add create/edit form with validation 1 month ago
docker feat(phase-0): integrate admin clubs API with staging backend 1 month ago
docs feat(phase-0): integrate admin clubs API with staging backend 1 month ago
public feat(phase-0): integrate admin clubs API with staging backend 1 month ago
src feat(bookings): add provider-aware UI components for booking management 1 month ago
.deploy.yml chore: bump deploy number to 8 1 month ago
.dockerignore feat(phase-0): integrate admin clubs API with staging backend 1 month ago
.drone.yml fix(auth): update manager app to use dedicated auth backend 1 month ago
.eslintrc.json feat(phase-0): integrate admin clubs API with staging backend 1 month ago
.gitignore feat(phase-0): integrate admin clubs API with staging backend 1 month ago
API.md feat(phase-0): integrate admin clubs API with staging backend 1 month ago
ARCHITECTURE_IMPROVEMENTS.md feat(phase-0): integrate admin clubs API with staging backend 1 month ago
CLAUDE.md feat(phase-0): integrate admin clubs API with staging backend 1 month ago
NEXTJS15.md feat(phase-0): integrate admin clubs API with staging backend 1 month ago
OPTIMIZATION_AUDIT.md feat(phase-0): integrate admin clubs API with staging backend 1 month ago
PHASE_0_STATUS.md feat(phase-0): integrate admin clubs API with staging backend 1 month ago
PIPELINE_OPTIMIZATION.md feat(phase-0): integrate admin clubs API with staging backend 1 month ago
README.md feat(phase-0): integrate admin clubs API with staging backend 1 month ago
REFACTORING_EXAMPLE.md feat(phase-0): integrate admin clubs API with staging backend 1 month ago
SWAP_UI_IMPROVEMENTS.md feat(phase-0): integrate admin clubs API with staging backend 1 month ago
THEME.md feat(phase-0): integrate admin clubs API with staging backend 1 month ago
THEME_CUSTOMIZATION_GUIDE.md feat(phase-0): integrate admin clubs API with staging backend 1 month ago
WEBSOCKET_SETUP.md feat(phase-0): integrate admin clubs API with staging backend 1 month ago
docker-compose.dev.yml feat(phase-0): integrate admin clubs API with staging backend 1 month ago
docker-compose.yml feat(phase-0): integrate admin clubs API with staging backend 1 month ago
env.example feat(phase-0): integrate admin clubs API with staging backend 1 month ago
i18n-config.ts feat(phase-0): integrate admin clubs API with staging backend 1 month ago
index.html feat(phase-0): integrate admin clubs API with staging backend 1 month ago
next-env.d.ts feat(phase-0): integrate admin clubs API with staging backend 1 month ago
next-inspect.js feat(phase-0): integrate admin clubs API with staging backend 1 month ago
next.config.mjs feat(phase-0): integrate admin clubs API with staging backend 1 month ago
package-lock.json feat(landing+auth): add marketing landing page and admin auth guards 1 month ago
package.json feat(phase-0): integrate admin clubs API with staging backend 1 month ago
postcss.config.cjs feat(phase-0): integrate admin clubs API with staging backend 1 month ago
tailwind.config.cjs feat(phase-0): integrate admin clubs API with staging backend 1 month ago
tsconfig.app.json feat(phase-0): integrate admin clubs API with staging backend 1 month ago
tsconfig.json feat(phase-0): integrate admin clubs API with staging backend 1 month ago
tsconfig.node.json feat(phase-0): integrate admin clubs API with staging backend 1 month ago

README.md

Playchoo Manager - Venue Administration Portal

Domain: https://manager.playchoo.com Project Owner: Frontend Faye (Uma Canvas) Status: Phase 0 - Initial scaffolding complete

Overview

This is the venue administration frontend for Playchoo, enabling venue administrators to manage clubs, courts, schedules, and bookings. It is a separate Next.js application from the consumer-facing app.

Architecture

  • Framework: Next.js 15 with App Router
  • Language: TypeScript
  • Styling: Tailwind CSS 4
  • State Management: React Context API
  • Auth: SwissOID (via playchoo-auth backend)
  • API: Python Flask API (py-playchoo-api)
  • CI/CD: Drone CI
  • Container: Docker

Project Structure

playchoo-manager-nextjs/
├── src/
│   ├── app/[locale]/          # Next.js app router pages
│   │   ├── admin/             # Admin routes
│   │   │   └── clubs/         # Club management
│   │   ├── layout.tsx         # Root layout
│   │   └── page.tsx           # Admin home
│   ├── components/            # React components
│   ├── hooks/                 # Custom React hooks
│   ├── lib/                   # Utilities
│   └── types/                 # TypeScript types
├── docker/                    # Docker configuration
├── .drone.yml                 # CI/CD pipeline
└── docker-compose.yml         # Production deployment

Development

Prerequisites

  • Node.js 22+
  • Docker & Docker Compose
  • Access to py-playchoo-api backend

Environment Setup

Copy .env.local.example to .env and configure:

# Application
APPLICATION_DOMAIN_NAME=manager.playchoo.com
REVERSE_DOMAIN=playchoo-manager-nextjs
APP_PORT=8200

# Development APIs
NEXT_PUBLIC_PYTHON_API_URL=http://localhost:5000
NEXT_PUBLIC_AUTH_BACKEND_URL=http://localhost:3700
NEXT_PUBLIC_WEBSOCKET_URL=ws://localhost:5000
NEXT_PUBLIC_SWISSOID_TARGET_SERVICE_HANDLE=playchoo
NEXT_PUBLIC_APP_VERSION=0.1.0-dev

Run Locally

# Install dependencies and start dev server (port 8100)
npm run dev

# Or manually
npm install
npm run dev

Build

npm run build
npm start  # Runs on port 8200

Docker

# Build
docker build -f docker/Dockerfile -t playchoo-manager .

# Run with docker-compose
docker-compose up -d

Phase 0 Implementation Status

Completed

  • Project scaffolded from playchoo-nextjs template
  • Configuration updated for manager.playchoo.com
  • Ports changed: dev (8100), prod (8200)
  • Customer-facing pages removed
  • Admin landing page created
  • /admin/clubs route with access-aware messaging
  • Docker and CI/CD configs updated

Pending (Blocked by Backend)

  • Auth integration - Blocked by Access Avery
    • Needs: Auth middleware exposing admin context
    • Needs: club_admin association checks
  • Club listing - Blocked by Data Dana
    • Needs: GET /admin/clubs endpoint
    • Needs: GET /admin/clubs/{club_id} endpoint

Phase 1 Roadmap

  • Slot definition management UI
  • Create/edit forms for slot templates
  • Materialisation status feedback
  • Integration with Job Jonah's materialisation job

Dependencies & Blocking

See docs/owners/ in py-playchoo-api for coordination:

  • Frontend_Faye.md - My status updates
  • Data_Dana-blocking-Frontend_Faye.md - API contracts I need
  • Frontend_Faye-blocking-*.md - Items blocking others

Deployment

Deployed via Drone CI on push to master:

  1. Build Docker image with BuildKit caching
  2. Push to registry.sn48.zivili.ch/meow/playchoo-manager-nextjs
  3. Deploy to production server via drone-deploy

URLs

Notes

  • This project shares the same backend APIs as the consumer app
  • Auth is handled via SwissOID sessions (same as consumer app)
  • Admin permissions are checked at the API level
  • UI gracefully handles missing permissions with access-aware messaging