Memospot Help

Contributing

Memospot contributor's guide.

The recommended code editor is Visual Studio Code. The project has a pre-configured workspace, which will prompt you to install the recommended extensions.

Container build

It's possible to easily build the app for Linux and Windows (NSIS only) using Docker or Podman, via Earthly. This bypasses the need to set up the base OS and other dependencies.

earthly +build --target=x86_64-pc-windows-msvc --nosign=1
earthly +build --target=x86_64-unknown-linux-gnu --nosign=1

Listing the additional recipes available in the Earthfile:

earthly ls

Pre-requisites

  • A package manager: Homebrew or winget.

  • A system WebView (Edge WebView2, Safari, or WebkitGTK), for Tauri to work.

  • A modern computer, with at least 8 GB of RAM and a decent CPU. Rust compilation is very CPU-intensive. Also, rust-analyzer (language server) utilizes circa 2GB of RAM.

  • 20 GB of free disk space, for Rust artifacts.

OS-specific dependencies

See also: Tauri Prerequisites

Linux

sudo apt update -y && sudo apt install --no-install-recommends -qq \ autoconf \ autotools-dev \ build-essential \ ca-certificates \ curl \ file \ patchelf \ wget \ git \ unzip \ nsis \ clang \ lld \ llvm \ libayatana-appindicator3-dev \ libgtk-3-dev \ librsvg2-dev \ libssl-dev \ libwebkit2gtk-4.1-dev \ libxdo-dev \ -y

macOS

xcode-select --install

Windows

Git

winget install --id Git.Git -e --source winget

Build Tools for Visual Studio 2022

winget install -e --id Microsoft.VisualStudio.2022.BuildTools --override "--passive --wait --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"

Edge WebView2

winget install --id=Microsoft.EdgeWebView2Runtime -e

Bun

Bun is a fast JavaScript/TypeScript runtime, bundler, test runner, and package manager. It's used to bundle the front end and to run build scripts.

Official Website | GitHub

  • Homebrew

    brew install oven-sh/bun/bun
  • Winget

    winget install --id Oven-sh.Bun

Node JS

Node is a JavaScript runtime built on Chrome's V8 JavaScript engine.

  • Homebrew

    brew install node@22
  • Winget

    winget install --id OpenJS.NodeJS.LTS

UPX (optional; Linux-only)

UPX is a packer for executable files.

  • Homebrew

    brew install upx

Rust

Rustup | Official Website

  • Homebrew

    brew install rustup-init rustup-init -y source "$HOME/.cargo/env"
  • Winget

    winget install --id Rustlang.Rustup

Rust toolchain

rustup default stable rustup component add clippy rust-analyzer

Cargo binstall

Binstall is a tool for installing pre-built Rust binaries.

  • Homebrew

brew install cargo-binstall
  • Powershell

Set-ExecutionPolicy Unrestricted -Scope Process; iex (iwr "https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.ps1").Content
  • Cargo (build from source)

cargo install cargo-binstall --locked

Rust tools

Bash
cargo binstall \ --disable-telemetry \ --target=$(rustc -vV | sed -n 's|host: ||p') \ cargo-cache@0.8.3 \ cargo-edit@0.13.1 \ cargo-xwin@0.18.4 \ dprint@0.49.0 \ just@1.39.0 \ tauri-cli@2.2.7 \ -y
Powershell
cargo binstall ` --disable-telemetry ` --target=$(& rustc -vV | Select-String -Pattern "^host:" | ForEach-Object {$_.Line.Split(':')[1].Trim()}) ` cargo-cache@0.8.3 ` cargo-edit@0.13.1 ` dprint@0.49.0 ` just@1.39.0 ` tauri-cli@2.2.7 ` -y

Memos server build

Memos server is built separately on the repository memos-builds.

A pre-build hook will automatically download the latest release from the companion repository and put it in the server-dist folder. Downloaded files will be reused on subsequent builds.

Sample valid server binary names:

  • Windows: memos-x86_64-pc-windows-msvc.exe

  • Linux: memos-x86_64-unknown-linux-gnu

  • macOS: memos-x86_64-apple-darwin/memos-aarch64-apple-darwin

Cloning the repository

git clone https://github.com/memospot/memospot.git

Changing into the project directory

cd memospot

Using Just

At this point, everything should be ready to go.

Listing all available Just recipes:

just --list

Common recipes

  • just dev: Run the app in development mode.

  • just build: Build the app.

  • just fmt: Run all code formatters.

  • just lint: Run all code checkers/linters.

  • just test: Run all available tests.

  • just clean: Remove build artifacts and caches.

Coding style

  • Try your best match the existing code style.

  • Run just pre-commit on the repository before submitting a pull request. This will run all the code formatters, linters and tests.

License

By contributing, you agree that all your contributions will be licensed under the MIT License.

In short, when you submit code changes, your submissions are understood to be under the same MIT License that covers the project. Feel free to contact the maintainer if that's a concern.

Last modified: 24 February 2025