How mdazfar2/dbgmi-playzone works
Project type and purpose
• From the README and file tree, this is a full-stack competitive gaming platform (“DBGMI-Playzone”) with a React/Tailwind front end, an Express/Node.js back end, MongoDB persistence, and Stripe for payment integration. Its purpose is to let users browse and register for tournaments and let admins manage tournaments and registrations.
File structure
• Top level only contains documentation files and a single “frontend” directory.
• frontend/ contains a modern React app set up with Vite (viteconfig.js), Tailwind CSS (tailwind.config.js, postcss.config.js), ESLint, and a src/ directory.
• Inside src/, pages/ map one-to-one to site routes (HomePage, RegistrationPage, AdminPage, etc.), components/ holds reusable UI widgets grouped by feature (auth, admin, common, home, leaderboard, registration, rules, tournaments, contact), data/, utils/, types/.
• No server code in this tree, but the README explicitly calls out Express.js/Node.js backend and MongoDB.
README for additional insights
• Tech stack: React, Tailwind CSS, Express.js, Node.js, MongoDB, Stripe.
• Core features: tournament listings, registration with payment, prize details, admin panel.
• There’s a RESTful relationship implied: front end → Express APIs → MongoDB, plus integration to Stripe gateway.
Components & relationships
a. Main components
• Client (React SPA)
• Web/API Server (Node.js + Express)
• Database (MongoDB)
• External Payment Service (Stripe)
• Static asset/store (optionally: CDN or Vite dev server)
b. Interactions & data flow
1. User’s browser loads the React app (served either via CDN/static host or Express static middleware).
2. React app calls Express REST endpoints over HTTPS for:
– GET /tournaments, GET /players, GET /winners
– POST /register, POST /login, POST /admin/tournament
3. Express routes apply business logic, interact with MongoDB (via Mongoose or similar), and return JSON.
4. For payment, front end opens Stripe Checkout or invokes a backend endpoint which calls Stripe’s API, then updates MongoDB.
5. Admin workflows (protected routes) follow the same pattern but require authentication/authorization.
c. Architectural patterns & design principles
• Client-Server separation (SPA + REST API)
• Layered architecture: Presentation (React), Application (Express controllers/services), Persistence (MongoDB)
• Modular feature organization in front end (component-per-feature)
• Authentication & Authorization middleware in Express
• External service integration (Stripe SDK on server)
d. Key technologies per component
• Frontend: React, Vite, Tailwind CSS, React Router (implied by pages folder)
• Backend: Node.js, Express.js, Body-Parser, CORS, dotenv (for config), Mongoose (MongoDB ODM)
• Database: MongoDB Atlas or self-hosted cluster
• Payments: Stripe Node.js SDK and Stripe Checkout / Payment Intents
• DevOps (implied by .github/workflows): GitHub Actions for CI/CD
Detail but maintain clarity
• Data schemas or collections if needed (e.g., Players, Tournaments, Registrations).
• Call out environment/config boundaries (e.g., .env holds Stripe secret key, DB URI).