Skip to content

YurMil/cadautoscript.com

Repository files navigation

CAD AutoScript

Docusaurus React TypeScript License

Engineering documentation portal and browser-based utilities for mechanical design, fabrication, QA workflows, and CAD automation. All tools run client-side in Chromium with WebGL 2 and WebAssembly.

Live site: cadautoscript.com


Table of Contents


Quick Start

# Install dependencies
npm install

# Start development server
npm start

# Build for production
npm run build

# Serve production build locally
npm run serve

Utilities Catalog

CAD / Geometry Tools

Utility Description Tech
Pipe Cutter Visualizer Preview saddle intersections, adjust offsets, export DXF templates for CNC plasma/waterjet WebGL
Cylindrical Shell Rolling Calculate roll spacing, bending allowance, developed lengths (EN 13445 / ASME VIII) Calc
Sheet-Metal Bending Sandbox Simulate K-factors, reliefs, bend deductions before CAM Canvas
Tube Sheet Generator Lay out tube sheet hole patterns, export DXF or STEP Canvas + WASM
WebDXF Editor Trim geometry, annotate lengths, resave DXF files in browser Canvas
WebSTEP Viewer Inspect STEP assemblies, isolate parts, measure geometry WebGL + WASM

Instrumentation Configurators

Utility Description Tech
Magnetic Level Gauge Configurator Configure connections, dimensions, export PDF datasheet (DIN/EN + ASME/ANSI) React + SVG
Bourdon Gauge Configurator Configure pressure gauges with ranges, connections, accessories (EN 837-1/2) React + SVG
Industrial Thermometer Configurator Configure bimetal thermometers: ranges, stems, thermowells (EN 13190) React + SVG

Pressure Vessel Engineering

Utility Description Tech
Blind Flange Calculator Auto-select PN class, calculate EN 13445-3 thickness with weight estimates React + Calc
Dished End Calculator Size DIN 28011/28013 heads, preview dimensions, add nozzle callouts SVG + Calc

PDF & Document Tools

Utility Description Tech
PDF Master Reorder, rotate, merge PDF pages locally PDF toolkit
PDF Batch Signer Stamp signatures across multiple PDFs with one placement PDF-lib + JSZip
PDF Number Extractor Extract QA serials, BOM IDs with WASM-powered parsing WASM
PDF BOM Extractor Extract BOM tables from CAD PDFs into CSV React + PDF.js

QR & Traceability

Utility Description Tech
QR Master Scan QR/barcodes, generate Wi-Fi/link codes, manage history Camera + QR
3D QR Nameplate Generator Model serialized equipment tags with QR codes in 3D WebGL + QR

Reference & Data Tools

Utility Description Tech
Interactive Thread Atlas Filter ISO, UNC, UNF series; reference drill diameters Data
Engineering Prompt Catalog Browse and export prompt templates for I&C/mechanical workflows HTML + Chart.js
React Table Editor Import, edit, validate CSV/XLSX data in browser React + XLSX

File & Productivity Tools

Utility Description Tech
Batch File Renamer Bulk rename with find/replace, prefixes, numbering, ZIP export React
Folder Structure Builder Design folder trees, export bash/PowerShell scripts React + JSZip
Business Calendar Generator Generate yearly calendars with holidays, export PDF/PNG React + PDF
Whisper Transcriber Transcribe audio/video or microphone input to text and subtitles, fully on-device Transformers.js + WASM/WebGPU

Mini Games

Interactive browser games with engineering themes:

Game Description Tech
Engineering Blueprint NCR Minesweeper-style grid with CAD QA stakes HTML5
Flanges Memory Matrix Memory game with flange tile patterns Phaser
Pressure Vessel Tycoon Factorio-inspired factory builder for pressure vessels Phaser + React
Railroad Bottle Smash Physics sandbox with glass destruction Three.js + cannon-es
Eco Sort: Atmospheric First-person recycling sorting game Three.js + Rapier

