diff --git a/site 1.1 description b/site 1.1 description new file mode 100644 index 0000000..0278770 --- /dev/null +++ b/site 1.1 description @@ -0,0 +1,72 @@ +Project Description +What it is + +A single-file CNC retrofit parts e-commerce application with zero external frameworks. It uses vanilla JavaScript, custom CSS, Web Crypto API, and displays production-grade PHP backend code for reference. The entire security engine runs client-side with no dependencies — no Python, no WebAssembly, no build tools, no npm packages. +Technology stack (and why each was chosen) +Layer + +Technology + +Rationale +Layout/CSS Custom CSS with variables Tailwind was removed because every element already used inline styles and custom classes — it was a dead 300KB dependency adding nothing +Logic Vanilla JS (ES6) No framework needed for a single-page app with five views. IIFE pattern for SecurityEngine to avoid polluting global scope. No let/const in loops to avoid closure bugs. No arrow functions in hot paths for clarity. +Cryptography crypto.subtle.digest('SHA-256') Uses the operating system's native crypto provider — stronger than any software implementation. Falls back to a 70-line pure-JS SHA-256 on file:// contexts where crypto.subtle is unavailable +CSRF tokens crypto.getRandomValues() Same CSPRNG the browser uses for TLS. 128 bits of entropy, 1-hour expiry, rotated after every order +Fonts Space Grotesk + JetBrains Mono Display and monospace. No Inter, no Roboto +Icons Font Awesome 6 Single CDN, no alternative needed +Images Picsum (seeded URLs) Placeholder images — production would use real product photography + + +Security architecture + +The SecurityEngine class implements seven distinct security functions: + +1. SHA-256 hash-chained audit log. Every logged event includes a prevHash field pointing to the previous entry's hash. The verifyChain() method walks the entire chain, removes each stored hash, recomputes it from the canonical JSON (keys sorted), and compares. If any entry has been tampered with — even a single character in the details — the chain breaks at that point and reports the index. The chain is persisted to localStorage after every write and restored on page load. + +2. Input sanitization. Nine regex patterns match