How mohaiminul375/merit-matrix-client works
Project Type and Purpose
• This is a full-stack scholarship-management application called “Merit-Matrix.”
• The repository you provided is the front-end client, built as a React SPA with Vite, TailwindCSS and DaisyUI.
• According to the README, the overall system also includes:
– A Node/Express backend exposing REST endpoints
– A MongoDB database
– Firebase (for auth+hosting)
– Stripe (for payments)
File Structure (Front-end)
Top-level files
• index.html, package.json, vite.config.js, tailwind.config.js
• firebase.json, .firebaserc (Firebase hosting)
src/
• main.jsx + index.css – application entry point
• Router/ – React Router v6 routes and guarded-route components
• Provider/AuthProvider.jsx – React Context for Firebase authentication
• Pages/ – top-level route pages (Home, AllScholarship, Checkout, Dashboard, etc.)
• component/ – reusable UI components (tables, cards, modals, shared Navbar/Footer)
• hooks/ – custom hooks for data fetching (axiosPublic, axiosSecure), auth, roles, dates
• firebase/firebase.config.js – Firebase SDK initialization
README for Additional Insights
• UI: React + Tailwind + DaisyUI + Meraki UI
• Routing: react-router-dom
• Data: Axios + TanStack Query
• Auth: Firebase
• Payments: Stripe (react-stripe)
• Deployment: Firebase Hosting (client), Vercel (presumably backend)
• Backend: Express.js + MongoDB (separate repo)
Main Components & Their Interactions
a. Front-end SPA
– React pages and components
– AuthProvider supplies user&role context via Firebase tokens
– useAxiosPublic/useAxiosSecure call backend REST APIs
– Stripe Checkout integration for payments
b. Backend API (Node/Express)
– /api/scholarships, /api/applications, /api/users, /api/reviews, /api/payments
– Secured endpoints validate Firebase JWT
– Role checks for Admin/Moderator via middleware
c. Database (MongoDB)
– Collections: users, scholarships, applications, reviews, payments
d. External Services
– Firebase Auth (sign-in, social login)
– Firebase Hosting (Serve static SPA)
– Stripe (payments)
Architectural Patterns & Design Principles
• Component-based UI with clear separation of pages vs. shared components
• Context + custom hooks for cross-cutting concerns (auth, data fetching)
• RESTful backend with role-based access control
• SPA routing with public, private, admin and moderator guards
• Third-party integrations (Firebase, Stripe) abstracted behind hooks
Details
• Sub-components that have their own responsibilities (AuthProvider, useAxiosSecure, CheckoutForm, PrivateRoute, etc.)
• How role-based route guards (AdminRoute, ModeratorRoute) connect to AuthProvider.
• Payment flow (React-Stripe → Stripe → backend webhook).
• Hosting/deployment context: Firebase Hosting serves the SPA; backend deployed to Vercel or another host.