Skip to content

Tier-5 - #4

Merged
Hum2a merged 10 commits into
tier-4from
tier-5
Jul 3, 2026
Merged

Tier-5#4
Hum2a merged 10 commits into
tier-4from
tier-5

Conversation

@Hum2a

@Hum2a Hum2a commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary by cubic

Tier 5 scale upgrades plus Tier 6/7 polish: adds a DO-backed rate limiter, KV-cached session lists, structured logs with trace IDs, deep health checks, and ships PWA offline read-only, i18n, scorecard export, and static API docs.

  • New Features

    • API scale: per‑IP RateLimiter Durable Object; CACHE KV for GET /sessions (KV 60s, HTTP max-age=15, X-Cache), structured JSON logs with X-Trace-Id and 500 bodies including traceId, deep readiness at GET /health?deep=1 (503 on DB down).
    • API docs: live GET /openapi.json and static Redoc at /docs from apps/web/public/openapi.json (exported via npm run export:openapi).
    • Web offline: PWA via vite-plugin-pwa with Workbox NetworkFirst for /sessions*; React Query persistence for sessions/session; OfflineBanner; queries offlineFirst, mutations online.
    • UX extras: print‑ready scorecard export on Session Detail; i18next with en strings; FileField uses hidden input + visible “Choose file” button; optional analytics via VITE_PLAUSIBLE_DOMAIN or VITE_CF_WEB_ANALYTICS_TOKEN.
    • Quality & DX: Vitest RTL component tests, OpenAPI contract tests, Playwright visual tests; npm run deploy:staging:full; upgraded wrangler to v4; improved README.
  • Migration

    • Create and bind KV namespaces for CACHE (run from apps/api: wrangler kv namespace create ...) and deploy DO migration for RateLimiter; IDs are configured in wrangler.toml.
    • Deploy with npm run deploy:staging:full (migrate → force‑rls → rls check → seed → deploy).
    • Optionally set VITE_PLAUSIBLE_DOMAIN or VITE_CF_WEB_ANALYTICS_TOKEN for analytics; no changes needed for local dev.

Written for commit 3a9f531. Summary will update on new commits.

Review in cubic

Hum2a and others added 10 commits July 3, 2026 13:31
…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 85c2198 into tier-4 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