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.Production Build Process
Quick Build
The simplest way to build for production:- Runs
bun run buildto create the Next.js static export - Compiles the Rust backend in release mode with optimizations
- 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:Build the Next.js frontend
next.config.tsout/Contents:index.html- Main page_next/static/- JS/CSS bundles_next/static/chunks/- Code-split chunks
Build the Tauri application
src-tauri/tauri.conf.jsonBuild Configuration
Tauri Configuration
File:src-tauri/tauri.conf.json
Key Configuration
Configuration Fields
Display name shown in OS (window title, app menu)
Semantic version used for installers and updates
Unique bundle identifier (reverse domain notation)
Path to Next.js static export output (
../out)Command run before Tauri build (
bun run build)Target installers:
all, app, dmg, deb, appimage, msiCargo Configuration
File:src-tauri/Cargo.toml
Optimization Options
Rust Release Optimizations
Add tosrc-tauri/Cargo.toml for smaller binaries:
Additional Optimizations
- 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
Build for macOS
MarkView.app- macOS application bundleMarkView.app.tar.gz- Compressed appMarkView_0.1.0_x64.dmg- DMG installer
Linux
- AppImage
- Debian Package
- RPM Package
Universal Linux binary:Output:
markview_0.1.0_amd64.AppImageUsage:Windows
Build for Windows
markview.exe- Portable executablemarkview_0.1.0_x64_en-US.msi- Windows installer
Build Targets
Specify Bundle Types
Control which installers to generate:Cross-Platform Builds
Recommended: Use CI/CD with platform-specific runners (GitHub Actions, GitLab CI).Binary Output Structure
Output Directory
Testing the Production Build
Manual Testing
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
Verify themes
- Press
Alt+Tto open theme selector - Switch between all 7 themes
- Close and reopen - theme should persist
Distribution
File Size Reference
Expected binary sizes (may vary by platform):| Platform | Binary Size | Installer 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
Build fails with 'out directory not found'
Build fails with 'out directory not found'
Ensure Next.js build completed successfully:
Binary is too large
Binary is too large
Apply Rust release optimizations in
Cargo.toml:macOS: 'App is damaged' error
macOS: 'App is damaged' error
This is a Gatekeeper issue. Options:
- Code sign the app
- Remove quarantine attribute:
Windows: SmartScreen warning
Windows: SmartScreen warning
Windows SmartScreen flags unsigned executables:
- Code sign with a valid certificate
- Users can click “More info” → “Run anyway”
Linux: Missing shared libraries
Linux: Missing shared libraries
CI/CD Automation
Example GitHub Actions workflow for multi-platform builds:.github/workflows/build.yml
Next Steps
Development Setup
Return to development environment setup
Architecture
Learn about the codebase structure