https://github.com/ekzhang/rustpad Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Project management - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} ekzhang / rustpad * Notifications * Star 92 * Fork 1 Efficient and minimal collaborative text editor, self-hosted, no database required rustpad.io/ MIT License 92 stars 1 fork Star Notifications * Code * Issues 1 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 0 tags Code Clone HTTPS GitHub CLI [https://github.com/e] Use Git or checkout with SVN using the web URL. [gh repo clone ekzhan] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @ekzhang ekzhang Use history.replaceState on initial redirect ... f19d11f Jun 5, 2021 Use `history.replaceState` on initial redirect f19d11f Git stats * 57 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows Display GitHub commit hash in interface Jun 3, 2021 public Basic SEO Jun 4, 2021 rustpad-server Implement proper transformation for cursors Jun 5, 2021 rustpad-wasm Implement proper transformation for cursors Jun 5, 2021 src Use history.replaceState on initial redirect Jun 5, 2021 .dockerignore Set up WebAssembly compilation and loading Jun 1, 2021 .editorconfig Initial commit May 31, 2021 .env Implement a basic chat application Jun 1, 2021 .gitignore Set up WebAssembly compilation and loading Jun 1, 2021 .prettierignore Set up WebAssembly compilation and loading Jun 1, 2021 .prettierrc Initial commit May 31, 2021 Cargo.lock Implement multiplexing for editors Jun 3, 2021 Cargo.toml Rename rustpad-core to rustpad-wasm, add Serde Jun 1, 2021 Dockerfile Display GitHub commit hash in interface Jun 3, 2021 LICENSE Add MIT license Jun 3, 2021 README.md Update README with new screenshot Jun 5, 2021 config-overrides.js Set up WebAssembly compilation and loading Jun 1, 2021 package-lock.json Add user presence to the frontend Jun 4, 2021 package.json Add user presence to the frontend Jun 4, 2021 tsconfig.json Set up WebAssembly compilation and loading Jun 1, 2021 View code Rustpad Development setup Testing Deployment README.md Rustpad Rustpad is an efficient and minimal open-source collaborative text editor based on the operational transformation algorithm. It lets users collaborate in real time while writing code in their browser. Rustpad is completely self-hosted and fits in a tiny Docker image, no database required. [68747470733a2f2f692e696d6775722e636f6d2f576a55355572502e706e67] rustpad.io The server is written in Rust using the warp web server framework and the operational-transform library. We use wasm-bindgen to compile text operation logic to WebAssembly code, which runs in the browser. The frontend is written in TypeScript using React and interfaces with Monaco, the text editor that powers VS Code. Architecturally, client-side code communicates via WebSocket with a central server that stores in-memory data structures. This makes the editor very fast, allows us to avoid provisioning a database, and makes testing much easier. The tradeoff is that documents are transient and lost between server restarts, or after 24 hours of inactivity. Development setup To run this application, you need to install Rust, wasm-pack, and Node.js. Then, build the WebAssembly portion of the app: wasm-pack build rustpad-wasm When that is complete, you can install dependencies for the frontend React application: npm install Next, compile and run the backend web server: cargo run While the backend is running, open another shell and run the following command to start the frontend portion. npm start This command will open a browser window to http://localhost:3000, with hot reloading on changes. Testing To run integration tests for the server, use the standard cargo test command. For the WebAssembly component, you can run tests in a headless browser with wasm-pack test rustpad-wasm --chrome --headless Deployment Rustpad is distributed as a single 12 MB Docker image, which is built automatically from the Dockerfile in this repository. You can pull the latest version of this image from Docker Hub. docker pull ekzhang/rustpad (You can also manually build this image with docker build -t rustpad . in the project root directory.) To run locally, execute the following command, then open http://localhost:3030 in your browser. docker run --rm -dp 3030:3030 ekzhang/rustpad We deploy a public instance of this image using DigitalOcean App Platform. ^ All code is licensed under the MIT license. About Efficient and minimal collaborative text editor, self-hosted, no database required rustpad.io/ Topics react rust distributed-systems typescript async self-hosted code-editor tokio collaborative-editing Resources Readme License MIT License Languages * Rust 55.9% * TypeScript 40.3% * JavaScript 1.4% * HTML 1.1% * Dockerfile 1.1% * Shell 0.1% * CSS 0.1% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.