-
Notifications
You must be signed in to change notification settings - Fork 1
fix missing client id #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds a server API to generate a Prisma OAuth authorization URL, moves client-side URL construction to that API, updates claim button behavior, adds env var bindings in wrangler.jsonc, and replaces README with a concise Next.js/OpenNext product overview. Changes
Sequence Diagram(s)sequenceDiagram
participant Browser
participant AppServer as Next.js API (/api/auth/url)
participant PrismaAuth as auth.prisma.io
Note over Browser,AppServer #eeeeff: User-initiated claim flow
Browser->>AppServer: POST /api/auth/url { redirectUri }
AppServer-->>AppServer: read CLIENT_ID, generate state, build authUrl
AppServer-->>Browser: 200 { authUrl }
Browser->>PrismaAuth: GET authUrl (redirect user to Prisma OAuth)
Note over PrismaAuth: OAuth consent/authorize
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Deploying with
|
Status | Name | Latest Commit | Preview URL | Updated (UTC) |
---|---|---|---|---|
✅ Deployment successful! View logs |
claim-db-worker | 66620cd | Commit Preview URL Branch Preview URL |
Sep 03 2025, 10:29 PM |
✅ Preview CLIs & Workers are live! Test the CLIs locally under tag npx create-db@pr52
npx create-pg@pr52
npx create-postgres@$pr52 Worker URLs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
claim-db-worker/README.md (1)
2-12
: Add minimal operational docs (Quickstart, Deploy, Config, Security)Append a “Getting Started” section in claim-db-worker/README.md:
+## Getting Started + +Prerequisites: Node.js ≥ 18, pnpm, Prisma CLI ^6.14.0, Cloudflare account. + +Clone and install dependencies: + +```bash +cd claim-db-worker +pnpm install +``` + +Generate Prisma client: + +```bash +pnpm prisma generate +``` + +Start dev server: + +```bash +pnpm dev +``` + +Create a `.env` file (see cloudflare-env.d.ts): + +```env +DATABASE_URL="postgresql://…" +NEXTAUTH_SECRET="…" +# Cloudflare vars: +CF_ACCOUNT_ID="…" +CF_API_TOKEN="…" +``` + +## Deployment + +Build and deploy to Cloudflare Workers: + +```bash +pnpm build +npx open-next build +npx wrangler deploy --config wrangler.jsonc +``` + +## Configuration + +- OpenNext config: `open-next.config.ts` +- Wrangler config: `wrangler.jsonc` +- No local Prisma schema—schemas are defined at runtime by users + +## Security + +- Store all secrets in Cloudflare environment variables +- Enforce auth scopes for “claim” operations + +## License +MIT
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
claim-db-worker/README.md
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
claim-db-worker/README.md
[grammar] ~1-~1: Use correct spacing
Context: # Claim DB A Next.js app for claiming and managing ...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~3-~3: Use correct spacing
Context: ...oyed on Cloudflare Workers via OpenNext. ## Features - Claim Prisma databases with ...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~5-~5: Use correct spacing
Context: ...flare Workers via OpenNext. ## Features - Claim Prisma databases with one click - ...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~7-~7: There might be a mistake here.
Context: ... - Claim Prisma databases with one click - Monaco-based Prisma schema editor - Depl...
(QB_NEW_EN_OTHER)
[grammar] ~8-~8: There might be a mistake here.
Context: ...lick - Monaco-based Prisma schema editor - Deployed globally on Cloudflare's edge n...
(QB_NEW_EN_OTHER)
[grammar] ~9-~9: There might be a mistake here.
Context: ...ed globally on Cloudflare's edge network - Prisma Studio embed - Built with Next.js...
(QB_NEW_EN_OTHER)
[grammar] ~10-~10: There might be a mistake here.
Context: ...are's edge network - Prisma Studio embed - Built with Next.js and React
(QB_NEW_EN_OTHER)
[grammar] ~11-~11: There might be a mistake here.
Context: ...dio embed - Built with Next.js and React
(QB_NEW_EN_OTHER)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Workers Builds: create-db-worker
- GitHub Check: Workers Builds: claim-db-worker
🔇 Additional comments (1)
claim-db-worker/README.md (1)
1-1
: README placement and naming are valid
The claim-db-worker folder houses the Next.js app bundled via OpenNext into a Cloudflare Worker, so its README correctly lives at the package root—no renaming or moving required.
✅ Preview CLIs & Workers are live! Test the CLIs locally under tag npx create-db@pr52
npx create-pg@pr52
npx create-postgres@$pr52 Worker URLs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
claim-db-worker/wrangler.jsonc
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Workers Builds: claim-db-worker
- GitHub Check: Workers Builds: create-db-worker
✅ Preview CLIs & Workers are live! Test the CLIs locally under tag npx create-db@pr52
npx create-pg@pr52
npx create-postgres@$pr52 Worker URLs
|
✅ Preview CLIs & Workers are live! Test the CLIs locally under tag npx create-db@pr52
npx create-pg@pr52
npx create-postgres@$pr52 Worker URLs
|
✅ Preview CLIs & Workers are live! Test the CLIs locally under tag npx create-db@pr52
npx create-pg@pr52
npx create-postgres@$pr52 Worker URLs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
claim-db-worker/app/api/auth/url/route.ts
(1 hunks)claim-db-worker/app/claim/page.tsx
(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
claim-db-worker/app/claim/page.tsx (1)
create-db-worker/src/index.ts (1)
fetch
(15-160)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Workers Builds: claim-db-worker
- GitHub Check: Workers Builds: create-db-worker
🔇 Additional comments (3)
claim-db-worker/app/api/auth/url/route.ts (1)
6-13
: Verify CLIENT_ID binding in your Cloudflare Worker runtime
Ensure the CLIENT_ID environment variable is declared as a binding in your wrangler.toml (or via the Cloudflare dashboard) and is accessible in the Edge runtime where this Next.js route executes.claim-db-worker/app/claim/page.tsx (2)
60-60
: LGTM: disable while loading.Disabling the button during the request prevents duplicate submissions.
70-70
: LGTM: static label is fine.Clear, consistent CTA.
Summary by CodeRabbit
Documentation
Configuration
Bug Fixes / UX