Skip to content

added deploy:all - #1

Merged
Hum2a merged 7 commits into
masterfrom
building
Jun 28, 2026
Merged

added deploy:all#1
Hum2a merged 7 commits into
masterfrom
building

Conversation

@Hum2a

@Hum2a Hum2a commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary by cubic

Refactors the API and web app to support signed media, paginated sessions, and real-time updates, and adds a streamlined local dev setup. Includes OpenAPI docs, stronger middleware, and comprehensive tests.

  • New Features

    • Media: POST /media/upload with MIME/size validation, immutable hashed R2 keys, signed fetch URLs, byte-range reads; HMAC via MEDIA_SIGNING_SECRET.
    • Sessions: Modular Hono app with GET/POST/PATCH /sessions, cursor pagination, SessionRoom Durable Object broadcasts, and OpenAPI 3.1 spec.
    • Security: CSP, stricter CORS using APP_ORIGIN, rate limiting, and JSON body size limits.
    • DB/RLS: withPrincipal sets role oche_app and owner context; migration grants to enable SET ROLE.
    • Web: Lazy-loaded routes, PlayerAvatar, improved Overview/History/Detail, useLiveSession exposes connected, WS URL accepts ?key=..., Vite envDir at repo root.
    • Tooling: Local R2 binding, scripts/wrangler-dev.mjs, env/key helpers (env-setup, generate-keys, setup, with-env), doctor checks, and OpenAPI endpoint.
    • Tests: Unit tests for media, pagination, principal, sessions; Playwright e2e with @axe-core/playwright a11y checks and seeded global setup.
  • Migration

    • Run npm run setup to create .env and apps/api/.dev.vars from templates.
    • Set DATABASE_URL (Neon) and MEDIA_SIGNING_SECRET in .env; ensure APP_ORIGIN and VITE_API_BASE match local defaults.
    • Generate local API keys: npm run keys:generate (writes .oche-keys.json and syncs .dev.vars).
    • Apply DB changes: node scripts/run-steps.mjs db:migrate db:force-rls db:seed.
    • Start dev: npm run dev (wrangler API + web). For staging/prod, set Wrangler vars/secrets, R2 buckets, and Hyperdrive IDs.

Written for commit bacee56. Summary will update on new commits.

Review in cubic

Hum2a added 7 commits June 28, 2026 17:02
… development configuration

- Added new API routes for session management including creation, retrieval, and updates.
- Introduced WebSocket support for real-time updates in session rooms.
- Configured local development environment variables in `.env.example`.
- Updated package scripts for local API development.
- Added middleware for request validation and body size limits.
- Implemented pagination for session listing.
- Created utility functions for database connection and error handling.
- Added OpenAPI documentation for the new endpoints.
- Included tests for session routes and pagination functionality.
- Refactored existing code for improved structure and maintainability.
- Updated `.gitignore` to include new example files for local development.
- Added scripts for environment setup, key generation, and running npm scripts in sequence.
- Introduced `.oche-keys.json` for managing API keys and integrated it with local development variables.
- Enhanced `resolvePrincipal` function to support dynamic API key resolution from environment variables.
- Created tests for the new key resolution logic.
- Improved the doctor script to check for necessary environment files and provide setup instructions.
- Enhanced the doctor script to check for the presence of hyperdrive IDs in the wrangler.toml file.
- Added logic to indicate whether placeholders are set and provide instructions for replacement if necessary.
@Hum2a
Hum2a merged commit 1507071 into master Jun 28, 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