- schema: stripe_subscription_id, plan_status, plan_expires_at on users
- lib/plans.ts: Free (2 GB · 7d · 1 dl) vs Pro (20 GB · 90d · 100 dl)
- http/billing.ts: POST /api/billing/{checkout,portal}
- http/webhook.ts: verified Stripe webhook → syncs plan lifecycle
- http/transfers.ts: enforces per-user plan limits instead of hardcoded caps
- http/me.ts: exposes plan + status + planExpiresAt to the client
Ops prerequisite: STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET,
STRIPE_PRICE_MONTHLY, STRIPE_PRICE_YEARLY env vars in anydrop-app-secrets.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
39 lines
990 B
JSON
39 lines
990 B
JSON
{
|
|
"name": "@anydrop/server",
|
|
"version": "1.0.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"main": "./dist/index.js",
|
|
"scripts": {
|
|
"dev": "tsx watch src/index.ts",
|
|
"build": "tsc",
|
|
"start": "node dist/index.js",
|
|
"typecheck": "tsc --noEmit",
|
|
"db:generate": "drizzle-kit generate",
|
|
"db:migrate": "tsx src/db/migrate.ts",
|
|
"db:studio": "drizzle-kit studio"
|
|
},
|
|
"dependencies": {
|
|
"@anydrop/shared": "workspace:*",
|
|
"@aws-sdk/client-s3": "^3.1032.0",
|
|
"@aws-sdk/s3-request-presigner": "^3.1032.0",
|
|
"@hono/node-server": "^1.13.7",
|
|
"drizzle-orm": "^0.45.2",
|
|
"hono": "^4.6.14",
|
|
"nanoid": "^5.1.5",
|
|
"nodemailer": "^6.9.16",
|
|
"postgres": "^3.4.5",
|
|
"stripe": "^22.0.2",
|
|
"web-push": "^3.6.7",
|
|
"ws": "^8.18.1"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^22.15.3",
|
|
"@types/nodemailer": "^6.4.17",
|
|
"@types/web-push": "^3.6.4",
|
|
"@types/ws": "^8.18.1",
|
|
"drizzle-kit": "^0.31.10",
|
|
"tsx": "^4.19.4"
|
|
}
|
|
}
|