Getting started

Graphite is built with Rust and web technologies. Install the latest LTS version of Node.js and stable release of Rust, as well as Git.

Installing

Clone the project:

git clone https://github.com/GraphiteEditor/Graphite.git

On Debian-based (Ubuntu, Mint, etc.) Linux distributions, you may need to install the following packages:

sudo apt install libgtk-3-dev libsoup2.4-dev libjavascriptcoregtk-4.0-dev libwebkit2gtk-4.0-dev

On Fedora-based (RHEL, CentOS, etc.) Linux distributions, you may need to install the following packages:

sudo dnf install libsoup-devel gtk3-devel javascriptcoregtk4.0-devel webkit2gtk4.0-devel

Then install the required Node.js packages:

cd frontend
npm install

You only need to explicitly install Node.js dependencies. Rust's cargo dependencies will be installed automatically on your first build. One dependency in the build chain, wasm-pack, will be installed automatically on your system when the Node.js packages are installing. (If you prefer to install this manually, get it from the wasm-pack website, then install your npm dependencies with npm install --omit=optional instead.)

One tool in the Rust ecosystem does need to be installed:

cargo install cargo-watch

That's it! Now, to run the project while developing, just execute:

npm start

This spins up the dev server at http://localhost:8080 with a file watcher that performs hot reloading of the web page. You should be able to start the server, edit and save web and Rust code, and rarely have to kill the server (by hitting CtrlC twice). You sometimes may need to reload the browser's web page if the hot reloading didn't behave perfectly. This method compiles Graphite code in debug mode which includes debug symbols for viewing function names in stack traces. But be aware, it runs slower and takes more memory.

Production builds

You'll rarely ever need to do this, but to compile a production build with full optimizations:

cargo install cargo-about
npm run build

This produces the /frontend/dist directory containing the static site files that must be served by your own web server.