Skip to content

feat(monetization): add DodoPayments webhook, subscription helpers, pricing checkout links, and Pro tier feature gates - #129

Merged
Rayan9064 merged 1 commit into
mainfrom
feat/dodopayments-monetization
Jul 29, 2026
Merged

feat(monetization): add DodoPayments webhook, subscription helpers, pricing checkout links, and Pro tier feature gates#129
Rayan9064 merged 1 commit into
mainfrom
feat/dodopayments-monetization

Conversation

@Rayan9064

@Rayan9064 Rayan9064 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added subscription-aware usage limits for resources and AI queries.
    • Free-tier users are prompted to upgrade when limits are reached.
    • Added DodoPayments checkout flows for Pro and API plans.
    • Added payment webhook handling to update subscription status and plans.
  • Documentation

    • Documented tier-limit errors, payment webhooks, subscription data, and monthly AI usage tracking.

…ricing checkout links, and Pro tier feature gates
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dumpit Ready Ready Preview, Comment Jul 29, 2026 12:38pm

@Rayan9064
Rayan9064 merged commit 7a6a955 into main Jul 29, 2026
3 checks passed
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1f9875f1-8322-480a-9fef-b41bda6a8651

📥 Commits

Reviewing files that changed from the base of the PR and between 9451fca and 527be31.

📒 Files selected for processing (8)
  • app/api/_utils/subscription.ts
  • app/api/ai/ask/route.ts
  • app/api/resources/pdf/route.ts
  • app/api/resources/route.ts
  • app/api/webhooks/dodopayments/route.ts
  • app/components/landing/Pricing.tsx
  • docs/api-spec.md
  • docs/data-model.md

📝 Walkthrough

Walkthrough

Adds DodoPayments webhook synchronization, subscription-aware resource and AI quotas, monthly usage tracking, updated pricing checkout links, and documentation for the new subscription data and API responses.

Changes

Subscription billing and quota enforcement

Layer / File(s) Summary
Tier quota enforcement
app/api/_utils/subscription.ts, app/api/ai/ask/route.ts, app/api/resources/..., docs/api-spec.md, docs/data-model.md
Subscription helpers determine tiers and statuses, enforce 50-resource and monthly AI query limits, record usage, and document the resulting responses and Firestore structures.
Payment webhook synchronization
app/api/webhooks/dodopayments/route.ts, docs/api-spec.md, docs/data-model.md
The DodoPayments webhook verifies signatures, resolves users, updates subscription fields, records events, and documents the endpoint and subscription collections.
DodoPayments checkout links
app/components/landing/Pricing.tsx
Pricing CTAs generate DodoPayments links for Pro and API plans, including optional authenticated-user metadata, while Starter retains its configured link.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested labels: enhancement

Sequence Diagram(s)

sequenceDiagram
  participant DodoPayments
  participant WebhookRoute
  participant Firestore
  DodoPayments->>WebhookRoute: Send signed subscription event
  WebhookRoute->>WebhookRoute: Verify and parse event
  WebhookRoute->>Firestore: Update user subscription
  WebhookRoute->>Firestore: Record subscription event
  Firestore-->>WebhookRoute: Confirm writes
  WebhookRoute-->>DodoPayments: Return JSON response
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dodopayments-monetization

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

app/api/_utils/subscription.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

app/api/ai/ask/route.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

app/api/resources/pdf/route.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

  • 3 others

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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