Skip to content

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.

License

Notifications You must be signed in to change notification settings

BaseMax/editor-realtime-collaborative

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Building a Custom Real-Time Collaborative Markdown Editor

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

Custom Editor React

Features

  • 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.

Technologies Used

  • 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.

Getting Started

Prerequisites

Ensure you have the following installed:

Installation

  1. Clone the repository:

    git clone https://github.com/BaseMax/editor-realtime-collaborative.git
    cd editor-realtime-collaborative
  2. Install dependencies:

    npm install  # or use bun install
  3. Start the server:

    npm run dev  # or use bun run dev

    The server will start on port 3099.

Project Structure

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

API & WebSocket Events

WebSocket Events

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.

Example WebSocket Usage (Client-Side)

const socket = io("http://localhost:3099");

socket.on("updateMarkdown", (content) => {
  console.log("Updated Content:", content);
});

socket.emit("markdownChange", "# New Markdown Content");

Contributing

Contributions are welcome! Feel free to:

  • Submit issues.
  • Open pull requests.
  • Suggest new features.

License

This project is licensed under the MIT License.

Author

Seyyed Ali Mohammadiyeh (Max Base)

GitHub: @basemax

Email: maxbasecode@gmail.com

Happy Coding! 🚀

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy