Commit graph

4 commits

Author SHA1 Message Date
b5c399257f checkout: omit customerEmail when user has guest-style email
Stripe rejects emails like 'guest-1779719735974' with 400 email_invalid.
Falling back to no email lets Stripe collect it on the checkout page itself,
which is the standard flow for unauthenticated upgrades.
2026-05-25 18:36:12 +04:00
d3e3625375 Pass data-host-url to Umami script for cross-origin collect endpoint 2026-05-25 17:29:04 +04:00
22a172e92d Add Umami analytics, subscription tiers, tool-call metering
- Analytics: <Analytics /> in root layout loads umami when NEXT_PUBLIC_UMAMI_* env are set
- Subscription: free/pro tiers in Postgres, daily quotas (10msg/5tool free, 1000/500 pro)
- Chat route: checkAndConsume(chat_message) gate before streamText, 429 when exhausted
- Tool metering: getWeather wrapped with withLimit decorator that deducts tool_call quota
- Pricing page at /pricing with upgrade button
- /api/billing/checkout posts to EGBE payment gateway, /api/billing/webhook verifies HMAC and upgrades user on checkout.session.completed
- UsageBadge in chat header polls /api/usage every 15s
- Dropped now-unused entitlements.ts
2026-05-25 17:27:08 +04:00
3e21c2334c Initial commit: EGBE chatbot template
Stripped from vercel/chatbot (Apache 2.0):
- Dropped @vercel/* packages and AI Gateway
- Removed artifacts feature (code/text/sheet/image side panel)
- Switched AI provider to @ai-sdk/openai-compatible -> EGBE LiteLLM
- Replaced Vercel Blob upload with data URLs
- Dropped Redis resumable streams and rate limiter (in-memory now)
- Added Dockerfile (Next.js standalone) + entrypoint that runs migrations
- Wired DATABASE_URL, EGBE_AI_API_URL/KEY, NEXT_PUBLIC_BASE_URL for app-deploy.sh
2026-05-25 14:54:04 +04:00