Skip to main content
This guide walks you through building En Croissant from source on your machine.

Prerequisites

Before building En Croissant, ensure you have the required tools installed.

Required Software

1

Install Rust

Download and install Rust from rustup.rs
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Verify installation:
rustc --version
2

Install Node.js

Install Node.js 18 or later from nodejs.org
node --version  # Should be v18 or higher
3

Install pnpm

En Croissant uses pnpm as the package manager. Install it globally:
npm install -g pnpm
Or follow the pnpm installation guide for other methods.Verify installation:
pnpm --version
4

Install Tauri Dependencies

Tauri requires platform-specific dependencies. Follow the Tauri Prerequisites Guide for your operating system.Linux:
# Debian/Ubuntu
sudo apt install libwebkit2gtk-4.1-dev \
  build-essential \
  curl \
  wget \
  file \
  libxdo-dev \
  libssl-dev \
  libayatana-appindicator3-dev \
  librsvg2-dev
macOS:
xcode-select --install
Windows:

Building En Croissant

1

Clone the Repository

git clone https://github.com/franciscoBSalgueiro/en-croissant
cd en-croissant
2

Install Dependencies

Install all JavaScript dependencies:
pnpm install
This will install:
  • Frontend dependencies (React, Vite, Mantine, etc.)
  • Development tools (TypeScript, Biome, Vitest)
  • Tauri CLI
3

Development Build

To run En Croissant in development mode with hot reloading:
pnpm dev
This starts:
  • Vite development server on port 1420
  • Tauri application window
  • Hot module replacement for frontend changes
  • Automatic Rust recompilation on backend changes
4

Production Build

To create an optimized production build:
pnpm build
This will:
  1. Run TypeScript type checking
  2. Build and optimize the frontend with Vite
  3. Compile the Rust backend in release mode
  4. Package the application
The built application can be found at:
src-tauri/target/release/

Additional Build Commands

Type Checking

Run TypeScript type checking without building:
pnpm lint

Testing

Run the test suite:
pnpm test
En Croissant uses Vitest for unit testing.

Code Formatting

Format code with Biome:
pnpm format
Auto-fix linting issues:
pnpm lint:fix

i18n Management

Extract translation strings:
pnpm i18n:extract
Check translation status:
pnpm i18n:status

Platform-Specific Notes

Linux

AppImage: To create an AppImage bundle:
pnpm tauri build
The AppImage will be in src-tauri/target/release/bundle/appimage/. Wayland: If you encounter issues on Wayland, you may need to set:
export WEBKIT_DISABLE_COMPOSITING_MODE=1

macOS

Apple Silicon: Building on Apple Silicon (M1/M2) requires no special configuration. Cross-compilation to x86_64 is possible:
rustup target add x86_64-apple-darwin
pnpm tauri build --target x86_64-apple-darwin
Code Signing: For distribution, you’ll need an Apple Developer certificate. See Tauri’s macOS signing guide.

Windows

MSVC vs GNU: Use the MSVC toolchain (default) for best compatibility:
rustup default stable-msvc
Antivirus: Some antivirus software may slow down Rust compilation. Consider adding the target/ directory to your exclusions.

Troubleshooting

Build Fails with “Cannot find module”

Ensure dependencies are installed:
pnpm install

Rust Compilation Errors

Update Rust to the latest stable version:
rustup update stable

Tauri CLI Not Found

Reinstall dependencies:
pnpm install
Or install Tauri CLI globally:
cargo install tauri-cli

WebView2 Errors (Windows)

Install or update WebView2 Runtime from Microsoft.

Permission Errors (Linux/macOS)

Ensure you have write permissions in the project directory:
sudo chown -R $USER:$USER .

Development Tips

Faster Builds

Use mold linker (Linux):
sudo apt install mold
export RUSTFLAGS="-C link-arg=-fuse-ld=mold"
Use lld linker (macOS/Windows): Add to .cargo/config.toml:
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]

[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "link-arg=/usr/bin/lld-link"]

Debug Builds

For development, debug builds are faster to compile:
pnpm dev  # Uses debug build
Release builds are optimized but take longer:
pnpm build  # Uses release build

Clearing Build Cache

If you encounter strange build issues, try clearing the cache:
# Clean Rust build artifacts
cargo clean

# Clean Node modules and reinstall
rm -rf node_modules
pnpm install

Next Steps

Now that you have En Croissant building, check out:

Build docs developers (and LLMs) love