A ManyChat-style platform: users connect their Instagram Business account, set up comment-to-DM automations with keyword matching, public replies, and follow-gating, and manage billing via Razorpay.
commently/
├── backend/ Node.js + Express + MongoDB API
└── frontend/ React + Vite + Tailwind CSS
cd backend
npm install
cp .env.example .env
# Fill in: MONGODB_URI, JWT secrets, GOOGLE_CLIENT_ID, META_APP_ID/SECRET, RAZORPAY keys
npm run devRuns on http://localhost:5000.
cd frontend
npm install
cp .env.example .env
# Fill in: VITE_GOOGLE_CLIENT_ID (same as backend's GOOGLE_CLIENT_ID)
npm run devRuns on http://localhost:5173.
Backend:
- Google OAuth login + JWT auth (access + refresh tokens, httpOnly cookies)
- Instagram Business Login OAuth flow (multi-tenant — each user connects their own IG account)
- Automation CRUD (keyword matching, public reply, follow-gate, DM message + button)
- Webhook engine — receives real Instagram comment events, matches automations, sends private replies
- Razorpay billing (order creation, payment verification, webhook handler)
- Plan limits (Free / Starter / Pro) centrally defined and enforced
- Security: encrypted token storage, rate limiting, Helmet, CORS
Frontend:
- Landing page, Google Sign-In login
- Dashboard with stats
- Instagram account connection flow
- Automations list (toggle live/paused, delete)
- Automation Builder — guided step-by-step flow with live phone preview (mirrors ManyChat's UX)
- Profile page
- Billing page with Razorpay Checkout integration
Extract this into your commently/ repo root and overwrite the matching paths.
All paths below are relative to frontend/.
src/context/ThemeContext.jsx— light/dark mode state, persisted in localStoragesrc/components/ThemeToggle.jsx— sun/moon toggle buttonsrc/pages/legal/LegalLayout.jsx— shared wrapper for legal pagessrc/pages/legal/Terms.jsxsrc/pages/legal/PrivacyPolicy.jsxsrc/pages/legal/RefundPolicy.jsxpublic/robots.txtpublic/sitemap.xml
tailwind.config.js— new trust-blue palette, CSS-variable-driven for light/darksrc/index.css— theme CSS variables (:root= dark,.light= light), fixed.btn-primary/.input-fieldindex.html— new fonts (Instrument Sans / Manrope / IBM Plex Mono), SEO meta tagssrc/App.jsx— wrapped withThemeProvider+HelmetProvider, added/terms/privacy/refund-policyroutessrc/components/Sidebar.jsx— responsive mobile drawer nav + theme togglesrc/components/AppLayout.jsx— responsive spacing for the mobile top barsrc/components/Skeletons.jsx— skeleton colors now read the live theme instead of being hardcodedsrc/pages/Landing.jsx— full rebuildsrc/pages/Analytics.jsx— only theTrendChartcomponent changed (chart colors now theme-aware)src/pages/Billing.jsx— only the Razorpay checkouttheme.colorline changed (now#2954ff)
cd frontend
npm install # picks up react-helmet-async (newly added)
npm run dev- Domain placeholders:
index.html,public/robots.txt, andpublic/sitemap.xmlall referencecommently.appas a placeholder domain. Update these once you've picked/hosted on a real domain. - Legal page emails: Terms/Privacy/Refund pages reference
support@commently.app,privacy@commently.app,billing@commently.app,sales@commently.app— swap these for real inboxes you'll actually monitor before launch. These pages are a solid first draft but haven't been reviewed by a lawyer — worth a quick pass before you're taking real payments from client accounts.
- Meta App setup — create/reuse your Meta Developer App, get
META_APP_ID/META_APP_SECRET, set the webhook callback URL tohttps://your-backend-domain.com/api/webhook/instagram - Google OAuth — create credentials at console.cloud.google.com, add your frontend domain to authorized origins
- Razorpay — get API keys from the Razorpay dashboard, set up webhook endpoint
- MongoDB Atlas — create a free cluster, whitelist your server's IP, get connection string
- Deploy — backend to Render/Railway, frontend to Vercel/Netlify
- Cron job — for refreshing Instagram long-lived tokens before they expire (60-day cycle)
- Monthly usage reset — a scheduled job to reset
dmsSentThisMonthto 0 each billing cycle - Public reply toggle in webhook — already wired in
webhookController.js, verify end-to-end
- No
node_modulesincluded — runnpm installin bothbackend/andfrontend/yourself - All secrets are placeholders in
.env.example— never commit real.envfiles