DocuMate is a real-time collaborative document editor that offers seamless editing and instant updates for all users. Built with modern web technologies, it leverages Next.js 15, React 19, and TypeScript along with powerful tools like Convex for a real-time database, Clerk for authentication, Liveblocks for collaborative editing, TipTap for rich text capabilities, Tailwind CSS for styling, and Zustand for state management.
- Features
- Technologies Used
- Installation & Setup
- Folder Structure
- Environment Variables
- Usage
- Acknowledgements
-
Real-Time Collaboration:
Utilizing Convex, document changes are instantly propagated to all users. -
Rich Text Editing:
Integrated TipTap provides a dynamic and extensible editor experience. -
User Authentication:
Clerk handles authentication with sign-in components, pagination, and organization support. -
Live Collaboration:
Liveblocks integration manages real-time user presence and collaboration within the editor. -
State Management:
Zustand is used for efficient and straightforward state management. -
Responsive Design:
Tailwind CSS ensures a fast, modern, and responsive user interface.
- Next.js 15 β Framework for building the app.
- React 19 β UI library for building component-based interfaces.
- TypeScript β For type-safe coding practices.
- Convex (v1.17.3) β Real-time database ensuring live updates.
- Clerk (@clerk/nextjs@6.5.1) β Authentication and user management.
- Liveblocks (v2.12.2 series) β Enables real-time collaborative features.
- TipTap β Rich text editor integration (via iptap for Docs editor).
- Tailwind CSS β Utility-first CSS framework for styling.
- Zustand β Lightweight state management.
- Additional Tools:
nuqs@2.2.3for additional functionality.- Use of
--legacy-peer-depsflag during installations to prevent peer dependency errors.
- Node.js (v14 or later recommended)
- npm (or yarn)
-
Clone the repository:
git clone <repository-url> cd DocuMate
-
Install dependencies: When installing, use the
--legacy-peer-depsflag to avoid any installation errors:npm install --legacy-peer-deps
-
Set up Convex:
- Install Convex:
npm install convex@1.17.3
- Start Convex in development mode (login if prompted):
npx convex dev
Convex serves as a real-time database where updates are immediately reflected across all connected users.
- Install Convex:
-
Configure Clerk for Authentication:
npm install @clerk/nextjs@6.5.1 --legacy-peer-deps
Clerk provides the sign-in component and supports pagination and organizational features.
-
Install and Initialize Liveblocks:
npm install @liveblocks/client@2.12.2 @liveblocks/react@2.12.2 @liveblocks/react-ui@2.12.2 @liveblocks/react-tiptap@2.12.2 --legacy-peer-deps
Initialize a Liveblocks application:
npx create-liveblocks-app@2.20240816 --init --framework react
-
Build the project:
npm run build
DocuMate/
βββ convex/
β βββ documents.ts # Document schema and operations for Convex.
β βββ auth.config.ts # Authentication configuration.
β βββ schema.ts # Schema definitions for real-time data.
βββ public/
β βββ (static assets) # Contains images, fonts, etc.
βββ src/
β βββ app/
β β βββ (home)/
β β β βββ page.tsx # Home page component.
β β βββ documents/
β β βββ [documentId]/
β β βββ room.tsx # Document editing room.
β βββ components/
β β βββ convex-client-provider.tsx # Convex client integration.
β β βββ DocumentEditor.tsx # Main document editor.
β β βββ fullscreen-loader.tsx # Fullscreen loader component.
β β βββ navbar.tsx # Navigation bar.
β β βββ template-gallery.tsx # Document template gallery.
β β βββ documents-table.tsx # Table for listing documents.
β βββ constants/
β β βββ templates.ts # Predefined document templates.
β βββ hooks/
β βββ use-search-params.ts # Custom hook for URL search parameters.
βββ README.md # Project overview and instructions.
βββ package.json # Project dependencies and scripts.
Create a .env.local file in the root directory with the following keys:
CONVEX_DEPLOYMENT=<your_convex_deployment>
NEXT_PUBLIC_CONVEX_URL=<your_convex_url>
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=<your_clerk_publishable_key>
LIVEBLOCK_SECRET_KEY=<your_liveblocks_secret_key>
CLERK_SECRET_KEY=<your_clerk_secret_key>Replace the placeholder values with your actual configuration keys.
After installing dependencies and setting up environment variables, start the development server with:
npm run devOpen your browser at http://localhost:3000 to begin using DocuMate.