Skip to content

apps/server skeleton on oRPC with the waitlist procedure #12

Description

@hammadmajid

Part of #3

Question

Scaffold apps/server as a Worker on oRPC v2 with packages/contract, one waitlist procedure, and its own tests, and prove the stack runs on workerd.

  • The folder tree from the transport decision (Transport: Effect's HTTP layer alone, or oRPC in front #11), wired into Turborepo (dev, build, typecheck, lint, test, deploy).
  • packages/contract as @prismark/contract: oc procedures with Zod 4 schemas, route metadata, and error classes, shared through TypeScript project references.
  • Worker bindings read from import { env } from "cloudflare:workers" at module scope. No per request env threading, no container.
  • One procedure: waitlist.join with an email, stored in D1 as a waitlist entry, throwing ALREADY_ON_WAITLIST from the contract. This is the first real use of the contract.
  • The fetch export dispatching /auth, /rpc, /openapi.json, /reference, and 404; the OpenAPI spec generated from the contract with the Zod converter.
  • Unit tests for the service, integration tests inside Cloudflare's Vitest pool against real D1, meeting the map's speed bar.
  • Wrangler config with the compatibility date rule from ADR 0007.
  • If the stack works, record the transport decision (oRPC v2, no Effect, Zod, the contract package) as an ADR. If it does not, resolve with what broke and reopen the transport ticket.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions