A real-time collaborative document editor with advanced version control, built with modern web technologies.
- Real-Time Collaboration: Multiple users can edit documents simultaneously with live cursor tracking
- Rich Text Editor: Powered by Quill.js with comprehensive formatting options
- Version Control: Automatic document versioning with restore capabilities
- Live Chat: In-document messaging for seamless team communication
- User Authentication: Secure JWT-based authentication system
- Document Sharing: Granular permission system (read/write/admin) with public/private options
- Auto-Save: Automatic document saving every 2 seconds
- Typing Indicators: Real-time typing status for all collaborators
- Document Permissions: Owner/collaborator management with role-based access
- Responsive Design: Mobile-friendly interface with Tailwind CSS
- Error Handling: Comprehensive error management and user feedback
- Express.js REST API server
- Socket.IO for real-time WebSocket connections
- MongoDB with Mongoose ODM for data persistence
- JWT Authentication for secure user sessions
- CORS configuration for cross-origin requests
- React 18 with TypeScript for type safety
- Vite for fast development and optimized builds
- Socket.IO Client for real-time communication
- Quill.js for rich text editing
- Tailwind CSS for responsive styling
- Users: Authentication and profile management
- Documents: Content storage with ownership and collaboration
- Versions: Complete version history with restore functionality
Before running this project, make sure you have:
- Node.js (v18 or higher)
- npm or yarn package manager
- MongoDB Atlas account (or local MongoDB installation)
- Git for version control
git clone https://github.com/rebornstar1/Scriptly.git
cd Scriptly# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Configure environment variables
# Edit .env file with your configurations:
PORT=3001
MONGODB_URI=mongodb+srv://your-username:[email protected]/scriptly?retryWrites=true&w=majority
JWT_SECRET=your-super-secret-jwt-key-here
NODE_ENV=development# Navigate to frontend directory (from project root)
cd frontend
# Install dependencies
npm install
# Create environment file
touch .env.local
# Configure environment variables
# Add to .env.local:
VITE_API_URL=http://localhost:3001/apicd backend
npm run dev
# Server will run on http://localhost:3001cd frontend
npm run dev
# Application will run on http://localhost:5173cd backend
npm startcd frontend
npm run build
npm run previewScriptly/
โโโ backend/
โ โโโ src/
โ โ โโโ config/
โ โ โ โโโ auth.config.js
โ โ โ โโโ db.js
โ โ โโโ controllers/
โ โ โโโ middleware/
โ โ โ โโโ auth.middleware.js
โ โ โ โโโ socket.middleware.js
โ โ โ โโโ validation.middleware.js
โ โ โโโ models/
โ โ โ โโโ document.model.js
โ โ โ โโโ user.model.js
โ โ โ โโโ Version.js
โ โ โโโ routes/
โ โ โ โโโ auth.routes.js
โ โ โ โโโ document.routes.js
โ โ โ โโโ version.routes.js
โ โ โโโ socket/
โ โ โโโ utils/
โ โ โ โโโ auth.utils.js
โ โ โ โโโ db.utils.js
โ โ โโโ server.js
โ โโโ package.json
โ โโโ .env
โโโ frontend/
โ โโโ src/
โ โ โโโ components/
โ โ โ โโโ auth/
โ โ โ โโโ chat/
โ โ โ โโโ sharing/
โ โ โ โโโ ui/
โ โ โ โโโ VersionHistory/
โ โ โโโ contexts/
โ โ โโโ hooks/
โ โ โโโ lib/
โ โ โโโ pages/
โ โโโ package.json
โ โโโ .env.local
โโโ README.md
- Connect your GitHub repository to Render
- Create a new Web Service
- Configure:
- Build Command:
npm install - Start Command:
npm start - Environment Variables: Add all variables from
.env
- Build Command:
- Connect your GitHub repository to Vercel
- Configure:
- Framework Preset: Vite
- Build Command:
npm run build - Output Directory:
dist - Environment Variables: Add
VITE_API_URLwith your backend URL
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current user
GET /api/documents- Get user's documentsPOST /api/documents- Create new documentGET /api/documents/:id- Get specific documentPUT /api/documents/:id- Update documentDELETE /api/documents/:id- Delete document
GET /api/versions/:documentId- Get document versionsGET /api/versions/:documentId/:versionNumber- Get specific version
get-document- Join document room and load contentsend-changes- Send text changes to other userssave-document- Save document contentget-versions- Request version historyload-version- Load specific versionsend-chat-message- Send chat messageuser-typing- Send typing status
load-document- Initial document loadreceive-changes- Receive text changes from other usersdocument-saved- Document save confirmationversions-list- Version history dataversion-loaded- Specific version contentreceive-chat-message- Incoming chat messageuser-typing- Other user typing status
cd backend
npm testcd frontend
npm test- Fork the repository
- 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
- Follow ESLint and Prettier configurations
- Write meaningful commit messages
- Add tests for new features
- Update documentation for API changes
- Ensure TypeScript compliance
- Large documents (>50MB) may experience performance issues
- Mobile editing experience can be improved
- Maximum 50 concurrent users per document room
- File upload and attachment support
- Document templates
- Advanced formatting options
- Integration with Google Drive/Dropbox
- Offline mode with sync
- Document export to PDF/Word
- Advanced user roles and permissions
- Real-time cursor positions
- Comment and suggestion system
This project is licensed under the MIT License - see the LICENSE file for details.
โญ Star this repository if you found it helpful!