How n-eeraj/pokemon-black-crystal works
Project type and purpose
• This is a client-side single-page application (SPA) built in Vue 3. It’s a fan-made online Pokémon game that runs entirely in the browser, leveraging local JSON data for offline game modes and PeerJS for real-time P2P multiplayer (PvP, Trade).
File structure
• Top level:
• src/ → application code
– assets/ → audio, images, JSON game data
– js/ → Vue entrypoints, components, router, store, mixins
– styles/ → SCSS modules
– registerServiceWorker.js → offline caching
– main.js → bootstraps Vue app
• There is no custom backend; real-time features use PeerJS (client library) plus its hosted signaling server.
Key insights from README
• Tech stack: Vue 3, SCSS, Vue Router, Vuex, PeerJS, AutoAnimate
• Game modes include Story, Exploration (offline & Safari Zone), Arcade, PvP, Trade, Carnival
• PvP/Trade modes require real-time P2P connections
• asset fetch flow (Browser → Static Host)
• router → component render flow
• Vuex dispatch/commit flows
• network flows: Browser ↔ Signaling Server ↔ Browser
• Assets/data in another
• Network/external services in a third
• Persistent layers (Service Worker, Store)
• Transient modules (Components, Router)
Summary
1. Static Hosting & Assets (public/, src/assets/data)
2. Browser Application Core (Service Worker caching, main.js, Vue Router, Vuex Store)
3. Presentation Layer (View components, UI modules, AutoAnimate)
4. Networking Layer (PeerJS Client ↔ PeerJS Signaling Server ↔ Other Clients)
This will capture all essential architectural elements without over-splitting components.