Subscriptions
MatchNest includes a full 4-tier subscription system with per-feature usage limits.
Default Plans
| Plan | Price | Interests | Messages | Photos | Contact Views |
|---|---|---|---|---|---|
| Free | $0/forever | 5/month | 10/month | 3 | 2/month |
| Silver | $29.99/month | 30/month | 100/month | 10 | 15/month |
| Gold | $59.99/month | Unlimited | Unlimited | 25 | 50/month |
| Platinum | $99.99/month | Unlimited | Unlimited | 50 | Unlimited |
How Limits Work
Limits are enforced at the API level using the getSubscriptionLimits helper:
import { getSubscriptionLimits, incrementUsage } from "@/lib/subscription";
// In an API route:
const limits = await getSubscriptionLimits(userId);
if (limits.interestsSentThisMonth >= limits.maxInterests) {
return Response.json({ success: false, error: "Monthly limit reached" }, { status: 403 });
}
// After successful action:
await incrementUsage(userId, "interestsSent");Managing Plans
Plans are managed in the Admin Panel → Packages. You can:
- Create new plans with custom pricing and features
- Edit existing plan features and prices
- Delete plans (members already subscribed keep their plan)
- Toggle plans as featured/recommended
Payment Flow
The billing page (/billing) shows the current plan and available upgrades. To integrate a real payment gateway:
- Add payment gateway SDK (e.g.
npm install stripe) - Create a payment intent in
POST /api/payments - Handle the webhook to confirm payment and activate subscription
- Update
Subscription.statustoactive
Subscription Database Schema
model Subscription {
id String @id @default(cuid())
userId String @unique
packageId String
status String // active | expired | cancelled
startDate DateTime
endDate DateTime?
// Usage counters
interestsSent Int @default(0)
messagesCount Int @default(0)
contactViewsCount Int @default(0)
// Reset monthly
usageResetAt DateTime
}