How nasu0604/returngamesite works
Project type and purpose
• This is a full-stack “lite” application in the sense that it has no custom backend or microservices. It’s a single-page application (SPA) built with React (Create-React-App) that lives entirely in the browser and is delivered via Firebase Hosting.
• Purpose: Showcase and serve multiple Unity WebGL game builds (under public/unity/…) and provide a React-powered UI (in returngame/src) with static JSON data for projects and timelines.
Main components
a. Client Browser
• React SPA (App.js + supporting CSS, tests, static JSON under src/)
• Unity WebGL modules (under public/unity/…)
b. Firebase Hosting (CDN + SSL)
• Serves index.html, JavaScript bundles, static assets (images, JSON, Unity .data/.framework.js/.wasm, manifest, robots.txt, etc.)
• Optionally provides Firebase services via JS SDK in firebase.js (e.g., Analytics, Auth, Firestore if used in future)
c. Static Data Stores
• projects.json, timelineData.json in src/ (bundled)
• manifest.json, ads.txt, robots.txt (in public/)
d. (Optional) External Services
• Third-party links: Instagram, analytic trackers
• Unity’s online services (if configured via google-services JSON in some builds)
Relationships and data flow
• User’s browser → DNS/CDN → Firebase Hosting → serves React bundle & static Unity assets
• React app bootstraps → Loads local JSON → Renders UI
• On “play game” action → SPA loads the specific Unity loader .js → Instantiates WebGL canvas → Fetches .wasm/.data for that game
• (If configured) React calls Firebase APIs via firebase.js → e.g., Analytics events
Architectural patterns & design principles
• SPA pattern: A single HTML shell (public/index.html) and client-side routing (React Router if used)
• Static-site architecture: No server-side code, all heavy lifting in browser
• Micro-frontend flavor for Unity games: each Unity build is an independent bundle served from its own subdirectory
• Progressive enhancement: JSON data + static hosting enable basic functionality even if JS or Unity fails
• Static files (public/)
• Unity build directories
• Configuration (firebase.json)