Turn your daily work into LinkedIn posts — fast, clean, and consistently on-brand.
- 🔐 Auth with Clerk (Google sign-in supported)
- 🧠 AI post generation via OpenAI
- 💳 Pro upgrade via Razorpay (UPI-focused checkout)
- 📅 Pro expiry: Pro is active for 30 days after payment, then auto-downgrades to Free
- 📊 Usage limits:
- Free: 5 generations/day
- Pro: 100 generations/day
- 🧾 History: every generated post is saved and reloadable
- ⚙️ Settings per user:
- Default goal:
job/growth/authority - Writing tone:
casual/professional/storytelling
- Default goal:
- 🎛️ Regenerate controls: shorter, more casual, more technical, storytelling
- 🔔 Live toasts while generating (human-friendly progress)
- Next.js (App Router) + TypeScript
- Tailwind CSS + shadcn/ui
- Clerk for authentication
- Supabase Postgres for persistence
- OpenAI for generation
- Node.js 20+
- pnpm
Install dependencies:
pnpm installCreate .env.local:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=
OPENAI_API_KEY=
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
# Razorpay (use test keys locally)
NEXT_PUBLIC_RAZORPAY_KEY_ID=
RAZORPAY_KEY_ID=
RAZORPAY_KEY_SECRET=Run the dev server:
pnpm devOpen http://localhost:3000.
This repo includes the schema in supabase/posts.sql.
Tables:
- posts
user_idcontenthashtagscreated_at
- user_settings
user_iddefault_goaltoneupdated_at
- user_usage
user_iddaily_usagelast_used_dateplan(free|pro)plan_expiry(date)updated_at
- user_subscriptions
user_idpayment_idrazorpay_order_idplan(free|pro)plan_status(inactive|active)plan_expiry(date)amount_paisecurrencycreated_atupdated_at
Functions:
check_and_increment_usage(user_id)(atomic daily limit + auto downgrade when expired)
POST /api/generate→ generate + save a postGET /api/posts→ fetch post historyGET /api/settings→ fetch settingsPATCH /api/settings→ update settingsGET /api/usage→ usage + plan status (remaining generations)POST /api/razorpay/create-order→ create Razorpay order for Pro (₹149)POST /api/razorpay/verify→ verify signature + activate Pro for 30 days
This app follows Razorpay’s Standard Checkout integration steps:
- Server:
POST /api/razorpay/create-ordercreates an Order via the Orders API (amount in paise,INR). - Client: loads
https://checkout.razorpay.com/v1/checkout.jsand opens Checkout withkey,order_id,amount,currency,prefill(name, email, contact). - Success: the
handlerreceivesrazorpay_payment_id,razorpay_order_id,razorpay_signature. - Server:
POST /api/razorpay/verifyverifies the signature withRAZORPAY_KEY_SECRET, then activates Pro.
Use Test mode API keys from the Razorpay Dashboard while developing; switch to Live keys for production. Enable automatic payment capture for orders in the Dashboard so payments move to captured.
- ✅ Secrets are kept in
.env.local(ignored by git). - 🧩 The dashboard is protected (
/dashboard) — signed out users are redirected home.
MIT