CodeXt is a real-time collaborative code sharing platform for quick snippets, interviews, debugging sessions, and live demos.
It is built as a Turborepo monorepo with a Next.js frontend, an Express backend, a dedicated WebSocket server, and Prisma + PostgreSQL for persistence.
- Real-Time Sync: Collaborate live with instant updates for code content and editor preferences (language, theme, and font settings) across connected users.
- Powerful Editor Experience: CodeXt is powered by Monaco Editor, delivering VS Code-like editing with syntax highlighting, smart editing behavior, and a developer-friendly workflow.
- Language + Theme Flexibility: Write code in 42+ languages and personalize your environment with 40+ editor themes to match your workflow and visual preference.
- 24-Hour Ephemeral Rooms: Snippets are designed for fast collaboration and automatically expire after 24 hours, making them ideal for temporary sessions.
- Instant Start, No Friction: Start coding immediately without login for quick sharing and collaboration when speed matters.
- User Dashboard for Management: Authenticated users get a dashboard to organize, revisit, and manage their saved snippets in one place.
- Turborepo
- pnpm workspaces
- TypeScript
- ESLint + Prettier
- Next.js 16 (App Router)
- React 19
- Tailwind CSS 4
- Monaco Editor (
@monaco-editor/react) - TanStack Query
- Redux Toolkit
- React Hook Form + Zod
- Shadcn/Radix UI based components
- Express 5
- Better Auth
- Zod validation
- CORS + dotenv
wsWebSocket server- JWT-based room connection token flow
- Real-time code and editor settings broadcast
- Prisma ORM
- PostgreSQL (
pg) - Shared DB package across backend + websocket
codext/
|- apps/
| |- frontend/ # Next.js UI, Monaco editor, dashboard
| |- backend/ # REST API and auth endpoints
| |- websocket/ # Real-time collaboration server
|- packages/
| |- database/ # Prisma schema + shared DB client
| |- eslint-config/
| |- typescript-config/
| |- ui/
|- turbo.json
|- pnpm-workspace.yaml- A room/snippet is created from the frontend.
- Backend stores room metadata with a 24-hour expiry and initial snippet.
- Clients connect to the WebSocket server using a JWT room token.
- Code edits and editor setting updates are broadcast in real time.
- Changes are persisted in PostgreSQL through Prisma.
- Signed-in users can manage rooms/snippets from the dashboard.
WS_JWT_SECRET=""
DATABASE_URL=""
NEXT_PUBLIC_BACKEND_URL="http://localhost:3001/"DATABASE_URL=""
PORT="3001"
BETTER_AUTH_SECRET=""
BETTER_AUTH_URL="http://localhost:3001"PORT="8080"
WS_JWT_SECRET=""
DATABASE_URL=""pnpm installCopy each .env.example to .env:
apps/frontend/.env.example -> apps/frontend/.envapps/backend/.env.example -> apps/backend/.envapps/websocket/.env.example -> apps/websocket/.env
pnpm devExpected local ports:
- Frontend:
http://localhost:3000 - Backend:
http://localhost:3001 - WebSocket:
ws://localhost:8080
From repo root:
pnpm dev- run all workspaces in dev mode via Turbopnpm build- build all workspacespnpm start- start production processespnpm lint- lint all workspacespnpm check-types- run type checks
Backend routes are mounted at /v1:
/v1/room- room creation, detail fetching, room listing, deletion/v1/editor- editor default language/settings updates/api/auth/*- Better Auth endpoints
- Live interview coding rounds
- Pair programming sessions
- Debugging support snippets
- Quick shareable prototypes
- Temporary collaborative code rooms
ISC



