cyclecad 3.2.1 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CLAUDE.md +155 -1
  2. package/DOCKER-SETUP-VERIFICATION.md +399 -0
  3. package/DOCKER-TESTING.md +463 -0
  4. package/FUSION360_MODULES.md +478 -0
  5. package/FUSION_MODULES_README.md +352 -0
  6. package/INTEGRATION_SNIPPETS.md +608 -0
  7. package/KILLER-FEATURES-DELIVERY.md +469 -0
  8. package/MODULES_SUMMARY.txt +337 -0
  9. package/QUICK_REFERENCE.txt +298 -0
  10. package/README-DOCKER-TESTING.txt +438 -0
  11. package/app/index.html +23 -10
  12. package/app/js/fusion-help.json +1808 -0
  13. package/app/js/help-module-v3.js +1096 -0
  14. package/app/js/killer-features-help.json +395 -0
  15. package/app/js/killer-features.js +1508 -0
  16. package/app/js/modules/fusion-assembly.js +842 -0
  17. package/app/js/modules/fusion-cam.js +785 -0
  18. package/app/js/modules/fusion-data.js +814 -0
  19. package/app/js/modules/fusion-drawing.js +844 -0
  20. package/app/js/modules/fusion-inspection.js +756 -0
  21. package/app/js/modules/fusion-render.js +774 -0
  22. package/app/js/modules/fusion-simulation.js +986 -0
  23. package/app/js/modules/fusion-sketch.js +1044 -0
  24. package/app/js/modules/fusion-solid.js +1095 -0
  25. package/app/js/modules/fusion-surface.js +949 -0
  26. package/app/tests/FUSION_TEST_SUITE.md +266 -0
  27. package/app/tests/README.md +77 -0
  28. package/app/tests/TESTING-CHECKLIST.md +177 -0
  29. package/app/tests/TEST_SUITE_SUMMARY.txt +236 -0
  30. package/app/tests/brep-live-test.html +848 -0
  31. package/app/tests/docker-integration-test.html +811 -0
  32. package/app/tests/fusion-all-tests.html +670 -0
  33. package/app/tests/fusion-assembly-tests.html +461 -0
  34. package/app/tests/fusion-cam-tests.html +421 -0
  35. package/app/tests/fusion-simulation-tests.html +421 -0
  36. package/app/tests/fusion-sketch-tests.html +613 -0
  37. package/app/tests/fusion-solid-tests.html +529 -0
  38. package/app/tests/index.html +453 -0
  39. package/app/tests/killer-features-test.html +509 -0
  40. package/app/tests/run-tests.html +874 -0
  41. package/app/tests/step-import-live-test.html +1115 -0
  42. package/app/tests/test-agent-v3.html +93 -696
  43. package/architecture-dashboard.html +1970 -0
  44. package/docs/API-REFERENCE.md +1423 -0
  45. package/docs/BREP-LIVE-TEST-GUIDE.md +453 -0
  46. package/docs/DEVELOPER-GUIDE-v3.md +795 -0
  47. package/docs/DOCKER-QUICK-TEST.md +376 -0
  48. package/docs/FUSION-FEATURES-GUIDE.md +2513 -0
  49. package/docs/FUSION-TUTORIAL.md +1203 -0
  50. package/docs/INFRASTRUCTURE-GUIDE-INDEX.md +327 -0
  51. package/docs/KEYBOARD-SHORTCUTS.md +402 -0
  52. package/docs/KILLER-FEATURES-INTEGRATION.md +412 -0
  53. package/docs/KILLER-FEATURES-SUMMARY.md +424 -0
  54. package/docs/KILLER-FEATURES-TUTORIAL.md +784 -0
  55. package/docs/KILLER-FEATURES.md +562 -0
  56. package/docs/QUICK-REFERENCE.md +282 -0
  57. package/docs/README-v3-DOCS.md +274 -0
  58. package/docs/TUTORIAL-v3.md +1190 -0
  59. package/docs/architecture-dashboard.html +1970 -0
  60. package/docs/architecture-v3.html +1038 -0
  61. package/linkedin-post-v3.md +58 -0
  62. package/package.json +1 -1
  63. package/scripts/dev-setup.sh +338 -0
  64. package/scripts/docker-health-check.sh +159 -0
  65. package/scripts/integration-test.sh +311 -0
  66. package/scripts/test-docker.sh +515 -0
