Skip to content

πŸ“ Real-time collaborative document editor (Google Docs clone) built with Next.js 14, featuring live editing, cursors, comments, and rich text formatting

Notifications You must be signed in to change notification settings

chayan-1906/DocMingle-Next.js

Repository files navigation

πŸ“ DocMingle - Real-Time Collaborative Document Editor

Next.js TypeScript Liveblocks Clerk Tailwind CSS

Real-time collaborative document editor (Google Docs clone) built with Next.js, featuring live editing, cursors, comments, and rich text formatting.

logo

✨ Features

  • πŸ“ Rich Text Editor - Lexical editor with advanced formatting 🎨
  • 🀝 Real-Time Collaboration - Multiple users editing simultaneously ⚑
  • πŸ‘₯ Live Cursors - See other users' cursors in real-time πŸ‘€
  • πŸ’¬ Commenting System - Add and reply to comments πŸ’­
  • πŸ” Authentication - Secure Clerk authentication πŸ›‘οΈ
  • πŸ“± Responsive Design - Works on all devices πŸ“Ί
  • 🎨 Modern UI - Clean Tailwind CSS design ✨
  • ⚑ Performance - Optimized for speed πŸš€
  • πŸ›‘οΈ Type Safety - Full TypeScript support 🎯

πŸ“± Screenshots

Login Page Dashboard Document Editor Document Editor

πŸ—οΈ Tech Stack

πŸ–₯️ Frontend

  • βš›οΈ Next.js 14.2.5 - React framework πŸš€
  • πŸ“˜ TypeScript - Type safety πŸ›‘οΈ
  • 🎨 Tailwind CSS 3.4.1 - Styling ✨
  • πŸ“ Lexical 0.16.1 - Rich text editor πŸ“–

πŸ”„ Real-Time Features

  • πŸ”— Liveblocks 2.5.0 - Real-time collaboration 🀝
  • βš›οΈ Liveblocks React 2.5.0 - React integration πŸ”§
  • πŸ“ Liveblocks Lexical 2.5.0 - Lexical editor integration πŸ“š

πŸ” Authentication & UI

  • πŸ”’ Clerk 5.3.0 - User authentication πŸ‘€
  • 🎯 Radix UI - Accessible components β™Ώ
  • 🎨 Heroicons - Icon library 🌟

πŸ› οΈ Utilities

  • 🎯 clsx - Conditional classes πŸ“‹
  • πŸ†” nanoid - ID generation πŸ”’
  • πŸ“ jsm-editor - Editor utilities πŸ› οΈ

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ 🟒
  • Clerk account πŸ”
  • Liveblocks account πŸ”—

Installation

  1. Clone repository πŸ“₯

    git clone https://github.com/chayan-1906/DocMingle-Next.js.git
    cd DocMingle-Next.js
  2. Install dependencies πŸ“¦

    npm install
  3. Environment setup βš™οΈ

    cp .env.example .env
  4. Configure environment πŸ”§

    NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
    CLERK_SECRET_KEY=your_clerk_secret_key
    NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
    NEXT_PUBLIC_CLERK_SIGN_OUT_URL=/sign-up
    LIVEBLOCKS_SECRET_KEY=your_liveblocks_secret_key
    NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY=your_liveblocks_public_key
  5. Start development server πŸš€

    npm run dev

πŸ—οΈ Project Structure

src/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (auth)/           # Authentication pages
β”‚   β”œβ”€β”€ (root)/           # Main application
β”‚   β”œβ”€β”€ api/              # API routes
β”‚   └── globals.css       # Global styles
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ editor/           # Editor components
β”‚   β”‚   └── plugins/      # Editor plugins
β”‚   β”œβ”€β”€ ui/               # UI components
β”‚   └── *.jsx             # Feature components
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ actions/          # Server actions
β”‚   └── utils.js          # Utility functions
β”œβ”€β”€ globals/              # Global constants
└── styles/               # Theme styles

πŸ”§ Core Components

πŸ“ Editor

  • Lexical Editor - Rich text editing ✍️
  • Toolbar Plugin - Formatting controls πŸ› οΈ
  • Floating Toolbar - Context-sensitive tools 🎯
  • Theme Configuration - Custom styling 🎨

🀝 Collaboration

  • Liveblocks Room - Real-time sync ⚑
  • Active Collaborators - User presence πŸ‘₯
  • Live Cursors - Real-time cursors πŸ–±οΈ
  • Comments - Threaded discussions πŸ’¬

πŸ” Authentication

  • Clerk Integration - User management πŸ‘€
  • Protected Routes - Secure access πŸ›‘οΈ
  • User Profiles - Avatar and info πŸ§‘β€πŸ’»

πŸ”— API Routes

Method Endpoint Description
POST /api/liveblocks-auth Liveblocks authentication

πŸ“Š Features Breakdown

πŸ“ Document Management

  • πŸ“„ Create new documents
  • πŸ‘οΈ View all documents
  • πŸ“‹ Document metadata
  • ⏰ Creation timestamps

🀝 Real-Time Collaboration

  • πŸ‘₯ Multiple users editing
  • 🎯 Live cursor tracking
  • 🟒 Presence indicators
  • πŸ”„ Conflict resolution

✍️ Rich Text Editing

  • Bold, italic, underline ✏️
  • πŸ“ Headings (H1, H2, H3)
  • πŸ“ Text alignment
  • πŸ“„ Paragraph formatting

πŸ’¬ Comments System

  • βž• Add comments
  • πŸ’­ Reply to comments
  • 🧡 Comment threading
  • ⚑ Real-time updates

πŸ”’ Authentication Flow

  1. User Sign-In - Clerk authentication
  2. Session Management - Secure sessions
  3. Room Access - Liveblocks authorization
  4. Real-Time Auth - Live collaboration

🎨 Styling

🎯 Tailwind Configuration

  • 🌈 Custom colors
  • πŸ“ Typography scale
  • πŸ“± Responsive breakpoints
  • ✨ Animation utilities

🎭 Theme Support

  • β˜€οΈ Light theme
  • πŸŒ™ Dark theme
  • πŸ“ Editor themes
  • 🎨 Component variants

πŸ“ˆ Performance

  • πŸš€ Server-Side Rendering - Fast page loads
  • πŸ“¦ Code Splitting - Optimized bundles
  • πŸ–ΌοΈ Image Optimization - Next.js images
  • πŸ’Ύ Caching - Efficient data fetching

πŸ”§ Development Scripts

# Development server
npm run dev

# Build production
npm run build

# Start production
npm start

# Lint code
npm run lint

πŸš€ Deployment

Vercel Deployment

  1. Connect GitHub repository
  2. Set environment variables
  3. Deploy automatically on push

Environment Variables

  • NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
  • CLERK_SECRET_KEY
  • NEXT_PUBLIC_CLERK_SIGN_IN_URL
  • NEXT_PUBLIC_CLERK_SIGN_OUT_URL
  • LIVEBLOCKS_SECRET_KEY

πŸ“‹ Requirements

  • Node.js: β‰₯18.0.0
  • Memory: 512MB RAM minimum
  • Storage: 1GB disk space

🀝 Contributing

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

πŸ› Known Issues

  • None currently reported

πŸ‘¨β€πŸ’» Author

Padmanabha Das

🌟 Show Your Support

Give a ⭐️ if this project helped you!


Made with ❀️ by Padmanabha Das

⭐ Star this repo if you found it helpful!

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •