Technology Stack
The frontend uses:- SolidJS - Reactive UI framework
- Tauri - Cross-platform desktop/mobile wrapper
- Vite - Build tool and dev server
- Bun - JavaScript runtime and package manager
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Tanstack Query - Server state management
- Lexical - Rich text editing framework
- loro-crdt - CRDT-based collaboration
Monorepo Structure
The frontend is organized as a Bun workspace monorepo atjs/app/:
Package Organization
Application Layerapp/- Main Tauri app entry point, routing, and platform-specific code
core/- Shared components likeCustomScrollbar,DocumentBlockContainer, buttonsui/- Design system primitives (Button,Tooltip, etc.)block-*/- Isolated packages for each document type (markdown, PDF, canvas, etc.)
queries/- All Tanstack Query hooks and cache managementservice-clients/- Auto-generated API clients from OpenAPI specsloro-mirror/- Bidirectional sync between app state and Loro CRDT
lexical-core/- Shared Lexical nodes, plugins, and transformers for interoperability
Tauri Integration
Macro runs as both a web app and native app across platforms:Platform Targets
- Web - Traditional SPA served at
macro.com - Desktop - macOS, Windows, Linux via Tauri
- Mobile - iOS and Android via Tauri
Build Commands
Platform Detection
Platform-specific builds useVITE_PLATFORM environment variable:
vite.config.ts(web)vite.desktop.config.tsvite.ios.config.tsvite.android.config.ts
Development Workflow
Running the App
localhost:3000/app by default.
Type Checking
--noEmit mode to validate types across all packages.
Linting and Formatting
Package Dependencies
Packages reference each other using workspace protocol:solid-js- SolidJS frameworklexical- Rich text editingloro-crdt- CRDT collaboration@tanstack/solid-query- Data fetching and caching@solidjs/router- Client-side routing
Next Steps
- SolidJS Patterns - Code style and reactive patterns
- Component Structure - Block architecture and UI components
- Lexical Editor - Rich text editing implementation
- Testing - Test setup and practices