How tuda1921/itss-gym-management works
Project type and purpose
• This is a full-stack gym management web application.
• Backend (“be/”) is a Node.js + Express REST API, with JWT authentication, controllers for each domain (equipment, feedback, gym rooms, memberships, packages, statistics, users, workouts), Mongoose models, and a seed script.
• Frontend (“fe/”) is a React single-page application using Redux for state, React Router for navigation, and a service layer (api.js, authService.js) to call the backend.
File structure
• be/
• config/db.js – database connection (likely MongoDB via Mongoose).
• middleware/auth.js – JWT verification, role-based access.
• models/*.js – Mongoose schemas for each entity.
• controllers/*Controller.js – business logic for CRUD, validation, aggregations.
• routes/*Route.js – Express routers mapping HTTP methods + paths to controllers.
• server.js – sets up Express app, global middleware (JSON parsing, CORS), mounts routers.
• seed.js – populates initial data.
• fe/
• src/services/api.js & authService.js – wrappers around fetch/Axios for REST calls.
• src/redux/* – Redux store and slices (authSlice, trainerSlice).
• src/pages/… and src/components/… – component hierarchy organized by user role (Admin, Coach, Staff, User).
• src/components/ProtectedRoute.jsx – route guard checking auth and roles.
README
• It’s empty (“Add Readme”), so infer from directories and naming conventions.
Detail level
• Break out each controller (Equipment, Feedback, GymRoom, Membership, Package, Statistic, User, Workout) as a separate sub-component within the backend.
• On the frontend, group components by role (Admin, Coach, Staff, User) and illustrate how they all call the central api.js service.
• ProtectedRoute mechanism intercepting navigation before rendering pages.