A web-based code editor built with Rust. Features a Yew WebAssembly frontend and Rocket backend API for real-time file editing, Git integration and site rendering.
Find a file
Aitor 6c9456e2ca
All checks were successful
Build & push to Forgejo Registry / build (push) Successful in 1m42s
Mirror to GitHub / mirror (push) Successful in 4s
Fix auto-pull system in frontend
2025-08-31 13:12:24 +02:00
.forgejo/workflows Improve workflows mirror for clarity 2025-08-31 11:22:25 +02:00
.github/workflows Add generic docker publish CI workflow 2025-06-24 20:48:42 +02:00
backend_simple_web Remove unused code and add new theme 2025-08-22 22:52:28 +02:00
frontend_simple_web Fix auto-pull system in frontend 2025-08-31 13:12:24 +02:00
screenshots Add screenshots 2025-08-24 18:06:21 +02:00
static/badges Replace badge references with local files 2025-08-30 18:53:32 +02:00
.gitignore Initial commit 2025-06-23 22:35:07 +02:00
Cargo.lock Fix code editor html rendering issue 2025-08-22 11:47:51 +02:00
Cargo.toml Initial commit 2025-06-23 22:35:07 +02:00
docker-compose.yml Update docker-compose and README 2025-08-24 17:41:58 +02:00
Dockerfile Implement some SonarQube recommendations 2025-08-22 11:49:21 +02:00
LICENSE Initial commit 2025-06-23 22:35:07 +02:00
nginx.conf Please work already 2025-07-06 00:58:07 +02:00
README-github.md Add adaptative README to mirror 2025-08-24 12:30:04 +02:00
README.md Replace badge references with local files 2025-08-30 18:53:32 +02:00
run.sh Create Dockerfile and Docker Compose 2025-06-24 20:46:56 +02:00


Simple Web Editor

Visit Counter

A web-based code editor built with Rust. Features a Yew WebAssembly frontend and Rocket backend API for real-time file editing, Git integration and site rendering.

Yew Documentation · Rocket Documentation · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Architecture
  3. Features
  4. Deployment
  5. Contributing
  6. License
  7. Contact

About The Project

Simple Web Editor (SWE) is a lightweight, web-based code editor designed for static site development: a self-hosted alternative to GitHub Pages. It uses a two-part architecture optimized for real-time web editing, built with Rust technologies and containerized for easy deployment.

The editor provides an intuitive interface for managing files and editing code with syntax highlighting. Repositories can be pulled directly from the interface, making version control and collaboration effortless.

Screenshots

Login Interface SWE Login

Code Editor SWE Editor

Git Configuration SWE Settings

Theme Customization SWE Theme Settings

Example:

  • 🌐 Static Site Output: aichan.moe - Example of a site built and served through SWE
Example Static Site Output
Example of a personal website built and deployed using Simple Web Editor

(back to top)

Built With

Rust WebAssembly Yew Rocket Docker Visual Studio Code

(back to top)

Architecture

Simple Web Editor uses a two-part architecture that separates the editor interface from the site rendering and API services.

Editor GUI

Access: https://swe.example.com or http://127.0.0.1:80
Technology: Rust Yew (compiled to WebAssembly)

  • Presents a file-browser sidebar and an in-browser code editor
  • Allows you to create, rename, move, delete and edit any file that belongs to the site
  • Features syntax highlighting and customizable themes
  • Saves changes by calling the SWE API over HTTPS (JSON / WebSocket)

Site Renderer & API

Access: https://example.com or http://127.0.0.1:8000
Technology: Rust Rocket

  • Exposes all API routes used by the GUI
  • Renders the public site at the root domain
  • Serves static assets from /public_site (e.g., images, CSS, JS)
  • Handles authentication and file operations

(back to top)

Features

  • 🎨 Customizable Syntax Highlighting - Create and manage custom themes with live preview
  • 🔄 Git Integration - Built-in Git operations with automatic synchronization
  • 💾 Persistent Theme Storage - Themes saved to server with localStorage fallback
  • 🔐 Authentication - Secure token-based authentication system
  • 📁 File Management - Complete file browser with create, edit, move, delete operations
  • Real-time Updates - WebSocket-based live updates and collaboration
  • 🌐 WebAssembly Performance - Fast, native-speed execution in the browser

(back to top)

Deployment

You have multiple options to deploy Simple Web Editor:

Using Docker

Run the pre-built container:

docker run --rm -it \
  -p 80:80/tcp \
  -p 8000:8000/tcp \
  -p 8080:8080/tcp \
  -e ROCKET_ADDRESS=0.0.0.0 \
  -e ROCKET_PORT=8000 \
  -e API_URL=http://127.0.0.1:8000/ \
  -e EDITOR_URL=http://127.0.0.1:8080/ \
  -e ADMIN_PASSWORD=<YOUR_PASSWORD> \
  -e ROCKET_LOG_LEVEL=debug \
  git.prisma.moe/aichan/simple_web_editor:latest

Using Docker Compose

Create a docker-compose.yml file:

services:
  simple_web:
    container_name: simple_web_editor
    image: git.prisma.moe/aichan/simple_web_editor:latest
    ports:
      - <YOUR_PORT>:8000 # API and Renderer
      - <YOUR_PORT>:80   # Editor
    environment:
      - ROCKET_ADDRESS=0.0.0.0
      - ROCKET_PORT=8000
      - ADMIN_PASSWORD=<YOUR_PASSWORD>
      - API_URL=<YOUR_API_URL>
      - EDITOR_URL=<YOUR_EDITOR_URL>
    volumes:
      - ./simple_web_editor/public_site:/public_site
    restart: unless-stopped

Then run:

docker-compose up -d

Access Points:

  • API will be served at http://127.0.0.1:8000/
  • Editor will be served at http://127.0.0.1:80/

(back to top)

Contributing

Contributions are welcome! Please fork the repository, make your changes, and open a pull request.

  1. Fork the Project on Forgejo
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the European Union Public License v1.2. See LICENSE for more information.

(back to top)

Contact

Aitor Astorga Saez de Vicuña - a.astorga.sdv@protonmail.com

Project Link: https://git.prisma.moe/aichan/simple_web_editor

(back to top)

Acknowledgments

Thanks to these amazing projects and technologies!

  • Rust Yew - A modern Rust framework for creating multi-threaded front-end web apps with WebAssembly
  • Rocket - A web framework for Rust that makes it simple to write fast, secure web applications
  • WebAssembly - A binary instruction format for a stack-based virtual machine

(back to top)