A real-time collaborative document editor built with React, Node.js, and WebSockets. CollabSpace allows multiple users to edit documents simultaneously with features like rich text editing, image handling, page management, and real-time synchronization.
- ๐ Real-time Collaboration - Multiple users can edit documents simultaneously
- ๐ Rich Text Editing - Full-featured editor with formatting, images, and more
- ๐ Open Source - Completely free and open source with MIT license
- ๐ ๏ธ Developer Friendly - Well-documented codebase with clear APIs
- ๐ฑ Modern Stack - Built with the latest technologies and best practices
- ๐ Competing with Giants - Taking on Google Docs, Notion, and other big players with open source alternatives
- ๐ Community Driven - Every contribution, no matter how small, makes a difference
- User registration and login with JWT authentication
- Secure password hashing with bcrypt
- Token-based authentication with refresh capabilities
- Protected routes and API endpoints
- Create, edit, and delete documents
- Multi-page document support
- Document sharing and collaboration
- User invitation system
- Document search with Elasticsearch integration
- Real-time collaborative editing with WebSockets
- Rich text formatting (bold, italic, underline, etc.)
- Text and background color support
- Undo/redo functionality
- Auto-save with debounced updates
- LaTeX rendering support
- Drag & drop image upload
- Paste image from clipboard
- Image resizing with corner handles
- Image positioning and dragging
- Image toolbar with delete, reset, and size controls
- Server-side image storage with multer
- Add/delete pages dynamically
- Page navigation with sidebar controls
- Page-specific content management
- Real-time page synchronization
- Full-text search across documents
- Elasticsearch-powered search engine
- Document filtering and organization
- Search results with snippets
- React 19 - Modern React with hooks
- React Router - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- TipTap - Rich text editor framework
- KaTeX - LaTeX rendering
- WebSocket - Real-time communication
- Node.js - JavaScript runtime
- Express.js - Web framework
- Prisma - Database ORM
- PostgreSQL - Primary database
- WebSocket - Real-time communication
- JWT - Authentication tokens
- bcrypt - Password hashing
- Multer - File upload handling
- Elasticsearch - Search engine
- Users - User accounts and authentication
- Documents - Document metadata and ownership
- Pages - Individual document pages with content
- DocumentShare - Document sharing relationships
- Invitations - User invitation system
- Node.js (v16 or higher)
- PostgreSQL database
- Git
-
Fork and clone the repository
git clone https://github.com/yourusername/collabspace.git cd collabspace -
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd ../frontend npm install -
Set up environment variables
Create a
.envfile in the backend directory:DATABASE_URL="postgresql://username:password@localhost:5432/collabspace" JWT_SECRET="your-secret-key" PORT=3000
-
Set up the database
cd backend npx prisma generate npx prisma db push -
Start the backend server
cd backend npm start -
Start the frontend development server
cd frontend npm start
For search functionality, install and run Elasticsearch:
# Using Docker
docker run -d -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.15.0clean-collabSpace/
โโโ backend/
โ โโโ prisma/
โ โ โโโ migrations/ # Database migrations
โ โ โโโ schema.prisma # Database schema
โ โโโ generated/ # Prisma generated client
โ โโโ uploads/ # Image uploads directory
โ โโโ server.js # Main server file
โ โโโ package.json
โโโ frontend/
โ โโโ src/
โ โ โโโ components/ # React components
โ โ โ โโโ Editor.jsx # Main editor component
โ โ โ โโโ EditorToolbar.jsx
โ โ โ โโโ PageControls.jsx
โ โ โโโ pages/ # Page components
โ โ โ โโโ Dashboard.jsx
โ โ โ โโโ EditorPage.jsx
โ โ โ โโโ Login.jsx
โ โ โ โโโ Signup.jsx
โ โ โโโ context/ # React context
โ โ โ โโโ AuthContext.js
โ โ โโโ hooks/ # Custom hooks
โ โ โโโ utils/ # Utility functions
โ โโโ public/
โโโ README.md
POST /api/signup- User registrationPOST /api/login- User loginPOST /api/refresh-token- Token refreshGET /api/validate-token- Token validation
GET /api/documents- Get user's documentsPOST /api/documents- Create new documentGET /api/documents/:docId- Get specific documentPATCH /api/documents/:docId- Update document titleDELETE /api/documents/:docId- Delete document
GET /api/documents/:docId/pages- Get document pagesPOST /api/documents/:docId/pages- Add new pagePUT /api/documents/:docId/pages/:pageIndex- Update page contentDELETE /api/documents/:docId/pages/:pageIndex- Delete page
POST /api/documents/:id/invite- Invite user to documentGET /api/search-docs- Search documents
POST /api/upload-image- Upload image file
update- Send content updatesadd-page- Add new page notification
update- Receive content updates from other usersadd-page- Receive new page notifications
- Bold, italic, underline
- Text color and background highlighting
- Font size and family options
- Text alignment
- Drag & drop image upload
- Image resizing with corner handles
- Image positioning and movement
- Image deletion and reset
- Add new pages (Ctrl+Enter)
- Delete pages
- Navigate between pages
- Page-specific undo/redo
- JWT-based authentication
- Password hashing with bcrypt
- Protected API routes
- File upload validation
- CORS configuration
- Input sanitization
- Set up PostgreSQL database
- Configure environment variables
- Run database migrations
- Deploy to your preferred platform (Heroku, AWS, etc.)
- Build the React app:
npm run build - Deploy the build folder to your hosting service
- Configure API endpoints for production
We welcome contributions from the community! Every contribution matters - whether it's fixing a typo, reporting a bug, or adding a major feature. We're building an open-source alternative to Google Docs, Notion, and other proprietary solutions, and we need your help!
- ๐ Bug Reports - Found a bug? Open an issue! Even small bugs matter.
- ๐ง Fix Existing Bugs - Found a bug in the code? Fix it and create a pull request! Help us improve quality.
- โจ Feature Requests - Have an idea? Let us know! We want to compete with the best.
- ๐ง Code Contributions - Fix bugs or add features. Every line of code helps!
- ๐ Documentation - Improve docs and examples. Help others get started.
- ๐งช Testing - Help us test and improve quality. Find edge cases!
- ๐ฌ Community Support - Help others in discussions and issues.
- ๐ Star & Share - Star the repo and share with others who might benefit.
-
Fork the repository
# Click the "Fork" button on GitHub -
Clone your fork
git clone https://github.com/yourusername/collabspace.git cd collabspace -
Create a feature branch
git checkout -b feature/amazing-feature
-
Make your changes
- Write clean, well-documented code
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
-
Commit your changes
git commit -m "Add amazing feature" -
Push to your fork
git push origin feature/amazing-feature
-
Create a Pull Request
- Go to your fork on GitHub
- Click "New Pull Request"
- Fill out the PR template
- Wait for review and feedback
- Use meaningful variable and function names
- Add comments for complex logic
- Follow the existing code formatting
- Write tests for new functionality
- Update documentation for API changes
- Use the issue templates
- Provide clear reproduction steps
- Include environment details
- Be respectful and constructive
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to all contributors who help make CollabSpace better
- Built with amazing open source technologies
- Inspired by the collaborative editing community
We're actively working to improve CollabSpace! Here are some known issues that need attention:
- Elasticsearch integration is optional and may need configuration
- Image uploads are stored locally (consider cloud storage for production)
- WebSocket connections may need reconnection logic for production
- Mobile responsiveness could be improved
- Error handling in some edge cases needs enhancement
Found a bug? Fix it and create a pull request! Even small fixes help us compete with Google Docs and other big players. Every contribution makes CollabSpace better! ๐
We're always working on new features! Here's what's coming:
- Real-time cursor tracking
- User presence indicators
- Document version history
- Real-time comments and annotations
- Export to PDF/Word formats
- Mobile responsive design improvements
- Advanced search filters
- Document templates
- Dark mode support
- Plugin system for extensions
- Microservices architecture
- Redis for session management
- CDN for image storage
- Docker containerization
- Kubernetes deployment configs
- ๐ Documentation - Check our docs
- ๐ Bug Reports - Open an issue
- ๐ฌ Discussions - Join our GitHub Discussions
- ๐ก Feature Requests - Request a feature
- Be respectful and inclusive
- Help others learn and grow
- Share knowledge and best practices
- Follow our Code of Conduct
If you find CollabSpace useful, please consider:
- โญ Starring the repository - helps us compete with Google Docs!
- ๐ด Forking and contributing - every contribution counts!
- ๐ข Sharing with others - spread the word about open source alternatives
- ๐ Reporting bugs and issues - help us improve quality
- ๐ก Suggesting new features - help us build the best collaborative editor
- ๐ฌ Joining discussions - share ideas and help others
- ๐ Helping us compete - together we can build something better than proprietary solutions
CollabSpace - Where collaboration meets creativity! ๐
Taking on Google Docs, Notion, and other giants with open source power!
Made with โค๏ธ by the open source community
Every contribution matters - help us build the future of collaborative editing! ๐