cyclecad 3.0.0 → 3.1.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.
- package/BILLING-IMPLEMENTATION-SUMMARY.md +425 -0
- package/BILLING-INDEX.md +293 -0
- package/BILLING-INTEGRATION-GUIDE.md +414 -0
- package/COLLABORATION-INDEX.md +440 -0
- package/COLLABORATION-SYSTEM-SUMMARY.md +548 -0
- package/DOCKER-BUILD-MANIFEST.txt +483 -0
- package/DOCKER-FILES-REFERENCE.md +440 -0
- package/DOCKER-INFRASTRUCTURE.md +475 -0
- package/DOCKER-README.md +435 -0
- package/Dockerfile +33 -55
- package/PWA-FILES-CREATED.txt +350 -0
- package/QUICK-START-TESTING.md +126 -0
- package/STEP-IMPORT-QUICKSTART.md +347 -0
- package/STEP-IMPORT-SYSTEM-SUMMARY.md +502 -0
- package/app/css/mobile.css +1074 -0
- package/app/icons/generate-icons.js +203 -0
- package/app/js/billing-ui.js +990 -0
- package/app/js/brep-kernel.js +933 -981
- package/app/js/collab-client.js +750 -0
- package/app/js/mobile-nav.js +623 -0
- package/app/js/mobile-toolbar.js +476 -0
- package/app/js/modules/billing-module.js +724 -0
- package/app/js/modules/step-module-enhanced.js +938 -0
- package/app/js/offline-manager.js +705 -0
- package/app/js/responsive-init.js +360 -0
- package/app/js/touch-handler.js +429 -0
- package/app/manifest.json +211 -0
- package/app/offline.html +508 -0
- package/app/sw.js +571 -0
- package/app/tests/billing-tests.html +779 -0
- package/app/tests/brep-tests.html +980 -0
- package/app/tests/collab-tests.html +743 -0
- package/app/tests/mobile-tests.html +1299 -0
- package/app/tests/pwa-tests.html +1134 -0
- package/app/tests/step-tests.html +1042 -0
- package/app/tests/test-agent-v3.html +719 -0
- package/docker-compose.yml +225 -0
- package/docs/BILLING-HELP.json +260 -0
- package/docs/BILLING-README.md +639 -0
- package/docs/BILLING-TUTORIAL.md +736 -0
- package/docs/BREP-HELP.json +326 -0
- package/docs/BREP-TUTORIAL.md +802 -0
- package/docs/COLLABORATION-HELP.json +228 -0
- package/docs/COLLABORATION-TUTORIAL.md +818 -0
- package/docs/DOCKER-HELP.json +224 -0
- package/docs/DOCKER-TUTORIAL.md +974 -0
- package/docs/MOBILE-HELP.json +243 -0
- package/docs/MOBILE-RESPONSIVE-README.md +378 -0
- package/docs/MOBILE-TUTORIAL.md +747 -0
- package/docs/PWA-HELP.json +228 -0
- package/docs/PWA-README.md +662 -0
- package/docs/PWA-TUTORIAL.md +757 -0
- package/docs/STEP-HELP.json +481 -0
- package/docs/STEP-IMPORT-TUTORIAL.md +824 -0
- package/docs/TESTING-GUIDE.md +528 -0
- package/docs/TESTING-HELP.json +182 -0
- package/fusion-vs-cyclecad.html +1771 -0
- package/nginx.conf +237 -0
- package/package.json +1 -1
- package/server/Dockerfile.converter +51 -0
- package/server/Dockerfile.signaling +28 -0
- package/server/billing-server.js +487 -0
- package/server/converter-enhanced.py +528 -0
- package/server/requirements-converter.txt +29 -0
- package/server/signaling-server.js +801 -0
- package/tests/docker-tests.sh +389 -0
package/nginx.conf
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# cycleCAD Production Nginx Configuration
|
|
2
|
+
# Optimized for performance, security, and cross-origin support
|
|
3
|
+
#
|
|
4
|
+
# Key features:
|
|
5
|
+
# - Gzip compression on all text-like formats
|
|
6
|
+
# - CORS headers for all origins
|
|
7
|
+
# - COOP/COEP headers for SharedArrayBuffer (Web Workers)
|
|
8
|
+
# - Aggressive caching for static assets (1 year for immutable content)
|
|
9
|
+
# - Security headers (CSP, X-Frame-Options, etc.)
|
|
10
|
+
# - SPA routing (all non-API routes fall through to index.html)
|
|
11
|
+
# - Max upload size: 500MB (for STEP files)
|
|
12
|
+
# - Proper WASM MIME type + cache headers
|
|
13
|
+
# - Gzip on responses to reduce bandwidth
|
|
14
|
+
|
|
15
|
+
upstream cyclecad_upstream {
|
|
16
|
+
server cyclecad:80;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
upstream converter_upstream {
|
|
20
|
+
server converter:8787;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
upstream signaling_upstream {
|
|
24
|
+
server signaling:8788;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
server {
|
|
28
|
+
listen 80 default_server;
|
|
29
|
+
server_name _;
|
|
30
|
+
|
|
31
|
+
# Root directory for all static files
|
|
32
|
+
root /usr/share/nginx/html;
|
|
33
|
+
index index.html;
|
|
34
|
+
|
|
35
|
+
# Max upload size (for STEP file imports)
|
|
36
|
+
client_max_body_size 500M;
|
|
37
|
+
|
|
38
|
+
# ========== GZIP COMPRESSION ==========
|
|
39
|
+
# Enable gzip with aggressive settings
|
|
40
|
+
gzip on;
|
|
41
|
+
gzip_vary on;
|
|
42
|
+
gzip_min_length 500;
|
|
43
|
+
gzip_types
|
|
44
|
+
text/plain
|
|
45
|
+
text/css
|
|
46
|
+
text/javascript
|
|
47
|
+
text/xml
|
|
48
|
+
text/x-component
|
|
49
|
+
text/x-cross-domain-policy
|
|
50
|
+
application/javascript
|
|
51
|
+
application/json
|
|
52
|
+
application/xml
|
|
53
|
+
application/rss+xml
|
|
54
|
+
application/atom+xml
|
|
55
|
+
application/vnd.ms-fontobject
|
|
56
|
+
font/truetype
|
|
57
|
+
font/opentype
|
|
58
|
+
application/octet-stream
|
|
59
|
+
image/svg+xml
|
|
60
|
+
model/gltf-binary
|
|
61
|
+
model/gltf+json
|
|
62
|
+
image/x-icon;
|
|
63
|
+
gzip_disable "msie6";
|
|
64
|
+
gzip_comp_level 6;
|
|
65
|
+
gzip_proxied any;
|
|
66
|
+
|
|
67
|
+
# ========== CROSS-ORIGIN HEADERS ==========
|
|
68
|
+
# Allow CORS for all origins
|
|
69
|
+
add_header Access-Control-Allow-Origin "*" always;
|
|
70
|
+
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS, PUT, DELETE, PATCH" always;
|
|
71
|
+
add_header Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With, X-API-Key" always;
|
|
72
|
+
|
|
73
|
+
# Cross-Origin headers for SharedArrayBuffer (Web Workers)
|
|
74
|
+
# COOP (Cross-Origin-Opener-Policy) isolates browsing context
|
|
75
|
+
# COEP (Cross-Origin-Embedder-Policy) requires opt-in for cross-origin resources
|
|
76
|
+
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
|
77
|
+
add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
|
78
|
+
|
|
79
|
+
# ========== SECURITY HEADERS ==========
|
|
80
|
+
# Prevent MIME type sniffing
|
|
81
|
+
add_header X-Content-Type-Options "nosniff" always;
|
|
82
|
+
|
|
83
|
+
# Prevent clickjacking (allow embedding only from same origin)
|
|
84
|
+
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
85
|
+
|
|
86
|
+
# XSS protection (legacy)
|
|
87
|
+
add_header X-XSS-Protection "1; mode=block" always;
|
|
88
|
+
|
|
89
|
+
# Content Security Policy (permissive for AI features + external APIs)
|
|
90
|
+
add_header Content-Security-Policy "default-src 'self' https:; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://ai.google.dev; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; img-src 'self' data: https:; font-src 'self' data: https://fonts.googleapis.com https://fonts.gstatic.com; connect-src 'self' https: wss: ws:; worker-src 'self' blob:; manifest-src 'self';" always;
|
|
91
|
+
|
|
92
|
+
# Referrer policy
|
|
93
|
+
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
94
|
+
|
|
95
|
+
# ========== CACHING STRATEGY ==========
|
|
96
|
+
|
|
97
|
+
# Immutable assets (versioned/hashed filenames) — cache forever
|
|
98
|
+
location ~* \.(js|css|ico|png|jpg|jpeg|gif|svg|webp|ttf|woff|woff2|eot|otf)$ {
|
|
99
|
+
expires 1y;
|
|
100
|
+
add_header Cache-Control "public, immutable";
|
|
101
|
+
add_header X-Cache-Status "HIT";
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
# WASM files — cache aggressively (immutable after compilation)
|
|
105
|
+
location ~* \.wasm$ {
|
|
106
|
+
expires 1y;
|
|
107
|
+
add_header Cache-Control "public, immutable";
|
|
108
|
+
add_header Content-Type "application/wasm";
|
|
109
|
+
add_header X-Content-Type-Options "nosniff";
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
# 3D model files — cache for 7 days (reasonable for non-versioned assets)
|
|
113
|
+
location ~* \.(glb|gltf|stl|obj|mtl)$ {
|
|
114
|
+
expires 7d;
|
|
115
|
+
add_header Cache-Control "public, must-revalidate";
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
# Presentation files — cache for 7 days
|
|
119
|
+
location ~* \.(pptx|docx|xlsx|pdf)$ {
|
|
120
|
+
expires 7d;
|
|
121
|
+
add_header Cache-Control "public, must-revalidate";
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
# HTML files (SPA entry points) — no cache, always validate
|
|
125
|
+
location ~* \.html$ {
|
|
126
|
+
expires -1;
|
|
127
|
+
add_header Cache-Control "public, must-revalidate, max-age=0";
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
# JSON manifest files — short cache (5 minutes)
|
|
131
|
+
location ~* \.json$ {
|
|
132
|
+
expires 5m;
|
|
133
|
+
add_header Cache-Control "public, must-revalidate";
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
# Service worker — no cache
|
|
137
|
+
location /sw.js {
|
|
138
|
+
expires -1;
|
|
139
|
+
add_header Cache-Control "public, must-revalidate, max-age=0";
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
# ========== ROUTING ==========
|
|
143
|
+
|
|
144
|
+
# Health check endpoint (always accessible)
|
|
145
|
+
location = /health {
|
|
146
|
+
access_log off;
|
|
147
|
+
return 200 '{"status":"ok","app":"cyclecad","version":"0.8.6","timestamp":"'$(date -u +%s)'"}';
|
|
148
|
+
add_header Content-Type "application/json";
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
# API endpoints (pass through to upstream services, no caching)
|
|
152
|
+
location /api/ {
|
|
153
|
+
proxy_pass http://converter_upstream;
|
|
154
|
+
proxy_set_header Host $host;
|
|
155
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
156
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
157
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
158
|
+
proxy_buffering off;
|
|
159
|
+
proxy_request_buffering off;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
# Converter service (for STEP → GLB conversion)
|
|
163
|
+
location /converter/ {
|
|
164
|
+
proxy_pass http://converter_upstream/;
|
|
165
|
+
proxy_set_header Host $host;
|
|
166
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
167
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
168
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
169
|
+
proxy_read_timeout 300s;
|
|
170
|
+
proxy_buffering off;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
# Signaling service (for real-time collaboration)
|
|
174
|
+
location /signal/ {
|
|
175
|
+
proxy_pass http://signaling_upstream/;
|
|
176
|
+
proxy_http_version 1.1;
|
|
177
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
178
|
+
proxy_set_header Connection "upgrade";
|
|
179
|
+
proxy_set_header Host $host;
|
|
180
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
181
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
182
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
183
|
+
proxy_read_timeout 3600s;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
# WebSocket upgrade for real-time features
|
|
187
|
+
location /ws/ {
|
|
188
|
+
proxy_pass http://signaling_upstream/ws/;
|
|
189
|
+
proxy_http_version 1.1;
|
|
190
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
191
|
+
proxy_set_header Connection "upgrade";
|
|
192
|
+
proxy_set_header Host $host;
|
|
193
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
194
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
195
|
+
proxy_read_timeout 3600s;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
# CAD app — SPA routing (all routes fall through to index.html)
|
|
199
|
+
location /app/ {
|
|
200
|
+
try_files $uri $uri/ /app/index.html;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
# Root — SPA routing (landing page is also an SPA)
|
|
204
|
+
location / {
|
|
205
|
+
try_files $uri $uri/ /index.html;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
# Deny access to hidden files/directories
|
|
209
|
+
location ~ /\. {
|
|
210
|
+
deny all;
|
|
211
|
+
access_log off;
|
|
212
|
+
log_not_found off;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
# Redirect HTTP to HTTPS in production (use with Let's Encrypt)
|
|
217
|
+
# Uncomment this section when HTTPS is enabled:
|
|
218
|
+
#
|
|
219
|
+
# server {
|
|
220
|
+
# listen 80 default_server;
|
|
221
|
+
# server_name _;
|
|
222
|
+
# return 301 https://$host$request_uri;
|
|
223
|
+
# }
|
|
224
|
+
#
|
|
225
|
+
# server {
|
|
226
|
+
# listen 443 ssl http2 default_server;
|
|
227
|
+
# server_name _;
|
|
228
|
+
#
|
|
229
|
+
# ssl_certificate /etc/letsencrypt/live/cyclecad.com/fullchain.pem;
|
|
230
|
+
# ssl_certificate_key /etc/letsencrypt/live/cyclecad.com/privkey.pem;
|
|
231
|
+
#
|
|
232
|
+
# ssl_protocols TLSv1.2 TLSv1.3;
|
|
233
|
+
# ssl_ciphers HIGH:!aNULL:!MD5;
|
|
234
|
+
# ssl_prefer_server_ciphers on;
|
|
235
|
+
#
|
|
236
|
+
# # ... rest of server config ...
|
|
237
|
+
# }
|
package/package.json
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# cycleCAD STEP → GLB Converter Service
|
|
2
|
+
# FastAPI server for server-side STEP/IGES import
|
|
3
|
+
#
|
|
4
|
+
# Build: docker build -f server/Dockerfile.converter -t cyclecad-converter:latest .
|
|
5
|
+
# Run: docker run -p 8787:8787 --memory 4g cyclecad-converter:latest
|
|
6
|
+
# Health: curl http://localhost:8787/health
|
|
7
|
+
#
|
|
8
|
+
# Handles:
|
|
9
|
+
# - STEP (.step, .stp) file import via CadQuery
|
|
10
|
+
# - IGES (.iges, .igs) file import
|
|
11
|
+
# - GLB/glTF 2.0 export
|
|
12
|
+
# - Metadata extraction (parts, assemblies, properties)
|
|
13
|
+
# - Large file processing (up to 500MB)
|
|
14
|
+
# - Adaptive mesh deflection for performance
|
|
15
|
+
|
|
16
|
+
FROM python:3.11-slim
|
|
17
|
+
|
|
18
|
+
# Install system dependencies
|
|
19
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
20
|
+
build-essential \
|
|
21
|
+
libgl1 \
|
|
22
|
+
libglu1-mesa \
|
|
23
|
+
libxrender1 \
|
|
24
|
+
libxkbcommon0 \
|
|
25
|
+
curl \
|
|
26
|
+
git \
|
|
27
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
28
|
+
|
|
29
|
+
# Set working directory
|
|
30
|
+
WORKDIR /app
|
|
31
|
+
|
|
32
|
+
# Copy requirements and install Python dependencies
|
|
33
|
+
COPY server/requirements-converter.txt .
|
|
34
|
+
RUN pip install --no-cache-dir -r requirements-converter.txt
|
|
35
|
+
|
|
36
|
+
# Copy converter script
|
|
37
|
+
COPY server/converter.py .
|
|
38
|
+
|
|
39
|
+
# Create non-root user for security
|
|
40
|
+
RUN useradd -m -u 1000 converter && chown -R converter:converter /app
|
|
41
|
+
USER converter
|
|
42
|
+
|
|
43
|
+
# Expose port
|
|
44
|
+
EXPOSE 8787
|
|
45
|
+
|
|
46
|
+
# Health check
|
|
47
|
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
|
|
48
|
+
CMD curl -f http://localhost:8787/health || exit 1
|
|
49
|
+
|
|
50
|
+
# Start FastAPI server
|
|
51
|
+
CMD ["uvicorn", "converter:app", "--host", "0.0.0.0", "--port", "8787", "--workers", "2"]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
FROM node:20-alpine
|
|
2
|
+
|
|
3
|
+
LABEL maintainer="vvlars <vvlars@googlemail.com>"
|
|
4
|
+
LABEL description="cycleCAD WebSocket Signaling Server for real-time collaboration"
|
|
5
|
+
|
|
6
|
+
WORKDIR /app
|
|
7
|
+
|
|
8
|
+
# Install dependencies
|
|
9
|
+
RUN apk add --no-cache curl
|
|
10
|
+
|
|
11
|
+
# Copy package files
|
|
12
|
+
COPY package.json ./
|
|
13
|
+
|
|
14
|
+
# Install Node dependencies
|
|
15
|
+
RUN npm ci --only=production
|
|
16
|
+
|
|
17
|
+
# Copy signaling server
|
|
18
|
+
COPY signaling-server.js ./
|
|
19
|
+
|
|
20
|
+
# Expose WebSocket and HTTP ports
|
|
21
|
+
EXPOSE 8788
|
|
22
|
+
|
|
23
|
+
# Health check
|
|
24
|
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
25
|
+
CMD curl -f http://localhost:8788/health || exit 1
|
|
26
|
+
|
|
27
|
+
# Run signaling server
|
|
28
|
+
CMD ["node", "signaling-server.js"]
|