Codexa is an interactive code editor + snippet library built with Next.js, Clerk auth, and a Convex backend.
- In-browser code editor (Monaco) with themes, language switching, and per-language local persistence
- Code execution via the Piston API (
https://emkc.org/api/v2/piston/execute) - Share snippets to a public library
- Snippet details with read-only viewer, copy button, and comments
- Stars for snippets + a profile page with stats and execution history
- Pro gating (non-JavaScript languages require Pro; upgraded via Lemon Squeezy webhook)
- Next.js (App Router) + React
- Tailwind CSS + Framer Motion
- Clerk for authentication
- Convex for database + server functions
- Zustand for client state
npm installCopy .env.example to .env.local and fill in values:
copy .env.example .env.localRequired variables
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYCLERK_SECRET_KEYCLERK_WEBHOOK_SECRETCONVEX_DEPLOYMENTNEXT_PUBLIC_CONVEX_URLLEMON_SQUEEZY_WEBHOOK_SECRET
Note: any NEXT_PUBLIC_* env var is exposed to the browser.
In one terminal:
npx convex devIn another terminal:
npm run devOpen http://localhost:3000.
Convex HTTP routes are defined in convex/http.ts:
- Clerk webhook:
/clerk-webhook- Used to sync newly created Clerk users into the Convex
userstable. - Requires
CLERK_WEBHOOK_SECRET.
- Used to sync newly created Clerk users into the Convex
- Lemon Squeezy webhook:
/lemon-squeezy-webhook- Used to upgrade users to Pro on
order_created. - Requires
LEMON_SQUEEZY_WEBHOOK_SECRET.
- Used to upgrade users to Pro on
npm run dev: start Next.js dev servernpm run build: build for productionnpm run start: start production servernpm run lint: run ESLint