Karat
Karat는 모리타니와 세네갈 상인들이 몇 분 만에 프리미엄 온라인 상점을 만들 수 있는 SaaS 플랫폼이며 3일 무료 체험 제공
인도에서 전자책·템플릿·디지털 파일을 판매하는 크리에이터를 위한 결제 페이지·링크인바이오 스토어·리드 마그넷
Payment pages, a link-in-bio storefront and lead magnets for creators who sell ebooks, templates and other digital files in India.
커머스TypeScript · PLpgSQLGitHub @Satya900온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Creators sell digital files from a payment page. Buyers pay once with Razorpay and get lifetime access to their files by email. Anyone can sign up (email and password, verified) and starts on the Free plan (one page); the Creator plan (₹299/month with a ₹99 first month, or ₹2,999/year, via Razorpay Subscriptions) unlocks unlimited pages, coupons, analytics, Meta tracking, add-on offers and CSV export. Fees are all-inclusive (payment gateway covered): 6% per sale on Free, 4% on Creator, or a custom rate. Money lands in the platform's Razorpay account, an append-only ledger tracks what each creator is owed, and the admin pays creators manually.
Stack: Next.js 16 (App Router) · Supabase (Postgres, Auth, Storage) · Razorpay · Meta Pixel + Conversions API · Resend
/p/[slug] → POST /api/checkout creates order (amount from DB) + Razorpay order, CAPI InitiateCheckout
→ Razorpay Checkout popup
→ POST /api/checkout/verify verifies signature, fetches payment, records it if captured
→ /p/[slug]/success polls /api/orders/[id]/status, fires Pixel Purchase
Razorpay → POST /api/webhooks/razorpay source of truth: payment.captured / order.paid / refunds
cron → /api/cron/reconcile recovers missed webhooks, retries receipt + CAPI Purchase
The verify route, the webhook and the cron job all call the same Postgres function, mark_order_paid. It locks the order, checks the amount, writes the ledger rows keyed by payment ID, and creates the download grant. Running it any number of times gives the same result, and only one caller sees newly_paid = true, so the receipt and Purchase event go out once.
Everything is stored in paise (integers). ledger_entries is append-only: a trigger blocks updates and deletes.
| Event | Ledger entry |
|---|---|
| Sale | sale +amount |
| Razorpay fee (incl. GST) | gateway_fee −fee |
| Refund processed | refund −amount |
| Monthly plan (₹99) | subscription_fee −9900, one per creator per month |
| Admin pays creator | payout −amount (with UTR) |
| Correction | adjustment ±amount |
Creator balance = SUM(amount_paise), exposed through the creator_balances view.
cp .env.example .env.local
openssl rand -base64 32 # → ENCRYPTION_KEY
openssl rand -hex 32 # → CRON_SECRET
.env.local.supabase/migrations/ in order (0001 to 0011). Together they create the tables, Row Level Security policies, money functions, storage buckets, invites, coupons, analytics and per-page pixels.http://localhost:3000/auth/callback (plus your production URL) to the Redirect URLs./login, then make yourself the admin:
update profiles set is_admin = true where email = '[email protected]';
MAX_BYTES in files-manager.tsx.https://<your-domain>/api/webhooks/razorpay with a secret (RAZORPAY_WEBHOOK_SECRET). Enable these events:
payment.captured, payment.authorized, payment.failed, order.paid, refund.created, refund.processed, refund.failedcloudflared tunnel --url http://localhost:3000) and use that URL for the webhook.Add a verified domain in Resend and set RESEND_API_KEY and EMAIL_FROM. Without a key, emails are printed to the server console.
Each creator enters their Pixel ID under Dashboard → Settings (or per page). That alone turns on browser Pixel events. The CAPI access token is optional but recommended: with it the server sends the same events (deduplicated by event_id), and with a test event code the creator can click Send test event. Tokens are encrypted with AES-256-GCM and never reach the browser. Run migration 0017 so a page pixel can be saved without a token.
| Event | Browser (Pixel) | Server (CAPI) | Shared event_id |
|---|---|---|---|
| PageView, ViewContent | page load | /api/track | random per view |
| InitiateCheckout | after order created | /api/checkout | ic_<orderId> |
| Purchase | success page | webhook / verify | purchase_<orderId> |
Set NEXT_PUBLIC_META_PIXEL_ID to send our own ad events: PageView on marketing pages (ViewContent on pricing, features and compare), CompleteRegistration when a signup's email is verified, Subscribe on a Creator subscription's first charge and Purchase for Lifetime. Add META_CAPI_TOKEN to also send the conversions from the server (deduplicated by event_id, logged in meta_events). This pixel never loads on creators' public pages. META_TEST_EVENT_CODE is for checking events in Events Manager; remove it before running ads.
npm run dev
See DEPLOY.md for the full production checklist: GitHub, Vercel, domain, Supabase URLs, Razorpay live mode, the 15-minute recovery job and the launch smoke test.
/p/<slug>success@razorpay UPI → success page → download workswebhook_events with processed_at set; ledger has sale + gateway_feerefund.processed → ledger refund; a full refund disables downloadssupabase/migrations/0001_init.sql schema, RLS, money functions, storage
src/proxy.ts session refresh + /dashboard,/admin guard
src/lib/ env, supabase clients, razorpay, crypto, meta, email, fulfilment
src/app/p/[slug]/ public page, checkout form, success page
src/app/d/[token]/ buyer download page
src/app/api/ checkout, verify, webhooks, track, download, cron
src/app/dashboard/ creator: pages, orders, earnings, settings
src/app/admin/ creators, payouts, adjustments, refunds