How mjunhaochen/sswp-toogoodtogo works
TooGoodToGo is a server-side surplus-food package marketplace. Students browse packages and reserve one for pickup; canteen employees create, update, view, and delete packages. The MVC portal delegates package rules and views to the domain service, while a separate reservation API writes reservations through repositories. GraphQL offers an additional package/product query surface. The README documents student and employee capabilities; unsampled GraphQL mutation and controller details are represented only where their paths are supported by the tree.
Main entry points: Controllers/PackageController.cs Package workflows · PackageEFRepository.cs Package repository · PackageServiceBasic.cs Package service · Controllers/PackageController.cs Reservation API
Components 20
Web Portal
- MVC application
AvansTooGoodToGo/Program.cs - Accounts
AvansTooGoodToGo/Controllers/AccountController.cs - Package workflows
AvansTooGoodToGo/Controllers/PackageController.cs - Reservation API
AvansTooGoodToGoWebApi/Controllers/PackageController.cs - API application
AvansTooGoodToGoWebApi/Program.cs - GraphQL application
GraphQLServer/Program.cs - GraphQL queries
GraphQLServer/GraphQL/Query.cs - GraphQL mutations
GraphQLServer/GraphQL/Mutation.cs - GraphQL route info
GraphQLServer/GraphQL/RouteController.cs - ASP.NET Identity
Service Interfaces
- Package repository
Infrastructure/PackageEFRepository.cs - Student repository
Infrastructure/StudentEFRepository.cs - Product repository
Infrastructure/ProductEFRepository.cs - Employee repository
Infrastructure/CanteenEmployeeEFRepository.cs
Domain Rules
- Package service
Core.DomainServices/Services.Impl/PackageServiceBasic.cs - Marketplace entities
Domain/Package.cs
Persistence
- Marketplace database
Infrastructure/PackageDbContext.cs - Identity database
Infrastructure/SecurityDbContext.cs
Other components
- Students
- Canteen staff
Connections 27
- Students → Accounts: register or sign in
- Students → Package workflows: browse packages
- Canteen staff → Package workflows: manage packages
- MVC application → Package workflows: hosts routes
- MVC application → Accounts: hosts routes
- Accounts → ASP.NET Identity: manages accounts
- ASP.NET Identity → Identity database: stores identities
- Package workflows → Package service: requests package operations
- Package workflows → Package repository: reads and writes packages
- Package workflows → Product repository: loads products
- Package workflows → Student repository: looks up students
- Package service → Package repository: reads and changes packages
- Package service → Product repository: loads selected products
- Package service → Employee repository: looks up staff location
- Package repository → Marketplace database: queries and saves
- Student repository → Marketplace database: queries
- Product repository → Marketplace database: queries
- Employee repository → Marketplace database: queries
- API application → Reservation API: hosts endpoint
- Students → Reservation API: requests reservation
- Reservation API → Package repository: loads package and assigns reservation
- Reservation API → Student repository: looks up student
- GraphQL application → GraphQL queries: serves queries
- GraphQL application → GraphQL route info: maps controllers
- GraphQL application → GraphQL mutations: registers mutation service
- GraphQL queries → Package repository: queries packages
- GraphQL queries → Product repository: queries products