How spider-hand/geoguessmaster works
Project type and purpose
• From the README and file tree, this is “GeoguessMaster”: an open-source, PWA, real-time multiplayer geoguess game.
• Tech stack: Vue.js + TypeScript front end (src/), Firebase Hosting (firebase.json + public/ + index.html), Firebase Realtime Database, Firebase Cloud Functions (functions/), Google Maps & Street View APIs.
File structure
• Top level:
• Configuration: .eslintrc, .firebaserc, firebase.json, vite.config.ts, tsconfig.json, etc.
• Public assets & hosting: public/, index.html, manifest.json, service worker (registerServiceWorker.ts).
• Front end: src/ (App.vue, views/, components/, composables/, router/, stores/, utils/, assets/).
• Tests: src/__tests__/unit/… (Vitest).
• Backend/serverless: functions/src/index.ts (Cloud Functions), functions/package.json, tsconfig.json for functions.
README for additional insights
• Confirms multiplayer real-time via Firebase Realtime Database.
• PWA support, offline via service worker.
• Front end calls Google Maps & Street View APIs for map rendering.
• Cloud Functions likely orchestrate room creation, game lifecycle triggers on DB events.
Main components & their relations
a. Frontend (Vue PWA)
• Hosts UI, game views, state management (stores/ inGame, gameSettings, device).
• Communicates bidirectionally with Firebase Realtime Database over WebSockets / REST.
• Invokes Cloud Functions (HTTP or callable) for server-side logic (e.g., createGameRoom).
• Fetches map imagery from Google Maps JS API & Street View API.
• Service Worker caches static assets & enables offline behavior.
b. Firebase Hosting
• Serves static assets (index.html, JS bundles, images, manifest).
c. Firebase Realtime Database
• Central shared state: rooms, players, guesses, scores.
• Real-time sync across all clients.
d. Firebase Cloud Functions
• Triggered on HTTP calls or DB triggers for game lifecycle events, quota checks, cleanup.
e. External APIs
• Google Maps / Street View for map tiles & street imagery.
Architectural patterns & design principles
• Client-centric MVC (Vue components + Vuex-style stores).
• Serverless micro-backend (Cloud Functions for discrete units of logic).
• Real-time event-driven architecture via Realtime Database triggers.
• PWA pattern: service worker + manifest for offline/mobile support.