@@ -0,0 +1,376 @@
1
+ # Docker Quick Test Guide
2
+
3
+ ## Overview
4
+
5
+ This guide walks you through testing the cycleCAD Docker Compose infrastructure locally. The setup includes:
6
+
7
+ - **cyclecad** (port 8080) — Main web application (nginx)
8
+ - **converter** (port 8787) — STEP/IGES to GLB conversion server (FastAPI)
9
+ - **signaling** (port 8788) — WebSocket signaling for real-time collaboration (Node.js)
10
+ - **explodeview** (port 3000) — Optional 3D viewer (nginx, requires profile flag)
11
+
12
+ ## Prerequisites
13
+
14
+ Before starting, ensure you have:
15
+
16
+ - **Docker Desktop** installed and running (macOS/Windows) or **Docker + docker-compose** (Linux)
17
+ - **8 GB RAM** available (converter needs 4GB, app needs 512MB)
18
+ - **Ports 3000, 8080, 8787, 8788 free** (check with `lsof` or `netstat`)
19
+ - **curl** or Postman for testing API endpoints
20
+ - **wscat** for WebSocket testing (optional, install with `npm install -g wscat`)
21
+
22
+ ### Check System Resources
23
+
24
+ ```bash
25
+ # macOS/Linux: check available memory
26
+ free -h # Linux
27
+ vm_stat # macOS
28
+
29
+ # Check if ports are in use
30
+ lsof -i :8080
31
+ lsof -i :8787
32
+ lsof -i :8788
33
+
34
+ # Docker resources check
35
+ docker info | grep -E "Memory|CPUs"
36
+ ```
37
+
38
+ ## Quick Start (3 Minutes)
39
+
40
+ ### 1. Start All Services
41
+
42
+ From the repository root:
43
+
44
+ ```bash
45
+ cd ~/cyclecad
46
+ docker-compose up -d
47
+ ```
48
+
49
+ This pulls images, builds containers, and starts all services in background mode.
50
+
51
+ ### 2. Verify Services Are Running
52
+
53
+ ```bash
54
+ # Check container status
55
+ docker-compose ps
56
+
57
+ # Expected output:
58
+ # NAME STATUS PORTS
59
+ # cyclecad-app Up 30s (healthy) 0.0.0.0:8080->80/tcp
60
+ # cyclecad-converter Up 25s (healthy) 0.0.0.0:8787->8787/tcp
61
+ # cyclecad-signaling Up 20s (healthy) 0.0.0.0:8788->8788/tcp
62
+ ```
63
+
64
+ ### 3. Check Health Endpoints
65
+
66
+ ```bash
67
+ # Web app
68
+ curl -I http://localhost:8080/
69
+
70
+ # Converter service
71
+ curl -I http://localhost:8787/health
72
+
73
+ # Signaling service
74
+ curl -I http://localhost:8788/health
75
+
76
+ # All should return 200 OK
77
+ ```
78
+
79
+ ### 4. Open in Browser
80
+
81
+ - **cycleCAD app:** http://localhost:8080/app/
82
+ - **ExplodeView (if enabled):** http://localhost:3000
83
+
84
+ ## Testing Endpoints
85
+
86
+ ### Web Application
87
+
88
+ ```bash
89
+ # Main app (should return HTML)
90
+ curl -s http://localhost:8080/app/ | head -20
91
+
92
+ # Health check
93
+ curl http://localhost:8080/health
94
+ # Returns: {"status": "ok", "version": "0.8.6"}
95
+ ```
96
+
97
+ ### STEP Conversion Server
98
+
99
+ ```bash
100
+ # Health check
101
+ curl http://localhost:8787/health
102
+ # Returns: {"status": "ok", "queue": 0, "workers": 2}
103
+
104
+ # Convert a STEP file (if you have one)
105
+ curl -X POST http://localhost:8787/convert \
106
+ -F "file=@example.step" \
107
+ -o output.glb
108
+
109
+ # Get conversion metadata
110
+ curl -X POST http://localhost:8787/convert/metadata \
111
+ -F "file=@example.step"
112
+ ```
113
+
114
+ ### WebSocket Signaling
115
+
116
+ ```bash
117
+ # Install wscat if needed
118
+ npm install -g wscat
119
+
120
+ # Connect to signaling server
121
+ wscat -c ws://localhost:8788
122
+
123
+ # In wscat session, type:
124
+ {"method": "ping"}
125
+ {"method": "join_room", "room": "test-room"}
126
+ {"method": "send_message", "data": {"text": "hello"}}
127
+
128
+ # Press Ctrl+C to exit
129
+ ```
130
+
131
+ ## Viewing Logs
132
+
133
+ ```bash
134
+ # View all logs (last 50 lines)
135
+ docker-compose logs --tail 50
136
+
137
+ # Follow logs in real-time
138
+ docker-compose logs -f
139
+
140
+ # Follow specific service logs
141
+ docker-compose logs -f converter
142
+
143
+ # View last 100 lines from cyclecad service
144
+ docker-compose logs --tail 100 cyclecad
145
+
146
+ # Filter by timestamp (last 30 minutes)
147
+ docker-compose logs --since 30m
148
+
149
+ # Save logs to file
150
+ docker-compose logs > docker-logs.txt
151
+ ```
152
+
153
+ ## Troubleshooting
154
+
155
+ ### Port Already in Use
156
+
157
+ If you get "Address already in use" errors:
158
+
159
+ ```bash
160
+ # Find what's using the port
161
+ lsof -i :8080
162
+ lsof -i :8787
163
+
164
+ # Kill the process
165
+ kill -9 <PID>
166
+
167
+ # Or change ports in docker-compose.yml
168
+ # Edit the "ports:" section, e.g., "8090:80" instead of "8080:80"
169
+ ```
170
+
171
+ ### Out of Memory
172
+
173
+ If the converter crashes with out-of-memory errors:
174
+
175
+ ```bash
176
+ # Check Docker Desktop memory allocation
177
+ docker info | grep Memory
178
+
179
+ # Increase memory:
180
+ # macOS/Windows: Open Docker Desktop > Settings > Resources > Memory
181
+ # Set to 8GB or more
182
+
183
+ # Or reduce converter container limit in docker-compose.yml:
184
+ # limits:
185
+ # memory: 2G # Changed from 4G
186
+ # reservations:
187
+ # memory: 1G # Changed from 2G
188
+ ```
189
+
190
+ ### Build Fails or Images Corrupt
191
+
192
+ ```bash
193
+ # Rebuild all images from scratch
194
+ docker-compose build --no-cache
195
+
196
+ # Remove dangling images (free up space)
197
+ docker image prune
198
+
199
+ # Full clean (removes stopped containers, unused networks)
200
+ docker system prune
201
+ ```
202
+
203
+ ### Service Won't Start / Health Check Failing
204
+
205
+ ```bash
206
+ # View detailed container logs
207
+ docker-compose logs converter
208
+
209
+ # Inspect service health history
210
+ docker-compose ps
211
+
212
+ # Manually check if service is responding
213
+ docker-compose exec converter curl http://localhost:8787/health
214
+
215
+ # Shell into container for debugging
216
+ docker-compose exec cyclecad sh
217
+ # Inside container:
218
+ ps aux # View running processes
219
+ curl localhost # Test from inside
220
+ exit
221
+ ```
222
+
223
+ ### Converter Hangs on Large STEP Files
224
+
225
+ The converter can take 5-10 minutes for 100MB+ files:
226
+
227
+ ```bash
228
+ # Monitor progress via logs
229
+ docker-compose logs -f converter
230
+
231
+ # If it truly hangs (no output for 5+ minutes), increase timeout:
232
+ # In docker-compose.yml, under converter healthcheck:
233
+ # timeout: 30s # Changed from 10s
234
+ ```
235
+
236
+ ## Performance Testing
237
+
238
+ ### Benchmark Conversion Speed
239
+
240
+ ```bash
241
+ # Time a single conversion
242
+ time curl -X POST http://localhost:8787/convert \
243
+ -F "file=@large-file.step" \
244
+ -o output.glb
245
+
246
+ # Example output:
247
+ # real 2m 15s (2 minutes 15 seconds)
248
+ # user 0m 0.123s
249
+ # sys 0m 0.045s
250
+ ```
251
+
252
+ ### Load Test Signaling
253
+
254
+ ```bash
255
+ # With Apache Bench (install: brew install httpd)
256
+ ab -n 100 -c 10 http://localhost:8080/
257
+
258
+ # Expected: ~1000-2000 requests/sec for the web server
259
+ ```
260
+
261
+ ### Monitor Resource Usage
262
+
263
+ ```bash
264
+ # View real-time CPU and memory per container
265
+ docker stats
266
+
267
+ # Specific service
268
+ docker stats cyclecad-converter
269
+
270
+ # Example output:
271
+ # CONTAINER CPU % MEM USAGE / LIMIT
272
+ # cyclecad-converter 45.2% 2.1G / 4G
273
+ # cyclecad-app 0.5% 45M / 512M
274
+ # cyclecad-signaling 1.2% 95M / 512M
275
+ ```
276
+
277
+ ## Environment Variables
278
+
279
+ You can override default settings without editing docker-compose.yml:
280
+
281
+ ```bash
282
+ # Start with custom settings
283
+ CONVERTER_URL=http://localhost:8787 \
284
+ MAX_FILE_SIZE=1000 \
285
+ docker-compose up -d
286
+
287
+ # Or create a .env file
288
+ cat > .env << EOF
289
+ CONVERTER_URL=http://converter:8787
290
+ SIGNALING_URL=ws://signaling:8788
291
+ LOG_LEVEL=debug
292
+ WORKERS=4
293
+ MAX_FILE_SIZE=1000
294
+ EOF
295
+
296
+ docker-compose up -d
297
+ ```
298
+
299
+ Available variables:
300
+ - `CONVERTER_URL` — URL of converter service (default: `http://converter:8787`)
301
+ - `SIGNALING_URL` — URL of signaling service (default: `ws://signaling:8788`)
302
+ - `LOG_LEVEL` — Logging level: `debug`, `info`, `warn`, `error` (default: `info`)
303
+ - `WORKERS` — Number of converter workers (default: 2)
304
+ - `MAX_FILE_SIZE` — Max file size in MB (default: 500)
305
+ - `TIMEOUT` — Request timeout in seconds (default: 300)
306
+
307
+ ## Advanced: Starting with ExplodeView
308
+
309
+ To include the ExplodeView 3D viewer service:
310
+
311
+ ```bash
312
+ docker-compose --profile with-explodeview up -d
313
+
314
+ # This will start all 4 services instead of 3
315
+ docker-compose ps
316
+
317
+ # Open ExplodeView at http://localhost:3000
318
+ ```
319
+
320
+ ## Cleanup
321
+
322
+ ### Stop All Services (Keep Data)
323
+
324
+ ```bash
325
+ docker-compose stop
326
+
327
+ # Restart without rebuilding
328
+ docker-compose start
329
+ ```
330
+
331
+ ### Stop and Remove Containers (Keep Images)
332
+
333
+ ```bash
334
+ docker-compose down
335
+ ```
336
+
337
+ ### Full Cleanup (Remove Everything)
338
+
339
+ ```bash
340
+ # Remove all containers, networks, and volumes
341
+ docker-compose down -v
342
+
343
+ # Also remove built images (if you want fresh builds)
344
+ docker-compose down -v --rmi all
345
+ ```
346
+
347
+ ## Next Steps
348
+
349
+ Once services are running:
350
+
351
+ 1. **Open the app:** http://localhost:8080/app/
352
+ 2. **Test sketch tools:** Create a 2D rectangle, extrude it
353
+ 3. **Import a STEP file:** Use the import dialog (if you have a .step file)
354
+ 4. **Check collaboration:** Open multiple browser tabs, edit in one tab, see changes in others
355
+ 5. **Export geometry:** Draw something and export as STL/glTF
356
+ 6. **View logs:** `docker-compose logs -f` to watch real-time activity
357
+
358
+ ## Common Issues Reference
359
+
360
+ | Issue | Solution |
361
+ |-------|----------|
362
+ | `Cannot connect to Docker` | Start Docker Desktop / `sudo systemctl start docker` (Linux) |
363
+ | `Port 8080 already in use` | Change port in docker-compose.yml or kill process using port |
364
+ | `Converter out of memory` | Increase Docker memory to 8GB |
365
+ | `Health check failing` | Check logs: `docker-compose logs converter` |
366
+ | `STEP file not converting` | Check file size (<500MB default), check logs for errors |
367
+ | `Can't connect to signaling` | Ensure port 8788 is free, check firewall |
368
+ | `Services fail to start` | Run `docker-compose build --no-cache` to rebuild |
369
+
370
+ ## Getting Help
371
+
372
+ - **View full logs:** `docker-compose logs --all`
373
+ - **Inspect container details:** `docker inspect cyclecad-app`
374
+ - **Check Docker version:** `docker --version`
375
+ - **Full docker-compose reference:** See `docker-compose.yml` comments or run `docker-compose --help`
376
+