A small local demo app for the Toolpath Public API.
The app lets you:
- Load your Toolpath cut configs.
- Select one or more cut configs.
- Upload a STEP file.
- Create a Toolpath part with
autoCreateProgramenabled. - Upload the file to the signed upload URL.
- Complete the part upload.
- Poll for generated programs and machinability scores.
- View status, setup count, duration, and score per program.
This is a local demo, not a production app. There is no login, no multi-user auth, and the local SQLite database is only for demo state.
- Node.js 20.19.0 or compatible. This repo includes
.tool-versionsfor asdf users. - npm.
- A Toolpath API key.
- Log in to your Toolpath account at app.toolpath.com. You must be a team admin.
- Click your profile at the bottom left, then choose
My preferences. - Navigate to the
API keystab. - Press
Create API key. - Give the key a name and select
Read and writepermissions. - Press
Create key. - Copy the key. Do not share it; you will only see it once.
- Paste the key into your
.envfile asTP_API_KEY.
The Toolpath API is rolling out progressively. If you do not see the API keys tab, please contact us to request access.
npm install
cp .env.example .envFill in .env:
TP_API_KEY=tp_live_your_key_here
TP_API_BASE_URL=https://app.toolpath.com
PORT=3002
DATABASE_PATH=data/tp-api-demo.sqlite
POLL_INTERVAL_MS=5000
LOG_TOOLPATH_BODIES=falseThen run:
npm run devOpen:
http://localhost:3002
For each uploaded STEP file, the demo follows this sequence:
POST /api/public/v0/partswithautoCreateProgram: trueand selectedcutConfigIds.PUTthe STEP bytes to the signed upload URL returned by Toolpath.POST /api/public/v0/parts/{partId}/complete.- Poll
GET /api/public/v0/parts/{partId}until program IDs appear. - Poll nested program resources under
/parts/{partId}/programs/{programId}. - Fetch
/parts/{partId}/programs/{programId}/machinabilityfor score, setup count, and duration.
Stop the app, then remove the SQLite file:
rm data/tp-api-demo.sqliteThe database is recreated automatically on the next npm run dev.
npm run dev # run the local Express app with Vite middleware
npm run build # build server and client output
npm start # run the built server
npm test # run Vitest
npm run typecheck # run TypeScript checks
npm run lint # run ESLintThe server logs local requests and outbound Toolpath requests so you can watch the upload and polling flow.
By default, Toolpath response bodies are not logged. To include sanitized request and response bodies:
LOG_TOOLPATH_BODIES=trueThe logger redacts common sensitive keys and strips query strings from URLs before printing.
Do not commit .env. It is ignored by .gitignore.
Before publishing this repo, make sure these paths are not tracked:
.envdata/dist/node_modules/