Project Structure

cadautoscript.com/
├── docs/                        # MDX documentation
│   ├── intro.md                 # Site overview
│   ├── guides/                  # Deployment, npm, package.json guides
│   └── utilities/               # Per-utility documentation pages
├── blog/                        # Technical blog posts (MDX)
├── src/
│   ├── components/              # React components
│   │   ├── Auth/                # Authentication UI
│   │   ├── MiniGames/           # Game components
│   │   ├── Utilities/           # Utility page wrappers
│   │   └── HomepageFeatures/    # Landing page sections
│   ├── contexts/                # React contexts (auth modal)
│   ├── css/                     # Global styles
│   ├── data/                    # Utility & game metadata
│   │   ├── utilities.ts         # Utility catalog definitions
│   │   └── miniGames.ts         # Game catalog definitions
│   ├── features/                # Feature-specific modules
│   ├── hooks/                   # Custom React hooks
│   ├── lib/                     # External service clients (Supabase)
│   ├── pages/                   # Docusaurus pages
│   │   ├── index.tsx            # Landing page
│   │   ├── utilities/           # Utility page routes
│   │   └── mini-games/          # Game page routes
│   ├── theme/                   # Docusaurus theme overrides
│   └── utils/                   # Helper functions
├── static/
│   ├── utilities/               # Shared utility shell assets (CSS/JS)
│   ├── utility-apps/            # Standalone embedded utility builds
│   ├── mini-games/              # Game static assets
│   ├── img/                     # Images and icons
│   └── vendor/                  # Third-party libraries
├── build/                       # Production output (generated)
├── scripts/                     # Build scripts
│   ├── sitemap-sections.js      # Post-build sitemap generator
│   └── sync-webstep-viewer-embed.js
├── docusaurus.config.ts         # Docusaurus configuration
├── sidebars.ts                  # Documentation sidebar structure
├── tailwind.config.js           # Tailwind CSS configuration
├── tsconfig.json                # TypeScript configuration
└── vercel.json                  # Optional Vercel-compatible settings

Localization

UI strings live in src/i18n/locales/*.ts (6 locales: en, ru, ua, de, es, et). Rule: never hardcode user-facing strings in components — add a key to all six dictionaries and render it with t('section.key') from useI18n().

How completeness is enforced

en.ts exports the TranslationDict type, and every other locale is declared against it (export const de: TranslationDict = {...}). A key missing from any locale is therefore a type error: npm run typecheck fails locally, and CI (.github/workflows/ci.yml) runs the same check on every PR and push to main, so an incomplete translation cannot be merged.

Adding or changing a string

  1. Add the key and English text to src/i18n/locales/en.ts — this updates TranslationDict, and typecheck now lists every locale still missing it.
  2. Add the translated value to the same path in ru.ts, ua.ts, de.ts, es.ts, and et.ts.
  3. Render it with t('section.key'); placeholders use {name} syntax and are passed as the second argument: t('utility.unlockCopy', {name: title}).
  4. Run npm run typecheck before pushing.

Docusaurus-native surfaces

The navbar, footer, docs sidebar, and other theme-owned UI are translated via JSON in i18n/<locale>/**.json instead (regenerate stubs with npm run write-translations). Markdown/MDX content (docs, blog) is localized by mirroring files under i18n/<locale>/docusaurus-plugin-content-*/.

Technology Stack

Core Framework

Technology Version Purpose
Docusaurus 3.10.x Static site generator with MDX support
React 19.2.1 UI component library
TypeScript 5.6 Type-safe JavaScript

Styling

Technology Purpose
Tailwind CSS 4.x Utility-first CSS framework
CSS Modules Scoped component styles
Framer Motion Animation library

3D Graphics & CAD

Technology Purpose
Three.js WebGL 3D rendering
React Three Fiber React renderer for Three.js
@react-three/drei Three.js helpers and abstractions
ReplicAD + OpenCascade.js CAD kernel for STEP/geometry

