Welcome to the Real-Time Collaborative Markdown Editor project! This repository contains the backend implementation of a collaborative Markdown editor using Node.js, Express, and Socket.IO. The frontend can be developed using React.js to provide a seamless, real-time editing experience.
Front-End repository: https://github.com/BaseMax/custom-editor-react
- Real-Time Collaboration: Multiple users can edit the same document simultaneously.
- Live Markdown Preview: Users can see rendered Markdown in real time.
- Socket.IO Integration: Ensures instant synchronization between users.
- User Tracking: Displays the number of online users.
- Customizable Interface: Can be extended with themes, plugins, and additional features.
- Node.js - JavaScript runtime environment.
- Express.js - Lightweight web framework.
- Socket.IO - WebSockets for real-time communication.
- TypeScript - Ensures type safety and better development experience.
Ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/BaseMax/editor-realtime-collaborative.git cd editor-realtime-collaborative
-
Install dependencies:
npm install # or use bun install
-
Start the server:
npm run dev # or use bun run dev
The server will start on port 3099.
editor-realtime-collaborative/
│-- src/
│ │-- config.ts # Configuration file
│ │-- io.ts # Handles socket.io events
│ │-- default.ts # Default markdown content
│ │-- server.ts # Express server setup
│-- package.json
│-- tsconfig.json
│-- README.md
Event Name | Description |
---|---|
connection |
Triggered when a user connects. |
updateMarkdown |
Sends the latest Markdown content. |
markdownChange |
Updates Markdown content from a user. |
onlineUsers |
Notifies users of the current online count. |
disconnect |
Triggered when a user disconnects. |
const socket = io("http://localhost:3099");
socket.on("updateMarkdown", (content) => {
console.log("Updated Content:", content);
});
socket.emit("markdownChange", "# New Markdown Content");
Contributions are welcome! Feel free to:
- Submit issues.
- Open pull requests.
- Suggest new features.
This project is licensed under the MIT License.
Seyyed Ali Mohammadiyeh (Max Base)
GitHub: @basemax
Email: maxbasecode@gmail.com
Happy Coding! 🚀