Karat
Karat est la plateforme SaaS qui permet aux commerçants de Mauritanie et du Sénégal de créer une boutique en ligne premium en quelques minutes. Essai gratuit de 3 jours.
Translation pending
Payment pages, a link-in-bio storefront and lead magnets for creators who sell ebooks, templates and other digital files in India.
CommerceTypeScript · PLpgSQLGitHub @Satya900OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full 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