How iamqasimali/badminton works
Project type and purpose
• This is a MERN-style web application for organizing and managing badminton tournaments.
• It offers three portals (Player, Tournament Management, Admin), with this repository containing the React front-end.
• The front-end is built with Vite + React + Tailwind, consuming an Express.js API and PostgreSQL database.
File structure
• Root files:
– index.html: single-page application host
– vite.config.js, tailwind.config.js, postcss.config.js: build and styling configurations
– package.json / package-lock.json: project dependencies
• public/: static assets served alongside index.html
• src/: entrypoints and React code
– main.jsx → mounts App.jsx
– App.jsx → configures React Router and global layout
– src/components/auth/: authentication flows (Signup, Signin, Welcome, etc.)
– assets/: images and static media
– CSS files (App.css, index.css) leveraging Tailwind utilities
Pulling architecture insights from the README
• Back-end (not in this repo) follows MVC:
– Models: Sequelize schemas mapping to PostgreSQL
– Controllers: Express route handlers
– Views: JSON payloads
• Authentication via JWT + Bcrypt, input validation with Joi, RESTful API endpoints accessed by Axios in the client
• Tech stack callouts: React Router, Formik, Yup/Joi, Axios, Express.js, PostgreSQL, Sequelize
a. Main components to include
– Client (Browser) with React SPA
– Static asset host (Vite dev server or production CDN / web server)
– API Server (Express.js)
– Authentication service (JWT issuance & verification, Bcrypt hashing, Joi validation)
– Database (PostgreSQL via Sequelize)
– External services (e.g., CORS, UUID library if depicted as part of back-end utilities)
b. Relationships & data flows
1. User → Browser UI (React + React Router)
2. UI → HTTP calls (Axios) → Express API endpoints
3. Express Controller → validate (Joi) → hash/verify (Bcrypt) → issue/check token (JWT)
4. Controller → ORM (Sequelize) → PostgreSQL
5. Database responses → Controller → JSON response → UI updates
c. Architectural patterns & principles
– Front-end: component-based, single-page application
– Back-end: layered MVC, RESTful services
– Separation of concerns: UI, API, Data layer
– Stateless authentication via JWT
d. Key technologies & frameworks
– React, Vite, Tailwind, React Router, Formik, Yup/Joi, Axios
– Node.js, Express.js, Sequelize, pg, PostgreSQL, JWT, Bcryptjs, CORS