mycnc.app is a software suite designed for CNC machine operation, G-code management, and process simulation. The project is structured as a monorepo containing a toolchain for CNC workflows, from CAD/CAM integration down to hardware control.
This repository contains multiple interconnected applications and packages:
- Sender (
apps/sender): The core cross-platform desktop application built with Electron, React, and Vite. It establishes a connection to CNC hardware (such as GRBL controllers), streams G-code, and provides real-time 3D visualization of the machine state and toolpaths. - Editor (
apps/editor): A web-based G-code editor utilizing Monaco Editor for syntax highlighting and fast file manipulation. - Fusion Add-in (
apps/mycnc-fusion-addin): A Fusion 360 extension to send toolpaths directly from the CAM environment to the mycnc.app sender over TCP/IP. - Simulator (
packages/simulator): A hardware simulation package that models CNC machine behavior, kinematics, and material removal for preflight checks and crash detection without the need for physical hardware. - Shared (
packages/shared): Shared types, constants, and utilities used across the applications.
- Hardware Control: G-code streaming to GRBL-based controllers, supporting standard job operations (start, pause, resume, stop).
- Visualization: Interactive 3D rendering of toolpaths, stock material, and dynamic chip spawning during cutting simulation.
- Remote Operations: Support for remote job control and monitoring across a local network.
- Job Documentation: Tracking of recent jobs and file library management.
- G-Code Transforms: Built-in toolpath manipulation including stock alignment (rotation compensation) and origin translation — shifts the loaded job so the nearest part edge lands at (0, 0), accounting for tool diameter.
- Plugin System: Extend functionality by writing custom JavaScript/Node.js plugins that hook into real-time application state.
- Extensibility: Built with modern web technologies (TypeScript, React, XState, Zustand), making the interface highly customizable and the architecture easy to extend.
- Internationalization: UI fully wired for translation with 10 supported locales (English, German, Spanish, French, Hindi, Japanese, Bengali, Punjabi, Ukrainian, Chinese).
mycnc.app supports a lightweight plugin architecture that allows you to execute custom code in the Node.js Main Process whenever the application state changes (e.g., job completion, machine connection, UI updates).
- Locate the Plugins Directory: Open
mycnc.app, go to the Help menu, and click Open Plugins Folder. This opens thepluginsfolder inside your user data directory. - Create a Plugin File: Create a new file with a
.jsor.cjsextension in this folder (e.g.,my-custom-integration.js). - Write the Plugin Logic: Export an object with a
nameand anonStateUpdate(storeName, state)async function. The application will pass the name of the Zustand store and its current state every time it updates.
Example Plugin (discord-webhook.js):
module.exports = {
name: 'Discord Webhook Notification',
onStateUpdate: async (storeName, state) => {
// Listen for the jobStore to signal a completed job
if (storeName === 'jobStore' && state.jobStatus === 'complete') {
console.log('[Plugin] Job completed! Sending Discord webhook...');
fetch('https://discord.com/api/webhooks/YOUR_WEBHOOK_URL', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ content: "CNC Job has finished successfully!" })
}).catch(console.error);
}
}
};- Restart: Restart the application for it to load your new plugin. You should see
Loaded plugin: Discord Webhook Notificationin the terminal or logs.
Requirements:
- Node.js (v20 or newer recommended)
- npm
Clone the repository and install all workspace dependencies:
git clone https://github.com/jennib/mycnc.github.io.git
cd mycnc.github.io
npm installTo start the main dual-process Electron application in development mode:
npm run electron:devTo build standard web packages, run:
npm run buildWe are open to contributions and feedback.
- Ideas: Open an issue if you have a feature request or want to suggest supporting additional firmwares or languages.
- Code: Pull requests are welcome. It is recommended to open an issue first to discuss any major architectural changes or new feature additions.
PolyForm Noncommercial License 1.0.0 Free for personal and non-commercial use. See LICENSE for full details.
