Real-Time Collaborative Document Editing Platform
A powerful online tool that allows multiple users to edit documents simultaneously in real-time. Perfect for teams, remote workers, and anyone who needs to collaborate on projects efficiently.
- Real-Time Collaboration - Multiple users can edit the same document simultaneously with live cursor tracking
- Rich Text Editing - Full-featured text editor powered by Lexical with formatting options
- User Authentication - Secure sign-in/sign-up with Clerk authentication
- Access Control - Granular permissions system with editor and viewer roles
- Document Management - Create, view, edit, and delete documents with ease
- Active Collaborators - See who's currently working on the document
- Smart Notifications - Stay updated with document activities
- @Mentions - Tag and notify collaborators within documents
- Share & Invite - Share documents with team members and control their access levels
- Dark Theme - Beautiful dark-themed interface for comfortable editing
- Responsive Design - Works seamlessly across desktop and mobile devices
- Next.js 14 - React framework with App Router
- React 18 - UI library
- TypeScript - Type safety and better DX
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Unstyled, accessible UI components
- Clerk - Authentication and user management
- Liveblocks - Real-time collaboration infrastructure
- Lexical - Extensible text editor framework
- jsm-editor - Enhanced editor components
- Lucide React - Beautiful icon library
- nanoid - Unique ID generator
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- npm, yarn, pnpm, or bun package manager
- A Clerk account (Sign up here)
- A Liveblocks account (Sign up here)
git clone https://github.com/Dev-muse/doc-jam.git
cd doc-jamnpm install
# or
yarn install
# or
pnpm installCreate a .env.local file in the root directory and add the following environment variables:
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
# Clerk URLs
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/
# Liveblocks
LIVEBLOCKS_SECRET_KEY=your_liveblocks_secret_keyClerk:
- Go to Clerk Dashboard
- Create a new application
- Navigate to API Keys section
- Copy the Publishable Key and Secret Key
Liveblocks:
- Go to Liveblocks Dashboard
- Create a new project
- Navigate to API Keys section
- Copy the Secret Key
npm run dev
# or
yarn dev
# or
pnpm devOpen http://localhost:3000 in your browser to see the application.
doc-jam/
βββ app/
β βββ (auth)/ # Authentication routes
β β βββ sign-in/ # Sign-in page
β β βββ sign-up/ # Sign-up page
β βββ (root)/ # Main application routes
β β βββ documents/[id]/ # Individual document page
β β βββ page.tsx # Home page with document list
β βββ api/
β β βββ liveblocks-auth/ # Liveblocks authentication endpoint
β βββ Provider.tsx # Liveblocks provider wrapper
β βββ layout.tsx # Root layout with Clerk provider
β βββ globals.css # Global styles
βββ components/
β βββ editor/ # Editor components
β βββ ui/ # Reusable UI components
β βββ ActiveCollaborators.tsx
β βββ CollaborativeRoom.tsx # Main collaborative workspace
β βββ Collaborator.tsx
β βββ DeleteModal.tsx
β βββ Header.tsx
β βββ Notifications.tsx
β βββ ShareModal.tsx
β βββ UserTypeSelector.tsx
βββ lib/
β βββ actions/
β β βββ room.actions.ts # Document/room server actions
β β βββ user.actions.ts # User-related server actions
β βββ liveblocks.ts # Liveblocks client configuration
β βββ utils.ts # Utility functions
βββ public/
β βββ assets/ # Static assets (icons, images)
βββ styles/ # Theme styles
βββ middleware.ts # Clerk middleware for auth
βββ liveblocks.config.ts # Liveblocks type definitions
βββ tailwind.config.ts # Tailwind configuration
βββ package.json
- Sign in to your account
- Click the "Create a document" button on the home page
- Start editing your new document
- Open a document
- Click the "Share" button in the header
- Add collaborators by email
- Choose their access level (Editor or Viewer)
- Collaborators can now edit simultaneously
- View all documents: Navigate to the home page
- Edit a document: Click on any document from the list
- Delete a document: Click the delete icon next to a document
- Update document title: Click on the title in the document editor
- Editor: Can read, write, and edit the document
- Viewer: Can only read the document and see live changes
- Secure Authentication: Industry-standard authentication with Clerk
- Email Verification: Ensures user identity
- Access Control: Granular permissions for each document
- Secure API Routes: Protected with Clerk middleware
- Environment Variables: Sensitive data stored securely
- Push your code to GitHub
- Import your repository on Vercel
- Add environment variables in Vercel project settings
- Deploy
npm run build
npm run startnpm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Dev-muse
- GitHub: @Dev-muse
- Next.js for the amazing framework
- Clerk for authentication
- Liveblocks for real-time collaboration infrastructure
- Lexical for the text editor
- Vercel for hosting
For support, email dev-muse@example.com or open an issue in the GitHub repository.
Made with β€οΈ by Dev-muse
β Star this repo if you find it helpful!