Skip to content

Tier-3 - #6

Merged
Hum2a merged 17 commits into
tier-2from
tier-3
Jul 3, 2026
Merged

Tier-3#6
Hum2a merged 17 commits into
tier-2from
tier-3

Conversation

@Hum2a

@Hum2a Hum2a commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary by cubic

Adds polished page-load motion, media upload, and “how to play” guides on the web app, plus JWT auth with API keys, offline read-only caching, and a rate‑limited, cached API with structured logs for better UX, security, and reliability.

  • New Features

    • Motion system: AnimatedOutlet, TabStrip, and route-aware skeletons; respects reduced motion.
    • Media: UI upload with progress/cancel; sessions now support video/poster and player photos.
    • Game guides: single source content/game-guides.ts with GameGuideCard; tests included.
    • Field tooltips: enforced via TextField/SelectField/FileField with centralized copy.
    • Auth: /auth/token issues HS256 JWTs; API keys list/create UI at /settings/keys; AuthProvider + OwnerSwitcher.
    • PWA/offline: vite-plugin-pwa + React Query persistence for sessions; OfflineBanner.
    • Scorecard export: print-ready HTML; basic i18n via i18next; API docs hosted in /docs using Redoc.
  • Scale & Reliability

    • Rate limiting via RateLimiter Durable Object per IP (health/docs excluded).
    • KV caching for GET /sessions (60s TTL, Cache-Control: max-age=15, X-Cache headers).
    • Structured JSON logging with X-Trace-Id; deep readiness at GET /health?deep=1.
    • Tests for health, JWT, rate limiter, session cache; Vitest UI tests for Overview/History.
    • Upgrades: wrangler v4; new envs include OCHE_JWT_SECRET, RATE_LIMITER, and CACHE bindings.

Written for commit 670ca34. Summary will update on new commits.

Review in cubic

Hum2a and others added 17 commits July 3, 2026 13:06
- Added MediaUpload component for handling video and photo uploads with progress tracking and cancellation.
- Introduced SessionMediaSection for attaching media to sessions, including video and poster uploads.
- Enhanced CreateSession route to support optional player photo uploads during session creation.
- Updated SessionDetail to display video and media upload options.
- Improved media handling in the API, allowing for video URLs, posters, and player photos to be updated in sessions.
- Added support for new video MIME types and updated OpenAPI specifications accordingly.
- Implemented responsive image handling for session posters using PosterThumb component.
- Introduced a motion system with new utility classes for smooth transitions and animations.
- Updated various components (e.g., App, MediaUpload, SessionDetail) to utilize the new motion classes for improved user experience.
- Added AnimatedScore component for odometer-style score display using @number-flow/react.
- Implemented AnimatedOutlet and AnimatedPanel for route transitions with horizontal sliding effects.
- Enhanced accessibility by ensuring animations respect user preferences for reduced motion.
- Updated styling rules to maintain a cohesive visual identity with Tailwind and shadcn.
- Added new TabStrip component for improved navigation with sliding indicators.
- Introduced RouteSkeleton for better loading states that match destination layouts.
- Introduced a new `GameGuideCard` component to display game mode instructions in a collapsible format.
- Created a centralized `game-guides.ts` file as the single source of truth for game rules and instructions.
- Added a new `GAME-GUIDES.md` documentation file detailing how to play each game mode.
- Updated the `CreateSession`, `Overview`, and `SessionDetail` routes to incorporate the `GameGuideCard` for enhanced user experience.
- Implemented tests for the `resolveGameId` function to ensure accurate game mode detection from session titles.
- Enhanced documentation to guide future updates and maintain consistency across game instructions.
- Added support for JWT authentication, allowing users to exchange API keys for JWTs via the new `/auth/token` endpoint.
- Introduced API key management with routes for listing and creating API keys, enhancing security and user control.
- Updated the OpenAPI specification to reflect new authentication methods and security schemes.
- Enhanced the principal resolution logic to support JWTs and API keys, improving authorization handling across the application.
- Added tests to ensure proper functionality of the new authentication features and their integration with existing components.
…ures

- Introduced `RateLimiter` Durable Object for per-IP rate limiting, replacing in-memory token buckets.
- Added KV caching for session lists with a 15s TTL, including cache invalidation on session updates.
- Implemented structured JSON logging with `X-Trace-Id` for enhanced observability and error tracking.
- Updated health check endpoint to support deep readiness checks with database connectivity verification.
- Enhanced API routes and middleware to integrate new features, ensuring compliance with updated specifications.
- Added tests for health checks, rate limiting, and session caching functionalities to ensure reliability.
…ken setup

- Clarified the process for creating KV namespaces, specifying that commands should be run from the `apps/api` directory.
- Added instructions for copying KV namespace IDs into `wrangler.toml` for staging and production environments.
- Included guidance for local development without Cloudflare KV and troubleshooting authentication errors related to the Cloudflare API token.
- Added unit tests for the History and Overview components using Vitest and Testing Library, improving test coverage and reliability.
- Introduced contract tests to ensure OpenAPI paths align with expected schemas, enhancing API stability.
- Implemented visual regression tests with Playwright to capture UI changes and maintain visual consistency.
- Updated README and ROADMAP to reflect new testing capabilities and deployment instructions, including a full staging pipeline command.
- Upgraded Wrangler to version 4 across the project for improved development experience.
- Updated session list caching to use a 60s TTL in Cloudflare KV with a 15s HTTP max-age for responses, improving cache efficiency.
- Introduced a new utility function `isSessionId` for validating session IDs against a UUID format.
- Enhanced session retrieval routes to validate session IDs before processing requests, ensuring better error handling.
- Refactored cache-related functions to handle errors gracefully, maintaining API reliability.
- Updated documentation to reflect changes in caching strategy and session ID validation.
- Integrated PWA capabilities using vite-plugin-pwa, enabling offline access and caching for session data.
- Added i18n support with react-i18next, providing English translations for navigation and session details.
- Implemented a scorecard export feature, allowing users to generate print-ready scorecards for sessions.
- Introduced an OfflineBanner component to notify users when offline, enhancing user experience.
- Updated package dependencies to include necessary libraries for analytics and query persistence.
- Enhanced documentation to reflect new features and usage instructions.
… updates

- Updated the `FileField` component to include a visible button for file selection, improving user experience.
- Implemented state management to display the selected file name, enhancing feedback for users.
- Modified tooltip descriptions in the documentation to clarify the new file input pattern and usage guidelines.
- Ensured accessibility by maintaining proper aria attributes and labels for the file input.
@Hum2a
Hum2a merged commit a7f441e into tier-2 Jul 3, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant