Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sureshamal/markview/llms.txt

Use this file to discover all available pages before exploring further.

Build Overview

Building MarkView for production involves two stages: compiling the Next.js frontend into a static bundle, then packaging it with the Rust backend into a native executable.
1

Next.js Static Export

The frontend is built into static HTML/CSS/JS filesOutput: out/ directory
2

Tauri Bundle

The Tauri CLI packages the static frontend with the Rust backend into a native binaryOutput: src-tauri/target/release/ directory

Production Build Process

Quick Build

The simplest way to build for production:
bun run tauri build
This single command:
  1. Runs bun run build to create the Next.js static export
  2. Compiles the Rust backend in release mode with optimizations
  3. Creates platform-specific installers and binaries
The first production build may take 5-10 minutes as Rust compiles with full optimizations.

Step-by-Step Build

For more control, build each layer separately:
1

Build the Next.js frontend

bun run build
Configuration: next.config.ts
const nextConfig: NextConfig = {
  output: "export",  // Static HTML export
};
Output location: out/Contents:
  • index.html - Main page
  • _next/static/ - JS/CSS bundles
  • _next/static/chunks/ - Code-split chunks
2

Build the Tauri application

cd src-tauri
cargo build --release
Or use Tauri CLI directly:
bun run tauri build
Build configuration: src-tauri/tauri.conf.json
{
  "build": {
    "frontendDist": "../out",
    "beforeBuildCommand": "bun run build"
  }
}
3

Locate the binaries

After building, find your executable at:macOS:
src-tauri/target/release/bundle/macos/MarkView.app
Linux:
src-tauri/target/release/markview
src-tauri/target/release/bundle/appimage/markview_0.1.0_amd64.AppImage
src-tauri/target/release/bundle/deb/markview_0.1.0_amd64.deb
Windows:
src-tauri/target/release/markview.exe
src-tauri/target/release/bundle/msi/markview_0.1.0_x64_en-US.msi

Build Configuration

Tauri Configuration

File: src-tauri/tauri.conf.json
Key Configuration
{
  "productName": "MarkView",
  "version": "0.1.0",
  "identifier": "com.markview.desktop",
  "build": {
    "frontendDist": "../out",
    "devUrl": "http://localhost:3000",
    "beforeDevCommand": "bun run dev",
    "beforeBuildCommand": "bun run build"
  },
  "bundle": {
    "active": true,
    "targets": "all",
    "icon": [
      "icons/32x32.png",
      "icons/128x128.png",
      "icons/128x128@2x.png",
      "icons/icon.icns",
      "icons/icon.ico"
    ]
  }
}

Configuration Fields

productName
string
Display name shown in OS (window title, app menu)
version
string
Semantic version used for installers and updates
identifier
string
Unique bundle identifier (reverse domain notation)
build.frontendDist
string
Path to Next.js static export output (../out)
build.beforeBuildCommand
string
Command run before Tauri build (bun run build)
bundle.targets
string
Target installers: all, app, dmg, deb, appimage, msi

Cargo Configuration

File: src-tauri/Cargo.toml
[package]
name = "markview"
version = "0.1.0"
edition = "2021"
rust-version = "1.77.2"

[dependencies]
tauri = { version = "2", features = [] }
tauri-plugin-dialog = "2"
tauri-plugin-fs = "2"
tauri-plugin-shell = "2"
tauri-plugin-log = "2"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
log = "0.4"

Optimization Options

Rust Release Optimizations

Add to src-tauri/Cargo.toml for smaller binaries:
Additional Optimizations
[profile.release]
opt-level = "z"     # Optimize for size
lto = true          # Link-time optimization
codegen-units = 1   # Better optimization
panic = "abort"     # Smaller binary
strip = true        # Remove debug symbols
Trade-offs:
  • Smaller binary size (20-30% reduction)
  • Longer compilation time (2-3x slower)
  • No debug symbols (harder to debug crashes)

Next.js Build Optimizations

Next.js automatically optimizes production builds:
  • Minification of JS/CSS
  • Tree-shaking unused code
  • Image optimization (if using next/image)
  • Code splitting for faster loads

Platform-Specific Builds

macOS

1

Build for macOS

bun run tauri build
Outputs:
  • MarkView.app - macOS application bundle
  • MarkView.app.tar.gz - Compressed app
  • MarkView_0.1.0_x64.dmg - DMG installer
2

Code signing (optional)

For distribution outside the App Store:
# Add to tauri.conf.json
{
  "bundle": {
    "macOS": {
      "signingIdentity": "Developer ID Application: Your Name",
      "entitlements": "path/to/entitlements.plist"
    }
  }
}
3

Notarization (for Gatekeeper)

Required for distribution via download:
xcrun notarytool submit MarkView.app.zip \
  --apple-id your@email.com \
  --team-id TEAM_ID \
  --password APP_PASSWORD

Linux

Universal Linux binary:
bun run tauri build -- --bundles appimage
Output: markview_0.1.0_amd64.AppImageUsage:
chmod +x markview_0.1.0_amd64.AppImage
./markview_0.1.0_amd64.AppImage

Windows

1

Build for Windows

bun run tauri build
Outputs:
  • markview.exe - Portable executable
  • markview_0.1.0_x64_en-US.msi - Windows installer
2

Code signing (optional)

Sign the executable with a certificate:
# Add to tauri.conf.json
{
  "bundle": {
    "windows": {
      "certificateThumbprint": "YOUR_THUMBPRINT",
      "digestAlgorithm": "sha256"
    }
  }
}

Build Targets

Specify Bundle Types

Control which installers to generate:
bun run tauri build -- --bundles app

Cross-Platform Builds

Tauri does not support cross-compilation. You must build on the target platform:
  • Build macOS binaries on macOS
  • Build Windows binaries on Windows
  • Build Linux binaries on Linux
Recommended: Use CI/CD with platform-specific runners (GitHub Actions, GitLab CI).

Binary Output Structure

Output Directory
src-tauri/target/release/
├── markview                    # Executable (Linux/macOS)
├── markview.exe                # Executable (Windows)
└── bundle/
    ├── macos/
   ├── MarkView.app        # macOS app bundle
   └── MarkView.app.tar.gz # Compressed bundle
    ├── dmg/
   └── MarkView_0.1.0_x64.dmg
    ├── deb/
   └── markview_0.1.0_amd64.deb
    ├── appimage/
   └── markview_0.1.0_amd64.AppImage
    └── msi/
        └── markview_0.1.0_x64_en-US.msi

Testing the Production Build

Manual Testing

1

Run the executable

Navigate to the binary location and execute:
# macOS
open src-tauri/target/release/bundle/macos/MarkView.app

# Linux
./src-tauri/target/release/markview

# Windows
.\src-tauri\target\release\markview.exe
2

Test file loading

  • Open a markdown file via CLI: ./markview README.md
  • Open a directory: ./markview /path/to/docs
  • Drag and drop files into the window
  • Use the file picker buttons
3

Verify themes

  • Press Alt+T to open theme selector
  • Switch between all 7 themes
  • Close and reopen - theme should persist
4

Test markdown features

Verify rendering of:
  • Code blocks with syntax highlighting
  • Tables
  • Task lists
  • Mermaid diagrams
  • Internal/external links

Distribution

File Size Reference

Expected binary sizes (may vary by platform):
PlatformBinary SizeInstaller Size
macOS (app)~3-5 MB~4-6 MB (DMG)
Linux (AppImage)~5-7 MB-
Windows (exe)~4-6 MB~5-7 MB (MSI)

Distribution Methods

Direct Download

Host binaries on:
  • GitHub Releases
  • Your own website
  • Cloud storage (S3, etc.)

Package Managers

Submit to:
  • Homebrew (macOS)
  • AUR (Arch Linux)
  • Chocolatey (Windows)
  • Snapcraft (Linux)

App Stores

Publish to:
  • Mac App Store
  • Microsoft Store
  • Flathub

Auto-Updates

Use Tauri’s updater:
  • Configure update endpoint
  • Sign releases
  • Push update manifests

Troubleshooting Build Issues

Ensure Next.js build completed successfully:
bun run build
ls -la out/  # Verify files exist
Apply Rust release optimizations in Cargo.toml:
[profile.release]
opt-level = "z"
lto = true
strip = true
This is a Gatekeeper issue. Options:
  1. Code sign the app
  2. Remove quarantine attribute:
    xattr -cr MarkView.app
    
Windows SmartScreen flags unsigned executables:
  1. Code sign with a valid certificate
  2. Users can click “More info” → “Run anyway”
AppImage should include all dependencies. If not:
# Check missing libraries
ldd markview

# Install missing dependencies
sudo apt install libwebkit2gtk-4.1-0

CI/CD Automation

Example GitHub Actions workflow for multi-platform builds:
.github/workflows/build.yml
name: Build

on:
  push:
    tags:
      - 'v*'

jobs:
  build:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Bun
        uses: oven-sh/setup-bun@v1
      
      - name: Install Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
      
      - name: Install dependencies
        run: bun install
      
      - name: Build
        run: bun run tauri build
      
      - name: Upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: ${{ matrix.os }}-binaries
          path: src-tauri/target/release/bundle/

Next Steps

Development Setup

Return to development environment setup

Architecture

Learn about the codebase structure