How nsvoriginals/oasis works
Main system components
• Frontend Client: All files in the "client" directory indicate a React and TypeScript–based front-end leveraging Vite for build, and using Phaser for game elements. This component includes user interface elements, scene management (Canvas-based game scenes), and interactive tools (e.g., joystick, chat, video dialogs).
• Backend Server: The "server" directory contains server-side code using Express (and likely Colyseus for room management) with additional modules for room-specific commands and database schema management. This is where the core room state management and interaction handling occur.
• Database/State Persistence: Files such as server/db.ts and schema-related files indicate that the server maintains a persistent state (or interacts with a database) necessary for tracking virtual rooms and user states.
• Additional Assets and Utility Modules: From the file tree, the client’s assets (graphics, fonts, animations, map data) and utility modules (stores, custom events) support the real-time, interactive experience.
Depicting relationships and interactions
• That the Frontend integrates with the Real-Time Communication module (PeerJS & WebRTC) for video, audio, and screen sharing.
• Separate the game/Phaser engine within the client, possibly representing it as a nested module that receives game state data from backend services.
• Backend Server as interfacing with a database (or persistent state store) and managing room logic via Colyseus, illustrated by the “rooms” directory and its command files.
• External components such as deployment containers (Docker) to contextualize how the system is run in production.
Architectural patterns and technologies
• A clear separation between the client and server, aligning with modern full-stack best practices.
• Use of MVC-like separation on the client (components, scenes, assets) and service-oriented/microservices patterns on the server (each “room” command acting as discrete handlers).
• Use of real-time event-driven communication patterns especially in handling WebRTC sessions and game updates.
• Use of TypeScript throughout which enforces type-safety across both front- and back-end.