How max60213/starmap works
Project type and purpose
• This is a single-page application (SPA) built with React and Vite.
• It’s an educational/content site delivering photography/video tutorials and interactive 3D visualizations (via three-js).
• All content (JSON article data, images, videos) lives in the public folder.
File structure
• Top-level config: package.json, vite.config.js, ESLint config.
• public/: static assets (HTML shell, media, article JSON).
• src/: application source code
• main.jsx & App.jsx: entry point and root component
• Landing, Loading, Scene: high-level route targets
• components/: reusable UI pieces (pages/, article/, GalaxyContext)
• three-js/: custom 3D helpers and scene builder
• css/ and css files under components: SCSS styles for global and feature-specific styling
• No backend folder—this is purely front-end, content-First SPA.
Insights from README
• Confirms minimal Vite + React setup with HMR & ESLint.
• No server-side logic—builds down to static assets for hosting.
a) Main components
• Browser (User)
• Static Web Host / CDN (serves index.html, JS bundle, media)
• React SPA
– Router / PathChecker
– Page Components (Landing, Slider, View, Window, Article pages)
– GalaxyContext & three-js engine
– Asset loader (fetch JSON, images, videos from public/)
• Build Pipeline
– Node.js / npm scripts
– Vite bundler (JSX → JS, SCSS → CSS)
– ESLint plugin
b) Relationships & interactions
• Browser → HTTP GET → Static Host → index.html + assets
• index.html bootstraps React bundle
• React Router / PathChecker reads URL, renders appropriate page/component
• Components call fetch() to load JSON article files under public/articles
• GalaxyContext initializes three-js helpers (InfiniteGridHelper, galaxy)
• SCSS files imported in JSX become CSS at build time
• During development: Browser ↔ HMR-enabled Vite dev server
c) Architectural patterns & principles
• SPA / component-based architecture
• Context API for global state (GalaxyContext)
• File-system segregation of concerns: pages vs. shared components vs. assets
• Build-time asset handling via Vite (tree-shaking, module hot reload)
d) Key technologies/frameworks
• React + JSX
• Vite (fast bundler + dev server)
• three-js (3D scene rendering)
• SCSS for styling
• ESLint & @vitejs/plugin-react