This project is a Google Docs-like collaborative editor built using the MERN stack (MongoDB, Express.js, React.js, Node.js) that allows multiple users to edit the same document in real-time.
- Real-time Collaboration: Multiple users can edit the same document simultaneously with updates visible to all in real-time.
- Socket.io Integration: Real-time communication between clients and the server using Socket.io.
- Quill.js Editor: A rich-text editor is used for editing documents with formatting options.
- MongoDB Database: Documents are persisted using MongoDB.
- Document Autosave: Changes are saved automatically to the database.
- Unique Document IDs: Each document has a unique ID, allowing users to access their own documents via the ID.
- Frontend: React.js, Quill.js
- Backend: Node.js, Express.js
- Database: MongoDB (Mongoose for schema management)
- Real-time Communication: Socket.io
Before running this project, make sure you have the following installed:
-
Clone the repository:
git clone https://github.com/yourusername/google-docs-clone.git
-
Navigate to the project directory:
cd google-docs-clone
-
Install dependencies for both the client and server:
# For the backend cd backend npm install # For the frontend cd ../frontend npm install
-
Create a
.env
file in thebackend
directory and add your MongoDB connection string:DB=mongodb+srv://<username>:<password>@cluster0.mongodb.net/<dbname>?retryWrites=true&w=majority
-
Start the backend server (Express.js and Socket.io):
cd backend npm start
-
Start the frontend development server:
cd ../frontend npm start
-
Open your browser and go to
http://localhost:3000
to view the app.
- Create a new document or access an existing one via its unique ID.
- Multiple users can join the same document by sharing the document link.
- Any changes made by one user will be reflected in real-time for all other users.
- Documents are automatically saved in the MongoDB database.
- Express.js: For creating the backend API and serving the application.
- Mongoose: For interacting with MongoDB.
- Socket.io: For real-time communication between the clients and server.
- dotenv: For environment variable management.
- React.js: For building the user interface.
- Quill.js: For rich-text editing.
- Socket.io-client: For real-time communication with the server.
Feel free to fork this repository and submit pull requests. All contributions are welcome!
- Fork the project
- Create your feature branch (
git checkout -b feature/YourFeature
) - Commit your changes (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature/YourFeature
) - Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Let me know if you'd like to make any adjustments to this!