How pierre2103/4x20x15 works
Project type and purpose
• This is a full-stack real-time card-game application.
• Frontend: React single-page app (under src/, public/) that handles UI, routing, game pages, authentication flows.
• Backend: Node.js server (backend/app.js) that currently serves the frontend static files and will host game-rule logic as you migrate off Firebase.
• Database/Auth: Firebase (configured in src/firebaseConfig.js) used for user authentication (Auth) and real-time game state persistence (Firestore or Realtime Database).
• CI/CD: GitHub Actions pipeline defined at .github/workflows/tests.yml for automated tests and code quality checks.
File structure
• Top-level directories:
• backend/ – Node.js entry point (app.js). Likely Express for serving static assets and exposing APIs for custom game logic.
• public/ – index.html and other static assets that bootstrap the React app.
• src/ – React source code:
– App.js, index.js – root components and client-side router.
– firebaseConfig.js – Firebase project credentials for Auth/DB.
– pages/ – SPA routes (AuthPage, HomePage, RoomPage, GamePage, ProfilePage).
– styles/ – SCSS modules scoped per page.
• Config & metadata:
• package.json – dependencies (React, Firebase, Express?).
• .gitignore, .gitattributes – VCS config.
• .github/workflows/tests.yml – CI pipeline.
README for additional insights
• Startup instructions separate backend (node backend/app.js) and frontend (npm start).
• Todo list suggests adding more rule-engine logic on the backend, replacing Firebase with a self-hosted DB, and unifying startup commands.
Key takeaways
• Every moving part: client entry point, static asset server, auth flow, real-time DB, backend rule engine, CI/CD.