A real-time collaborative coding environment built for pair programming, technical interviews, and focused coding discussions — with live code sync, AI assistance, and more.
- ✨ Features
- 🛠 Tech Stack
- 📁 Project Structure
- 🚀 Getting Started
- 🌍 Deployment
- 🔧 Environment Variables
- 🤝 Contributing
- 📜 License
- Live Code Synchronization — Powered by Yjs and WebSockets for seamless, conflict-free real-time editing
- Monaco Editor — The same powerful editor that powers VS Code, with syntax highlighting, IntelliSense, and more
- Multi-language Support — JavaScript, TypeScript, Python, Java, C++, Go, HTML, CSS, and more
- Cursor & Selection Awareness — See collaborators' cursors and selections in real-time with distinct colors
- Integrated AI Chat — Get instant help with coding problems, explanations, and suggestions
- AI Session Bootstrapping — Start sessions with AI-generated problem statements and starter code
- Powered by Google Gemini — Leveraging cutting-edge AI for intelligent code generation
- Glassmorphism Design — Beautiful translucent panels with subtle blur effects
- Dark Mode First — Elegant dark theme with neon green accents optimized for long coding sessions
- Smooth Animations — Powered by Framer Motion for delightful micro-interactions
- Responsive Layout — Adaptive design that works on various screen sizes
- WebRTC Audio Calls — Voice communication with your pair programming partner
- Peer-to-Peer Connection — Low-latency audio powered by WebRTC
- Problem Panel — Display problem statements with difficulty levels
- Hints System — Progressive hints to guide candidates
- Complexity Analysis — Show expected time and space complexity
- Solution Reveal — Full solution available for review
| Technology | Purpose |
|---|---|
| React 19 | UI Framework with latest concurrent features |
| TypeScript | Type-safe development |
| Vite | Lightning-fast build tool and dev server |
| Tailwind CSS v4 | Utility-first styling |
| Monaco Editor | Professional code editing experience |
| Framer Motion | Fluid animations and transitions |
| Yjs + y-monaco | Real-time collaborative editing (CRDT) |
| React Router v7 | Client-side routing |
| Lucide Icons | Beautiful, consistent iconography |
| Technology | Purpose |
|---|---|
| Node.js | Runtime environment |
| Express | HTTP server and layered API routing |
| TypeScript | Type-safe server development |
| WebSocket (ws) | Real-time bidirectional communication |
| y-websocket | Yjs WebSocket provider |
| Google GenAI SDK | AI-powered content generation |
| OpenRouter SDK | Alternative AI model access |
The backend follows a production-ready layered architecture:
Request Flow:
Routes → Controllers → Services → Database/External APIs
Key Patterns:
- 🏗️ Modular Routing — Routes organized by domain (e.g.,
ai.routes.ts) - 🛡️ Global Error Handling — Centralized error handler with custom
AppErrorclass - 🔄 Async Safety —
asyncHandlermiddleware prevents unhandled promise rejections - ⚙️ Config Layer — All environment variables and computed config in one place
- 🎯 Clear Separation — Controllers handle HTTP, services contain business logic
session/
├── 📂 frontend/ # React application
│ ├── 📂 src/
│ │ ├── 📂 components/
│ │ │ ├── 📂 editor/ # Editor-related components
│ │ │ │ ├── AIChat.tsx # AI assistant chat panel
│ │ │ │ ├── CodeEditor.tsx # Monaco editor wrapper
│ │ │ │ ├── OutputPanel.tsx # Code execution output
│ │ │ │ ├── ProblemPanel.tsx# Interview problem display
│ │ │ │ └── TopBar.tsx # Editor toolbar
│ │ │ ├── 📂 landing/ # Landing page components
│ │ │ │ ├── Header.tsx
│ │ │ │ ├── Hero.tsx
│ │ │ │ ├── SessionInput.tsx
│ │ │ │ ├── Marquee.tsx
│ │ │ │ └── Footer.tsx
│ │ │ └── Editor.tsx # Main collaborative editor
│ │ ├── 📂 hooks/ # Custom React hooks
│ │ │ └── useAudioCall.ts # WebRTC audio functionality
│ │ ├── 📂 pages/ # Route pages
│ │ ├── App.tsx # Root component with routing
│ │ ├── main.tsx # Application entry point
│ │ └── index.css # Global styles & design tokens
│ ├── 📂 public/ # Static assets
│ ├── vite.config.ts # Vite configuration
│ ├── tailwind.config.js # Tailwind configuration
│ └── package.json
│
├── 📂 backend/ # Node.js server (Layered Architecture)
│ ├── 📂 src/
│ │ ├── 📂 config/ # Environment & configuration
│ │ │ └── env.ts # Centralized config with CORS
│ │ ├── 📂 controllers/ # HTTP request handlers
│ │ │ ├── session.controller.ts
│ │ │ └── aichat.controller.ts
│ │ ├── 📂 middleware/ # Express middleware
│ │ │ ├── errorHandler.ts # Global error handling
│ │ │ └── asyncHandler.ts # Async error safety
│ │ ├── 📂 routes/ # Modular API routes
│ │ │ └── ai.routes.ts # AI-related endpoints
│ │ ├── 📂 services/ # Business logic layer
│ │ │ ├── session.service.ts # AI session generation
│ │ │ ├── aichat.service.ts # AI chat logic
│ │ │ └── yjs.service.ts # Yjs document management
│ │ ├── 📂 utils/ # Helper utilities
│ │ │ └── languageMapper.ts # Language normalization
│ │ ├── 📂 websocket/ # WebSocket handlers
│ │ │ └── socketServer.ts # Yjs WebSocket server
│ │ ├── app.ts # Express app configuration
│ │ └── index.ts # Server entry point
│ ├── tsconfig.json
│ └── package.json
│
├── README.md # This file
├── LICENSE # MIT License
└── AGENTS.md # AI agent guidelines
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher recommended)
- npm or yarn package manager
- Git for version control
-
Clone the repository
git clone https://github.com/silky-x0/session.git cd session -
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd ../frontend npm install
You'll need to run both the backend and frontend servers.
cd backend
# Development mode with hot reload
npm run dev
# Or production mode
npm run build && npm startThe WebSocket server starts on http://localhost:1234 by default.
cd frontend
# Start development server
npm run devThe frontend runs on http://localhost:5173. Open this URL in your browser to access Session.
- Open
http://localhost:5173in your browser - Click "Start Session" to create a new room
- Share the URL with your pair programming partner
- Start coding together in real-time!
| Service | URL |
|---|---|
| Frontend (Vercel) | https://session-ecru.vercel.app/ |
| Backend (Render) | Configured via environment variables |
| Setting | Value |
|---|---|
| Root Directory | backend |
| Build Command | npm install |
| Start Command | npm start |
| Setting | Value |
|---|---|
| Root Directory | frontend |
| Build Command | npm install && npm run build |
| Start Command | npm run start (or serve the dist folder) |
Both the backend and frontend require environment variables to run. Example files are provided in the repository.
-
Copy the example file:
cd backend cp .env.example .env -
Configure your variables in
backend/.env:PORT="YOUR_PORT" FRONTEND_URL="YOUR_FRONTEND_URL" OPEN_ROUTER_KEY="YOUR_OPEN_ROUTER_API_KEY"
Variable Description Example PORTPort for the WebSocket/HTTP server 1234FRONTEND_URLFrontend URL for CORS configuration http://localhost:5173OPEN_ROUTER_KEYAPI key for OpenRouter AI services sk-or-v1-...
-
Copy the example file:
cd frontend cp .env.example .env -
Configure your variables in
frontend/.env:VITE_API_URL=http://localhost:1234 VITE_WS_URL=ws://localhost:1234
Variable Description Example VITE_API_URLBackend API URL for HTTP requests http://localhost:1234VITE_WS_URLWebSocket URL for real-time sync ws://localhost:1234
⚠️ Important:
- Never commit
.envfiles to version control (they're already in.gitignore)- For production deployments, replace localhost URLs with your deployed backend URLs
- Use
wss://instead ofws://for secure WebSocket connections in production
We love contributions! Session is an open-source project, and we welcome contributors of all skill levels. Here's how you can help:
- 🐛 Report Bugs — Found a bug? Open an issue
- 💡 Suggest Features — Have an idea? We'd love to hear it!
- 📖 Improve Documentation — Help us make the docs better
- 🔧 Submit Pull Requests — Fix bugs or implement new features
- 🧪 Write Tests — Help improve code coverage
-
Fork the repository
Click the "Fork" button at the top right of this page.
-
Clone your fork
git clone https://github.com/YOUR_USERNAME/session.git cd session -
Create a feature branch
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix -
Make your changes
- Write clean, readable code
- Follow the existing code style
- Add comments where necessary
- Update documentation if needed
-
Test your changes
# Frontend cd frontend npm run lint npm run build # Backend cd ../backend npm run build
-
Commit your changes
git add . git commit -m "feat: add amazing new feature"
We follow Conventional Commits:
feat:— New featuresfix:— Bug fixesdocs:— Documentation changesstyle:— Code style changes (formatting, etc.)refactor:— Code refactoringtest:— Adding or updating testschore:— Maintenance tasks
-
Push to your fork
git push origin feature/your-feature-name
-
Open a Pull Request
Go to the original repository and click "New Pull Request". Fill in the template with details about your changes.
- TypeScript — Use TypeScript for all new code
- Formatting — Code is formatted with default ESLint rules
- Naming — Use descriptive variable and function names
- Components — Keep React components focused and reusable
- Comments — Explain why, not what
Before submitting a PR, please ensure:
- Code compiles without errors (
npm run build) - Linting passes (
npm run lint) - Your changes work locally
- You've updated relevant documentation
- Commit messages follow conventional commits
- PR description explains the changes clearly
If you're new to open source or need guidance:
- Check out our open issues for tasks labeled
good first issue - Feel free to ask questions in your PR or issue
- Join discussions in the repository
This project is licensed under the MIT License — see the LICENSE file for details.
MIT License
Copyright (c) 2026 Session Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software...
Built with 💚 by the Session Contributors
Website • Report Bug • Request Feature
⭐ Star this repo if you find it helpful!