How sarthurx/smorrery-webapp works
Project type and purpose
• This is a single-page web application (SPA) built with Vue.js 3 and Vite.
• Purpose: provide an interactive 3D “orrery” (solar system simulator) with five distinct modules (Education, Events, Lab, Challenge, Tour) that fetch real-time orbital data from NASA APIs and render scenes via WebGL.
File structure
• Top-level config and metadata: package.json, vite.config.mjs, .eslintrc.js, .gitignore, README.md.
• public/: static entry point (index.html), fallback pages, bundled scripts/styles/textures for the orrery.
• src/: main application source
• App.vue, main.js – application shell and mount point
• assets/: images, audio, mock_api JSON for local development
• components/: reusable UI components (headers, footers, topic pages)
• pages/: route-level views corresponding to the five modules and other pages
• layouts/: global layout wrappers
• router/: Vue Router configuration
• stores/: Pinia or Vuex state modules (app.js, index.js)
• plugins/: third-party plugin initialization (Vuetify)
• styles/: global SCSS settings
• utils/: two major sub-folders
– APIRequests: abstraction over calls to NASA SBDB/CAD endpoints
– SpaceScene: custom 3D engine scaffolding (core, components, topic controllers)
Key architectural insights from README
• Real-time orbital calculations using NASA’s SBDB and CAD APIs.
• Five functional modules, each with its own 3D scene or UI flow.
• Static hosting via GitHub Pages; no server-side code in this repo.
a. Main components
• User’s Browser (Client)
• Vue SPA Container
– Router & Pages (Education, Events, Lab, Challenge, Tour)
– Shared UI Components (headers, nav, footers)
– State Store (Pinia/Vuex)
– Plugins (Vuetify, any others)
• Utilities
– API Layer (utils/APIRequests)
– 3D Engine (utils/SpaceScene: core + components + topic controllers)
• Static Assets
– public/static (scripts, styles, textures)
– src/assets (images, audio, mock_api)
• External Services
– NASA SBDB API
– NASA CAD API
b. Relationships & interactions
• On page navigation, Router loads Pages → uses Components → binds to State Store.
• Page logic calls API Layer → external REST endpoints → data flows into Store.
• 3D Engine reads scene configuration + dynamic data → renders WebGL canvas in Components.
• User actions (mouse, keyboard) feed into 3D Engine controls and Store.
c. Architectural patterns and principles
• Component-based UI (Vue single-file components) – MVVM style
• Client-side routing (Vue Router)
• Centralized state management (Pinia/Vuex)
• Modular utility libraries (clear separation of API logic vs. 3D logic)
• Static-only deployment (no backend code) – progressive enhancement
d. Key technologies
• Vue 3 + Composition API
• Vite (dev server & build)
• Pinia or Vuex for state
• Vue Router
• Vuetify
• WebGL (via Three.js–style abstractions in utils/SpaceScene)
• NASA REST APIs