How angrytribble/star-trek-attack-wing-utopia works
Project type and purpose
• This is a front-end-only, single-page application (SPA) called “Utopia: A Fleet Builder for Star Trek Attack Wing.”
• It uses AngularJS (v1.x), plain HTML/CSS/JS, and a Grunt-based build pipeline. The output is a static site (in staw-utopia/) suitable for GitHub Pages or any static host.
File structure
• Top-level:
• src/ holds all source assets—HTML entry points, CSS, JS (app code + third-party libs), templates, data, images, fonts, PDFs.
• gruntfile.js + package.json drive the build: transforms, concatenates, and outputs into staw-utopia/.
• README.md describes setup and purpose.
• Within src/:
• css/: app and theme styles, organized into common/, lib/, and page-specific sheets.
• js/: app code under common/components/, common/services/, common/filters/, plus entry scripts (utopia-fleet-builder.js, etc.) and third-party libs (angular.js, jquery.js).
• templates/: Angular partials for cards, fleet builder, search, export, etc.
• data/: static data modules (.js) and JSON backups under backup/. The build process likely compiles/parses them into a single data.json.
• assets/: PDFs, images, fonts used in UI or downloads.
README for additional insights
• Build prerequisites: Node.js and Grunt CLI.
• npm start generates the entire static site under staw-utopia/, including data/data.json.
• Generated files are not edited manually.
Main components and their interactions
a. Build Pipeline (Developer PC)
• Inputs: src/ directory.
• Tools: Node.js, Grunt tasks (concat, minify, copy, JSON build).
• Outputs: staw-utopia/ (static site).
b. Static Hosting / Deployment
• staw-utopia/ artifacts deployed to a static web server (GitHub Pages, S3, etc.).
c. Client-side SPA (Browser)
• Entry point: index.html.
• AngularJS app loads core scripts (Angular, Utopia app code, libs), CSS, fonts, images.
• Data service fetches data.json (static file) and exposes it to UI.
• Components render fleet builder, mission database, set viewer, etc., using HTML templates.
• Filters and services manipulate data for search, export, drag-and-drop, tooltips.
Key architectural patterns and design principles
• Single-page, component-based front-end (AngularJS 1.x).
• Clear separation of concerns: services (data loading), filters (data transformation), components (UI widgets), templates (view).
• Static data ingestion—no runtime backend; JSON is built at compile time.
• Build pipeline automates asset bundling and site generation.
Relevant technologies, frameworks, libraries
• AngularJS 1.x, Angular-sanitize
• jQuery, Bootstrap (JS + CSS)
• Grunt.js (task runner)
• Node.js/npm (package management)
• JSON data modules and backups