Skip to content

A real-time collaborative platform for code editing and rich text collaboration with live session sharing.

Notifications You must be signed in to change notification settings

sharathpc/shareboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ ShareBoard

React NestJS TypeScript Docker License

A real-time collaborative platform for code editing and rich text collaboration with live session sharing.

πŸ”— Live Demo:

✨ Features

  • πŸ”„ Real-time Collaboration - WebSocket-based live synchronization
  • πŸ“ Dual Editor Interface - Monaco Editor + Lexical rich text editor
  • 🎯 Session Management - Unique URLs with automatic clipboard copy
  • ⚑ Performance Optimized - Throttled updates for smooth experience
  • πŸŒ™ Dark/Light Mode - Comfortable coding in any environment
  • πŸ“ Resizable Interface - Customizable split-pane layout
  • 🐳 Docker Ready - One-command deployment
  • πŸ“± Responsive Design - Works on all devices

πŸ–₯️ Demo

ShareBoard features a clean, modern interface with:

  • πŸ“ Monaco Code Editor - Full-featured with syntax highlighting
  • ✍️ Lexical Text Editor - Modern rich text editing
  • πŸŽ›οΈ Language Selector - 50+ programming languages
  • πŸ”— Real-time Sync - Instant collaboration updates
  • πŸ“‹ Auto URL Copy - Easy session sharing

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   React Frontendβ”‚    β”‚  NestJS Backend β”‚    β”‚  PostgreSQL DB  β”‚
β”‚                 β”‚    β”‚                 β”‚    β”‚                 β”‚
β”‚ β€’ Monaco Editor │◄──►│ β€’ WebSocket API │◄──►│ β€’ Session Data  β”‚
β”‚ β€’ Lexical Editorβ”‚    β”‚ β€’ TypeORM       β”‚    β”‚ β€’ Real-time     β”‚
β”‚ β€’ Chakra UI     β”‚    β”‚ β€’ Throttling    β”‚    β”‚ β€’ Persistent    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Frontend

  • βš›οΈ React 18 with TypeScript
  • 🎨 Chakra UI - Modern component library
  • πŸ“ Monaco Editor - VS Code's editor engine
  • ✍️ Lexical - Facebook's rich text editor
  • πŸ”„ Redux Toolkit - State management
  • πŸ”Œ Socket.IO Client - Real-time communication

Backend

  • πŸͺΊ NestJS - Progressive Node.js framework
  • πŸ—ƒοΈ TypeORM - Database ORM
  • πŸ”Œ Socket.IO - WebSocket server
  • 🐘 PostgreSQL - Reliable database
  • ⚑ Lodash Throttle - Performance optimization

πŸš€ Quick Start

Prerequisites

  • Docker and Docker Compose
  • Node.js 16+ (for development)

1. Clone & Run

git clone https://github.com/yourusername/shareboard.git
cd shareboard
docker-compose up --build

2. Access the Application

3. Start Collaborating

  1. Visit http://localhost:4200
  2. A new session is created automatically
  3. URL is copied to your clipboard
  4. Share the link with collaborators
  5. Edit code and text in real-time! πŸŽ‰

πŸ“ Project Structure

shareboard/
β”œβ”€β”€ 🐳 docker-compose.yml          # Multi-container setup
β”œβ”€β”€ βš™οΈ services/                   # NestJS backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ πŸ”Œ app.gateway.ts     # WebSocket handlers
β”‚   β”‚   β”œβ”€β”€ 🧠 app.service.ts     # Business logic
β”‚   β”‚   β”œβ”€β”€ πŸ—ƒοΈ entities/          # Database models
β”‚   β”‚   └── πŸ“¦ dto/              # Data transfer objects
β”‚   └── package.json
└── 🎨 webapp/                    # React frontend
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ 🧩 components/        # React components
    β”‚   β”œβ”€β”€ πŸ”„ redux/            # State management
    β”‚   └── πŸš€ App.tsx           # Main application
    └── package.json

πŸ”§ Development

Frontend Development

cd webapp
npm install
npm run develop

Backend Development

cd services
npm install
npm run develop

πŸ”Œ API Endpoints

WebSocket Events

  • setData - Initialize session data
  • retriveData - Get existing session data
  • codeEditor/setValue - Update code content
  • textEditor/setValue - Update text content
  • language/setLanguage - Change programming language

Database Schema

@Entity()
export class Session {
    @PrimaryColumn()
    sessionId: string
    @Column()
    language: string;
    @Column()
    codeValue: string;
    @Column()
    textValue: string;
}

🐳 Docker Configuration

version: "3.8"
services:
  database:
    image: postgres:13
    environment:
      POSTGRES_USER: shareboard
      POSTGRES_PASSWORD: shareboard
      POSTGRES_DB: shareboard
    volumes:
      - pgdata:/var/lib/postgresql/data

  services:
    build: ./services
    environment: 
      DATABASE_URL: 'postgresql://shareboard:shareboard@database:5432/shareboard'
    ports: - 3000:3000
  
  webapp:
    build: ./webapp
    ports: - 4200:80

volumes:
  pgdata:

🎯 Key Features Explained

πŸ”„ Real-time Collaboration

  • WebSocket-based synchronization
  • Throttled updates (10s DB, 1s frontend)
  • Automatic session joining

πŸ“ Dual Editor Interface

  • Monaco Editor: Professional code editing with syntax highlighting
  • Lexical: Modern rich text editing with clean UI
  • Split Pane: Resizable layout for optimal workflow

⚑ Performance Optimizations

  • Database write throttling prevents overload
  • Frontend update throttling ensures smooth UX
  • Efficient Redux state management
  • Optimized WebSocket communication

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments


⭐ Star this repository if you found it helpful!


Built with ❀️ for the developer community

About

A real-time collaborative platform for code editing and rich text collaboration with live session sharing.

Topics

Resources

Stars

Watchers

Forks