Physics & Games

Technology Purpose
Rapier (WASM) Physics engine for 3D games
cannon-es Alternative physics engine
Phaser 2D game framework

Document Processing

Technology Purpose
PDF-lib PDF creation and modification
PDF.js PDF parsing and rendering
jsPDF PDF generation
JSZip ZIP file handling
SheetJS (XLSX) Excel file processing

Editor & Code

Technology Purpose
Monaco Editor VS Code editor component

Backend & Analytics

Technology Purpose
Supabase Authentication and database
Vercel Analytics Performance monitoring
Vercel Speed Insights Core Web Vitals tracking

State Management

Technology Purpose
Zustand Lightweight state management

Markdown & Content

Technology Purpose
MDX Markdown with JSX components
remark/rehype plugins Markdown processing
Prism Syntax highlighting

Scripts

Command Description
npm start Start development server with hot reload
npm run build Build production static site to build/
npm run serve Serve production build locally
npm run clear Clear Docusaurus cache
npm run typecheck Run TypeScript type checking
npm run lint Run ESLint over src, api and scripts
npm run sitemap:sections Generate sectioned sitemaps
npm run sync:webstep-viewer Sync WebSTEP viewer embed
npm run sync:whisper-transcriber Build and republish the Whisper Transcriber artifact

Deployment

The site is deployed on Vercel: every push to main triggers a production deployment, and pull requests get preview deployments. CI (.github/workflows/ci.yml) runs typecheck, lint and a full build on every PR.

Manual Deployment

# Build production bundle
npm run build

# Deploy build/ directory to your hosting platform

Environment Variables

Create .env.local for local development:

SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key
AUTH_REDIRECT_URL=http://localhost:3000/auth/callback

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit changes: git commit -m 'Add my feature'
  4. Push to branch: git push origin feature/my-feature
  5. Open a Pull Request

Adding a New Utility

  1. Add utility metadata to src/data/utilities.ts
  2. Add the slug and shell config to src/data/utilityShellPages.tsx
  3. Create page route in src/pages/utilities/
  4. Add documentation in docs/utilities/ plus the five i18n/<locale>/…/utilities/ mirrors, and list it in sidebars.ts and utilities/overview.mdx
  5. Add the catalog name/description to all six src/i18n/locales/*.ts dictionaries
  6. Place standalone build assets in static/utility-apps/<slug>/ if needed

Embedded apps built in their own repository

Utilities too heavy to live in the Docusaurus bundle are built elsewhere and published here as static artifacts. The Whisper Transcriber is the reference implementation of that pipeline:

  1. Tagging a release in YurMil/ws-speech-text builds the bundle, audits it, and attaches a checksummed archive to a GitHub release.
  2. That workflow sends a whisper-transcriber-release repository_dispatch here (secret SITE_DISPATCH_TOKEN, set in the source repository).
  3. .github/workflows/sync-whisper-transcriber.yml downloads the archive, refuses it unless the SHA-256 matches, republishes static/utility-apps/whisper-transcriber/ via scripts/sync-whisper-transcriber.mjs, runs typecheck/lint/build, and opens a pull request.

Nothing is deployed without review, and this repository never builds the app or downloads model weights. The same script publishes from a local checkout during development (npm run sync:whisper-transcriber).

Device capabilities

Device capabilities (camera, microphone) are delegated per utility through the iframeAllow field of UtilityPageConfig, paired with a path-scoped Permissions-Policy rule in vercel.json. Never widen the global policy: the site default stays microphone=(), and only the routes of the utility that needs a device relax it. See whisper-transcriber for the reference wiring.


License

This project is licensed under the MIT License - see LICENSE for details.

About

The idea is to create a knowledge base covering automation methods for mechanical engineers, electrical engineers, technologists, and others who work with various CAD systems or simply face routine engineering tasks.

Resources

License

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors