Skip to content

edit-md/edit-md

Repository files navigation

edit.md - The Collaborative Markdown Editor

edit.md is a real-time collaborative Markdown editor that allows multiple users to work on documents simultaneously. It supports access control for public, private, and shared documents, GitHub OAuth authentication, and file uploads with image previews. The editor is designed to be easily deployed using Docker for development and Kubernetes with Helm charts for production, ensuring a consistent and flexible setup.

Features

  • Create public / private documents
  • Share documents with other users (write or read access)
  • Edit documents concurrently with other users (live sync using websockets)
  • Upload files (with image preview) (stored in S3)
  • Login using GitHub Account

Screenshots

Helm-Chart-Features

  • Health checks
  • Autoscaling
  • Includes all needed Databases and MinIO (but also the option to use external ones)
  • Nginx and Traefik Ingress supported

Development

Dev-Prod parity is maintained by running all services in containers, ensuring that the development and production environments remain as similar as possible. This setup minimizes discrepancies between the two environments, making it easier to catch and fix issues early. In theory, no dev tools or build tools need to be installed on the development machine, even though we would not recommend that. All containers have a development target that starts the services with hot reload functionality, allowing for seamless editing and updates. While the hot reload feature may take some time for Spring Boot services, it should still function correctly. However, switching branches or making significant changes may require a container restart.

IMPORTANT: The docker-compose file is only intended for development purposes and should not be used for deployment.

Setting Up the Environment

To get started, first copy the example environment configuration file and fill in the empty fields with the appropriate values. For signing in to the services a GitHub OAuth App has to be created here.

  • Windows:

    copy .env.example .env
  • Linux/Unix:

    cp .env.example .env

Starting the Containers

Once the environment file is configured, start all the necessary containers using the command below. This process may take some time as the services are initialized. The command ensures that all services start and automatically restart whenever source files change.

docker compose watch

Accessing the Services

After starting the containers, the following services will be available at the respective URLs shortly. The Spring Boot based services may take some time to start, so please be patient. The ability to access all services through a single IP and port with SSL is provided by a separate Nginx container, which is started in the Docker Compose file. This setup is intended for development purposes only.

If the frontend is not available, you can still interact with the services directly using the following authentication endpoints:

This setup provides the core functionality for authenticating users and managing accounts, documents, and files in the collaborative editor.

Production

The production environment is designed to run in a Kubernetes cluster and can be deployed using the provided Helm chart. The chart is located in the helm directory and can be installed using the following tutorial.

Remote

The production environment runs in Kubernetes (k8s) and can be deployed using the provided Helm chart. The chart is located in the helm directory. Before installing the chart, update the values.yaml file with the appropriate values. The chart can be installed using the following command:

./helm/preprocess.sh
helm install <name> ./helm

Locally

When running the chart locally in Minikube, it is recommended to install the Ingress controller.
If running locally in Minikube, use the values-local.yaml file with the following command:

./helm/preprocess.sh
helm install <name> ./helm -f ./helm/values-local.yaml

After installing it, you can access the service using the Minikube tunnel command:

minikube tunnel

The services will be available at the following URL: https://127.0.0.1/

Service Overview

A view of all services and how they interact with each other

Frontend

The frontend service is a SvelteKit application that provides the user interface for the collaborative editor. It allows users to create, edit, and share documents with other users. The frontend communicates with the account, document, and file services to prerender all the necessary data for the user interface.

Account Service

The account service is a Spring Boot application that manages user accounts and authentication. It provides endpoints for user login and logout via OAuth2 authentication with GitHub. It also provides endpoints for retrieving user information and validating user sessions.

Document Service

The document service is a Spring Boot application that manages documents in the collaborative editor. It provides endpoints for creating, updating, and deleting documents as well as provides the live sync functionality. It also provides endpoints for retrieving document information, sharing and unsharing documents with other users.

File Service

The file service is a Spring Boot application that manages files in the collaborative editor. It provides endpoints for uploading, downloading, and deleting files as well as provides file preview functionality for images. It also provides endpoints for retrieving file information and files for specific documents.


Screenshots

Dashboard

View only document

Document editor

About

The collaborative Markdown editor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors