Skip to content
CADCAMFUN
Docs

Documentation

Overview

CADCAMFUN brings drawing, solid modelling, toolpaths, project history, and an AI assistant into a local desktop application.

Product

The desktop combines a SolidJS workbench with a Tauri shell. The workbench edits drawings and models, displays geometry in a Three.js viewport, manages machining operations, and previews or exports G-code. Project data, tools, materials, machine configurations, and assistant state are managed by a Bun sidecar and stored locally.

The computational kernel is shared between the desktop and sidecar. Interactive geometry can run in the webview without an HTTP round trip; persistent operations, provider calls, project history, and workflow execution go through sidecar services. Local storage does not require a hosted application account. AI providers, GitHub operations, payments, and software updates use their configured network services.

Design to machining

  1. Create or open a project and prepare its drawings, entities, or solid scene. The CAD reference covers sketches, B-rep geometry, tessellation, and exchange formats.
  2. Choose an operation, tool, material, and machine configuration. Generate toolpaths with the CAM services and inspect the result in the viewport.
  3. Use machining setups and program documents to retain operation order, work frames, and program settings. Select a registered post for the intended controller.
  4. Review the generated program and verification results before export. The geometry kernel, post registry, advanced G-code transformations, and machine configuration are distinct parts of this process.
  5. Record a project snapshot with history, or run a registered workflow for repeated validation and processing.

The assistant invokes application actions through the same service adapters used by the app. The mobile companion connects to a paired desktop; it does not run a second CAD/CAM backend on the phone.

Runtime components

apps/desktop
The SolidJS workbench, route adapters, feature modules, viewport, and native Tauri shell.
apps/sidecar
Authenticated HTTP handlers, repositories, Effect services, local identity, AI integration, companion gateway, and database lifecycle.
apps/mobile
Expo companion with native pairing transport, project and history views, and assistant access.
packages/web
This Astro documentation site, Markdown export, documentation assistant, generated guide pages, and local Studio.

The workspace reference describes every library, its public entry point, and its consumers. The source map points to implementation files for common changes.

Start development

Repository root
bun install
bun run desktop:dev

# Documentation and local Studio
bun run --filter @cadcamfun/web dev

The desktop command compiles the sidecar and copies migration resources before starting Tauri. Rust and the platform webview build prerequisites must be installed. To run the documentation server without starting the local Studio API, use bun run --filter @cadcamfun/web start.

Follow Quickstart for prerequisites and first launch, or Local development for isolated sidecar and client loops.

Contracts and persistence

packages/api/src/index.ts composes the schema-first HTTP contract. The sidecar's ServedApi selects the groups it serves and publishes an OpenAPI document at /api/openapi.json. The shell discovers the dynamically allocated loopback port from a readiness event and gives the webview an endpoint and bearer token.

The sidecar database is cadcamfun.db under its configured data directory. The database layer enables foreign keys and WAL, applies configured migrations, and backs up an existing file before a pending upgrade. The documentation Studio has its own database path selection; it does not discover the running sidecar's file automatically.

These pages describe the implementation in this repository. A package export, an HTTP endpoint, a desktop control, and a released installer are different integration surfaces; consult the relevant reference for supported behavior and limits.

Choose a working path

TaskStart hereWhat to retain
Edit a partCAD geometry and viewport controlsThe editable drawing or feature history, including units and placement.
Generate machining outputCAM and saved programsThe captured geometry, stock, tools, machine settings, emitted NC, and applicable verification evidence.
Review a changeProject historyThe commit and structural diff, plus the current review verdicts.
Automate a repeated checkWorkflowsThe committed workflow file, selected ref, registered steps, and individual check results.
Build an integrationAPI referenceThe correct token type, exact endpoint contract, and result/error handling.

Project saves, resource versions, whole-project commits, remote synchronization, and generated guide artifacts are separate operations. Saving a toolpath does not automatically commit it, and a successful GitHub push does not verify its machining output.

For a first API integration, follow the request walkthrough. It shows the public health probe, protected calls, project creation, and preference storage with captured handler responses.

Operational documentation

The guide library walks through complete tasks. Start with project creation and saved work, then use native manufacturing to take a captured design through generation and program persistence. Both explain what is saved and what remains derived or unsaved state.

For integration work, the API resource reference covers every declared operation with request and response schemas. The client integration guide covers Promise and Effect construction, authentication, cancellation, and error handling. The streaming guide adds conversation recovery and interactive permission/question handling.

For operation and support, consult runtime configuration, desktop diagnosis, and companion pairing. Each keeps the native shell, sidecar, database, provider, phone gateway, and documentation deployment distinct so a failure can be investigated at its actual boundary.

For extensions and teamwork, use plugin authoring and branches, reviews, and workflows. These guides document supported module exports, current host behavior, structural merge rules, committed workflow inputs, and service-backed side effects.

CADCAMFUN by the numbers

MeasureValue
Application version6.0.0
HTTP operations / resource groups270 / 34
Database tables / migrations60 / 4
Workspaces10 packages, 3 apps
Desktop release targets6 (macOS, Windows and Linux, each x64 and ARM64)
G-code post dialectsgeneric, GRBL, Fanuc, Haas (LinuxCNC name reserved)
Native CAM strategiesface, adaptive, pocket, profile, bore, drill, thread, engrave, chamfer, surface
Kernel evidence claims10, from cutting data to NC replay and machine clearance

What's new

Recent work on the main branch, summarised from the commit history:

  • Exact kernel on the sidecar. A cadExact group (analyze, step, assembly) runs a shared scene analysis from core: per-solid validity, mass, holes, interference, bill of materials and missing fasteners.
  • Exact modelling. Sweeps and sweep shells, lofts with rational ruled columns, push-pull and mate on exact faces, and fillets about 2.5× faster.
  • NC subprograms. Repeated toolpaths are written once as an incremental M98 subprogram; replay understands O-programs, M98/M99 and G91. Wired end to end from the snapshot to the desktop switch.
  • CAM from B-rep. The planner reads holes, pockets and outlines from exact solids, including STEP parts and rotated parts; volumetric stock removal works along a tilted tool axis.
  • Assistant hardening. Every action declares its result schema; destructive tools always need a human; each turn is bound to its drawing with compare-and-swap writes; a durable background-task journal; kernel jobs in a worker.
  • Documentation. This Astro site with a generated API reference for every operation.

Next steps

If you want to…Go to
Install a published buildDownload and Install
Run the app from sourceQuickstart, then Local development
Understand the processesArchitecture and Sidecar
Model a partCAD and Viewport
Generate G-codeCAM and Native manufacturing
Call the APIAPI tour and API clients
Extend the appPlugin authoring
Manage your accountStudio and Accounts
ContributeContributing

In 3D

The monorepo at a glance Drag to orbit · scroll to zoom · right-drag to pan
All 13 workspace packages from their package.json files; each line is a workspace:* dependency (17 in total). Rows are dependency depth: packages with no workspace dependencies at the front, the sidecar, which depends on 8 of them, at the back. Orange boxes are apps.