How g1213123/trafficsign works
Project type and purpose
• Road Sign Factory is a front-end–only, single-page web application for designing and exporting traffic signs.
• It uses HTML/CSS/JS in the browser, is bundled by Webpack, and is served as static assets (app.yaml for Google App Engine).
Main architectural layers / components
a. Browser/UI Layer
• index.html – host page
• css/ – styles (layout, fonts, templates)
• templates/ – JSON and markdown starter designs
b. JavaScript Application Layer (bundled by Webpack)
• canvas/ – drawing engine, event handlers (mouse, keyboard, touch), context menu, prompts
• sidebar/ – UI panels (properties, export, templates, settings, etc.)
• dxf/ – client-side DXF export library
• preload.js, main.js – app initialization and module orchestration
• tests/ – unit test harness
c. Build & Deployment
• webpack.config.js, package.json – bundling and npm scripts (build, test)
• app.yaml, .gcloudignore – configuration for Google App Engine static hosting
d. External Dependencies & Services
• dxf-bundle.js – DXF export
• Google App Engine – static file hosting
• External font repositories / CDNs
Data and Control Flow
1. Browser requests HTML/CSS/JS bundle from GAE (HTTP GET).
2. Webpack bundle loads, runs preload.js → main.js to wire up canvas + sidebar modules.
3. User actions (canvas clicks, sidebar input) → event handlers → update object models → re-render canvas.
4. Export action → dxf module or canvas-to-image → triggers file download in browser.
5. Templates loaded on demand via AJAX (fetch JSON).
Architectural patterns & design principles to call out
• MVC-style separation: view (canvas, sidebar), model (objects), controller (event handlers in canvas/ and main.js)
• Modular folder structure for scalability and maintainability
• Client-side only: no server-side application logic beyond static file serving
• Build pipeline managed by Webpack and npm