Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/GraphiteEditor/Graphite/llms.txt

Use this file to discover all available pages before exploring further.

Graphite is built with Rust — compiled to WebAssembly — and web technologies including Svelte and TypeScript. The development workflow centers on a local dev server that watches for changes to both frontend and backend code, automatically recompiles, and hot-reloads the editor in your browser. This guide walks you through everything you need to get that environment running.

Prerequisites

Before cloning the repository, install the following tools:
ToolVersionInstall
RustLatest stable releaseVia rustup
Node.jsLatest LTS versionVia nodejs.org installer or a version manager
GitAny recent versionVia git-scm.com or your OS package manager

Full Setup Flow

1

Clone the repository

Clone the project to a convenient location on your machine:
git clone https://github.com/GraphiteEditor/Graphite.git
cd Graphite
2

Run the dev server

From the project root, start the development build:
cargo run
This command will:
  • Check your system for all required dependency versions
  • Help you install any that are missing
  • Compile the project and spin up the dev server at http://localhost:8080
  • Watch for file changes and hot-reload the editor in your browser automatically
To stop the dev server, press Ctrl+C twice.
3

Install VS Code extensions

If you use VS Code, open the project folder and accept the prompt to install the suggested extensions (configured in .vscode/extensions.json). These provide Rust analysis, web tooling, formatting, and linting integrations out of the box.
4

Verify linting and formatting

Before making your first commit, confirm that all checks pass locally:
cargo check
cargo clippy
cargo fmt
For web code, run these from the /frontend directory:
npm run check   # view errors and lint issues
npm run fix     # automatically fix them

Additional Build Commands

To see all available build targets and options:
cargo run help
If you need to proxy the dev server over a slow network where the large unoptimized binary size would be a problem (>100 MB), use a release-optimized build instead:
cargo run release
Release builds are significantly smaller and faster to transfer, making them useful for remote or bandwidth-constrained development environments.

VS Code Setup

VS Code is the recommended editor for Graphite development. The repository ships with a preconfigured .vscode/extensions.json that suggests extensions for:
  • Rust Analyzer — language server for Rust with inline errors, completions, and type hints
  • Svelte — language support for the frontend components
  • ESLint / Prettier — web code linting and formatting
  • Code Spell Checker — catches spelling errors in code and comments
When you open the project, VS Code will prompt you to install these automatically. If you use a different IDE, you won’t receive these default configurations and will need to configure tooling manually — pay close attention to CI results.

Linting and Formatting

Rust

Run these commands from the project root directory at any time:
cargo check    # type-check the project without producing a binary
cargo clippy   # run the Clippy linter and surface warnings
cargo fmt      # auto-format all Rust source files

Web (Frontend)

Run these commands from the /frontend directory:
npm run check  # check for TypeScript errors, lint issues, and formatting problems
npm run fix    # automatically apply fixes where possible

Format on Save

VS Code’s format-on-save is pre-configured for the project. If you use a different editor, set up a pre-commit hook to run formatting automatically before each commit — see githooks.com for setup instructions.
If you use VS Code, it is recommended to disable the Auto Save feature. This ensures files are only saved when you explicitly save them, which is what triggers format-on-save. With Auto Save enabled, intermediate incomplete states may be formatted unexpectedly.
CI enforces that cargo fmt, cargo clippy, and the web checks all pass before any PR can be merged. Running these locally before pushing saves you the round-trip of a failed CI build.

Build docs developers (and LLMs) love