Skip to content

Add D1 data scaffolding for developer projects - #31

Merged
JermSed merged 5 commits into
mainfrom
scaffold/d1-project-data
Oct 22, 2026
Merged

JermSed merged 5 commits into
mainfrom
scaffold/d1-project-data

Conversation

@JermSed

@JermSed JermSed commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

CTC Internal needs shared persistence for the URL shortener/QR generator and attendance tracker assignments. Bind the existing ctc-internal D1 database and provide basic authenticated reads and writes for links, events, and check-ins.

  • Add the three tables, indexes, migration commands, and production migration step.
  • Expose server helpers and GET/POST endpoints using the existing club session, validated inputs, parameterized SQL, and bounded pagination.
  • Document setup, endpoint payloads, and shared access. Preview deployments require a separate database binding.

Developers still implement short-code generation, redirects, QR generation, interfaces, and project-specific workflows.

Validation

  • pnpm check: formatting, lint, types, and all 96 tests pass.
  • pnpm build:cloudflare: passes with Next.js 16.4.2.
  • pnpm exec wrangler deploy --dry-run: passes.
  • pnpm test:worker: built Worker returns HTTP 200 for the homepage and 401 for unauthenticated API reads; now required in CI.
  • Local D1 migration applied successfully; integration tests exercise local D1.
  • git diff --check: passed.

Upgrade the Cloudflare OpenNext adapter to 1.20.13 for Next.js 16.4 preview-props manifest support. This fixes a runtime HTTP 500 that compilation and dry-run deployment did not catch.

Bind ctc-internal D1 and add migrations for links, events, and check-ins. Provide authenticated read/write endpoints and server helpers with validation, pagination, and integration tests.

Document setup and developer-owned project work; apply migrations during production deployment and keep preview databases isolated.
@JermSed
JermSed requested review from a team as code owners October 22, 2026 01:09
@github-actions
github-actions Bot temporarily deployed to pr-31 October 22, 2026 01:09 Destroyed
Update Next.js and its native flat ESLint configuration, remove the obsolete Next lint option, and adopt Next 16 TypeScript settings. Keep webpack builds for the OpenNext pipeline.
@github-actions
github-actions Bot temporarily deployed to pr-31 October 22, 2026 01:13 Destroyed
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Preview deployment

Open preview ↗

Last deployed 2026-10-22T01:32:40Z

Commit Workflow
e4176e2 Run #55 · attempt 1

Fallback preview

Upgrade the Cloudflare adapter to 1.20.13 to handle Next.js 16.4 preview-props.json at runtime. Start the built Worker in CI and check homepage rendering and authenticated API responses.
@github-actions
github-actions Bot temporarily deployed to pr-31 October 22, 2026 01:19 Destroyed
@github-actions
github-actions Bot temporarily deployed to pr-31 October 22, 2026 01:28 Destroyed
@github-actions
github-actions Bot temporarily deployed to pr-31 October 22, 2026 01:31 Destroyed
@JermSed
JermSed merged commit 44e9388 into main Oct 22, 2026
2 checks passed
@JermSed
JermSed deleted the scaffold/d1-project-data branch October 22, 2026 01:33
@linear-code

linear-code Bot commented Oct 22, 2026

Copy link
Copy Markdown

CTC-37

This branch was successfully deployed

No deployments
pr-31 — e4176e23 Deployed Oct 22, 2026 by github-actions[bot]
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