How danielagmz/pyramids works
Project type and purpose
• This is a full-stack JavaScript web application that provides a real-time, map-based game interface (with roles for admin, lobby, player, etc.).
• The backend is a Node.js server offering both HTTP endpoints (AuthController, Admin.js, Game.js, etc.) and a WebSocket channel for live game events.
• The frontend is a static client (HTML/CSS/vanilla JS) served via a “live server” extension on port 5500.
File structure
• Top-level:
• client/ – all static assets (html, css, js, images, map elements)
• server/ – Node.js code (server.js, router.js, controllers, WebSocketHandler)
• configs.js – global configuration (ports, URLs, feature flags)
• package.json & package-lock.json – dependencies and scripts
• server/controllers/ follows an MVC-style pattern: each controller encapsulates a domain (Auth, Player, Game, Pyramid, Mapa, Admin).
• server/router.js assembles HTTP routes; WebSocketHandler.js sets up bi-directional socket messaging.
• README describes a dual-server setup: the static client via Chrome live server and the Node backend on localhost:8080.
README for architecture insights
• Two distinct “servers”:
1. Live-reload static server (frontend) at http://localhost:5500
2. Node.js application server (backend) at http://localhost:8080
• No explicit database folder, so persistence may be in-memory or handled inside controllers (if a DB is integrated, it would appear in configs.js).
Elements
• Clear labels: e.g., “Browser Client,” “Live Server (5500),” “Node.js API (8080),” “AuthController,” “WebSocketHandler.”
– HTTP request/response flows (login, admin calls).
– WebSocket messages (subscribe, broadcast game state).
– Controller ↔ persistence interactions.
– Rectangles for servers/components
– Clouds for external services (e.g., map APIs)