DocumentationDevelopment

Rust · 0.1.0

Development setup

Prepare the pinned Rust and frontend toolchains in an authorized checkout.

Tools and source

The repository pins Rust 1.94.0 with rustfmt and Clippy. Frontend work uses Node.js 24 and pnpm 11.0.1. Native dependencies require a C/C++ toolchain and CMake. Generated protocol work also uses Buf. Read the checkout's AGENTS.md and relevant source/tests before changing behavior. This fork's repository is private; source access must be granted separately.

Two development processes

Run the backend on loopback with an isolated data path, then start the frontend dev server from web/. The frontend's development proxy targets port 8081. Use synthetic notes and disposable accounts. A debug backend without release assets can show a development placeholder; the Vite interface is the normal frontend development surface.

# Use a dedicated development shell
unset MEMOS_UNIX_SOCK MEMOS_DEMO
cargo run --locked --bin memos -- \
  --addr 127.0.0.1 --port 8081 --driver sqlite --dsn '' --data ./dev-data

# In a separate terminal:
cd web
pnpm install --frozen-lockfile
pnpm dev

Check the workstation before installing dependencies

These shell examples use a Unix-style terminal; on Windows, check the compiler from the matching MSVC or Clang environment instead of assuming cc is available. Run the commands from the application checkout. rustup should select the repository's 1.94.0 toolchain. Compare Node and pnpm with web/package.json, and make sure a native compiler and CMake are available before diagnosing a Cargo failure as a Rust source error. Install missing tools from their official distribution channels for your operating system.

rustup show active-toolchain
rustc --version
cargo --version
node --version
pnpm --version
cmake --version
cc --version

Verify the first working session

After both development processes are running, check the backend and use the URL printed by Vite. For a fresh isolated database, complete first-account setup locally. Save a synthetic memo, reload it, then make a small edit and reload again. This separates successful compilation from a working browser-to-database flow. Stop both terminals when finished; preserve the chosen data directory if you want the test records next time.

curl --fail http://127.0.0.1:8081/healthz

Diagnose setup failures by symptom

Keep the first useful error and the command that produced it. Reinstalling every dependency makes a configuration problem harder to isolate.

SymptomWhat to check
pnpm reports an engine or lockfile mismatchUse the required Node/pnpm versions and the checked-in lockfile; do not delete the lockfile to force installation
Cargo cannot build SQLite or audio dependenciesCheck C/C++ tools, CMake and the first native build error
Backend displays a development placeholderOpen the Vite URL; release builds require pnpm release assets
Vite reports failed API requestsBackend is running on 8081; inspect its startup log and health response
The port is already in useIdentify the other process; keep frontend proxy and backend port aligned rather than starting duplicate servers
Notes vanish between runsCompare the --data path and working directory used by each run