How asif-jutt/messmanagementsystem works
Purpose and runtime
This is a .NET 8 ASP.NET Core MVC mess-management system for administrators and members. It manages members, dishes/weekly menus, meal booking and daily records, deposits, rates, bills, and reports. The application entry point is Program.cs; project/runtime definition is Mess_Management_System_Semester_Project.csproj.
Delivery and presentation boundary
HTTP requests are handled by MVC controllers and rendered as Razor pages, with separate administrator and member experiences. Key entry controllers include Controllers/HomeController.cs, Controllers/AdminController.cs, and Controllers/MemberController.cs. Shared layouts define role-oriented shells: Views/Shared/_AdminLayout.cshtml, Views/Shared/_MemberLayout.cshtml, and Views/Shared/_Layout.cshtml.
Identity and access
Authentication is split between administrator/general user and member-facing flows, with protected endpoints and JWT support. Main boundary files are Controllers/AuthController.cs, Controllers/MemberAuthController.cs, Controllers/ProtectedController.cs, plus token abstraction/implementation in Services/IJwtService.cs and Services/JwtService.cs. User identity is represented by Models/User.cs, Models/Admin.cs, and Models/Member.cs.
Persistence model
Models/MessDbContext.cs is the database integration boundary, holding the relational model for operational records. Core persisted entities are members and meals (Models/Member.cs, Models/Meal.cs), financial records (Models/Deposit.cs, Models/Bill.cs, Models/MonthlyBill.cs), and menu/rate data (Models/Dish.cs, Models/WeeklyMenu.cs, Models/MealRate.cs). SQL setup and schema evolution are repository-managed scripts, notably Scripts/CompleteDatabaseSetup.sql and Scripts/UpdateWeeklyMenusSchema.sql.
Meal and menu operations
Administrators manage dishes and weekly menus; members can view menus and book meals, while staff can record daily consumption. Control paths are concentrated in Controllers/DishesController.cs, Controllers/WeeklyMenusController.cs, and Controllers/MealManagementController.cs. The weekly-menu domain is encapsulated further in Services/WeeklyMenuService.cs and represented for UI composition by Models/WeeklyMenuViewModel.cs.
Billing and payment flow
Operational data flows from meal records and meal rates into billing calculations, then to bills/monthly bills and member-visible payment history. Services/IBillingService.cs and Services/BillingService.cs form the explicit billing-calculation boundary. HTTP management/reporting endpoints are in Controllers/BillsController.cs, Controllers/MonthlyBillsController.cs, Controllers/DepositsController.cs, and Controllers/MealRatesController.cs.
Reporting and external surface
Reports draw on persisted meal and financial data, including the database-oriented aggregate model Models/VwDailyMealTotal.cs; reporting routes are in Controllers/ReportsController.cs and Controllers/MonthlyBillsController.cs. There is also a distinct API/chatbot surface through Controllers/ApiController.cs and Controllers/ChatbotController.cs, with corresponding member assistant UI at Views/Member/Assistant.cshtml. The repository contains a Web Deploy publish profile at Properties/PublishProfiles/site48989-WebDeploy.pubxml; the database provider and connection details are expected through appsettings.json / environment-specific settings.
Main entry points: MessDbContext.cs Mess Database Context · BillingService.cs Billing Service · JwtService.cs JWT Service · User.cs User Identities
Components 21
MVC Presentation
Administrator and member HTTP/UI boundary.
- MVC Controllers · Home, administrator, and member entry routes.
Controllers/HomeController.cs - Role Layouts · Shared, administrator, and member page shells.
Views/Shared/_Layout.cshtml - Assistant API · Distinct API and chatbot surface.
Controllers/ApiController.cs - Member Assistant UI
Views/Member/Assistant.cshtml
Identity & Access
Separate user and member authentication flows.
- User Authentication · Administrator and general-user authentication.
Controllers/AuthController.cs - Member Authentication
Controllers/MemberAuthController.cs - Protected Endpoints
Controllers/ProtectedController.cs - JWT Service · Issues and validates JWT access tokens.
Services/JwtService.cs - User Identities · User, admin, and member identities.
Models/User.cs
Mess Operations
Menu, meal, finance, and reporting workflows.
- Menu Management · Dish, weekly-menu, and meal-management routes.
Controllers/WeeklyMenusController.cs - Weekly Menu Service · Encapsulates weekly-menu operations and UI composition.
Services/WeeklyMenuService.cs - Menu & Rate Models · Dishes, weekly menus, meal rates, and menu view model.
Models/WeeklyMenu.cs - Meal Records · Member meal booking and daily consumption records.
Models/Meal.cs - Billing & Deposit Routes · Bills, monthly bills, deposits, and meal-rate management.
Controllers/BillsController.cs - Billing Service · Calculates bills from meal records and rates.
Services/BillingService.cs - Financial Records · Deposits, bills, and monthly bills.
Models/Bill.cs - Reports · Reporting over meal and financial aggregates.
Controllers/ReportsController.cs - Daily Meal Totals · Database-oriented daily meal aggregate.
Models/VwDailyMealTotal.cs
Persistence
Relational operational data and schema setup.
- Mess Database Context · Relational integration boundary for operational records.
Models/MessDbContext.cs - Database Schema Scripts · Database setup and weekly-menu schema evolution.
Scripts/CompleteDatabaseSetup.sql
Other components
- Application Host
Program.cs
Connections 25
- Application Host → MVC Controllers: hosts
- Application Host → User Authentication: configures auth
- Application Host → Mess Database Context: configures
- MVC Controllers → Role Layouts: renders
- User Authentication → JWT Service: uses
- Member Authentication → JWT Service: uses
- JWT Service → User Identities: claims for
- Protected Endpoints → JWT Service: validates
- User Authentication → User Identities: authenticates
- Member Authentication → User Identities: authenticates
- Menu Management → Weekly Menu Service: delegates menu work
- Weekly Menu Service → Menu & Rate Models: manages
- Menu Management → Meal Records: books and records
- Billing & Deposit Routes → Billing Service: requests calculations
- Billing Service → Meal Records: uses consumption
- Billing Service → Menu & Rate Models: uses meal rates
- Billing Service → Financial Records: creates bills
- Reports → Daily Meal Totals: reads
- Reports → Financial Records: reports on
- Member Assistant UI → Assistant API: calls
- Menu & Rate Models → Mess Database Context: persisted in
- Meal Records → Mess Database Context: persisted in
- Financial Records → Mess Database Context: persisted in
- User Identities → Mess Database Context: persisted in
- Database Schema Scripts → Mess Database Context: provisions