How sagar-tandan/gym_management_system works
Main Components
• Frontend Client:
• React-based single-page application (SPA)
• Sub-components for Admin (e.g., AdminDashboard, AdminAttendence, Inventory) and User (e.g., NavBar, HeroSection, TrainingPrograms)
• Built with Vite, using the “src” directory for components, assets, and routing.
• Backend API:
• ASP.NET Core Web API project
• Controllers manage routes like Attendence, Auth, Inventory, Member, and Plan.
• Entity Framework Core for data persistence (as shown by ApplicationDbContext and numerous Migration files).
• Database:
• Although the actual database isn’t explicitly listed, the use of EF Core and migrations implies a relational database (like SQL Server, PostgreSQL, etc.).
• External Dependencies/Services:
• Email sending is handled by a service (IEmailSender interface and EmailSender implementation).
• The token service suggests JWT-based authentication or similar mechanisms.
Relationships and Interactions
• The Frontend communicates with the Backend API via RESTful HTTP requests (as suggested by the presence of “API.http” and multiple controllers handling endpoints).
• The API routes incoming requests to the appropriate controllers, which then use DTOs for data validation and Models represent the underlying database tables.
• The API, through the ApplicationDbContext, interacts with the Database to perform CRUD operations.
• Auxiliary services such as EmailSender and TokenService support additional functionality like user verification and secure authentication.
• Authentication flows: There is an AuthController and corresponding DTOs for login, registration, and password changes, suggesting a flow where user credentials are verified, a token (JWT likely) is returned and then used by the frontend for subsequent API calls.
• The separation between admin routes and user routes in the frontend indicates role-based access control.
Diagramming Architectural Patterns
• Use of Dependency Injection in the API: Although not explicitly visible in the file tree, the structure implies that services (like EmailSender and TokenService) are likely injected into the controllers.