Build a Notes App with GTKX


Build Notes, a Markdown notes app that keeps each note as a plain file in a folder, from an empty directory, then test, translate, and package it as a Flatpak, deb, rpm, and AppImage.
The tutorial assumes familiarity with React and TypeScript. You need Linux, the native development libraries, and Node.js 26.7 or later; Getting Started covers installation. Notes also needs GtkSourceView 5 with its GObject introspection data, and the gettext tools.
This tutorial uses GTKX 2.1. Keep GTKX packages on the same version; gtkx upgrade moves them together. For GTKX 1.x, use the 1.6 tutorial, which builds a task manager.
Check your setup
Confirm that Node.js is version 26.7 or later:
node --versionScaffold the project:
npm create gtkx@latestpnpm create gtkx@latestChoose notes as the project directory, keep the suggested package name, and enter Notes as the display name and dev.gtkx.Notes as the application ID. Choose your package manager, and enable TypeScript and the testing setup. The scaffolder installs the dependencies and makes a first Git commit.
The commands below use npm; use the equivalent commands for your package manager. If you choose another application ID, substitute it consistently throughout the tutorial.
Start the app:
cd notes
npm run devThis opens an Adwaita window with a counter.
Leave npm run dev running as you work. It applies saved edits to the open window and relaunches the app when an edit needs a restart; saving gtkx.config.ts also regenerates the bindings.
To let an AI coding agent inspect the running app, see App Inspection (MCP).
How this tutorial works
Follow the chapters in order: each builds on every one before it, leaves the app runnable, and ends with Run it checks. Build Notes ends with a working app, and you can stop there or after any later chapter.
| Group | What you build |
|---|---|
| Build Notes | A notes app that creates, edits, saves and previews Markdown files |
| Extend Notes, optional | Search, tags, rename and trash with undo, preferences, link completion |
| Test and Ship, optional | Stories, integration tests, translations, and installable packages |
Examples you apply are titled with their file. Most show the whole file: create it or replace yours with it, and the highlighted lines are the ones the chapter adds or changes. A short block, such as a few package.json fields or one gtkx.config.ts option, shows only what to add; keep the rest of the file. Run npm run typecheck after each chapter and npm test once Test the App adds the suite.
Commit your project with its lockfile after each chapter's Run it checks pass, so git diff shows the next chapter's changes.
The finished source is a reference for the complete app. It includes later features, so copy only what each chapter describes.