How noureddin94/dating-app works
1. Overall shape
- This is a single ASP.NET Core monolith for a dating app called LoveMatch.
- It combines MVC views, Razor Pages Identity, API controllers, and a small Razor Components/Blazor-style UI surface in one web host.
2. Request entry points
- Program.cs is the composition root: it wires web hosting, authentication, EF Core, dependency injection, and endpoint routing.
- The app exposes three main request surfaces:
- Controllers/Web for standard site pages like Home
- Controllers/API for JSON operations
- Areas/Identity for built-in account management and login flows
3. Presentation layer
- Presentation/DTOs and Presentation/ViewModels separate transport shapes from domain entities.
- Views provides the server-rendered UI shell and shared layout.
- Components contains the component-based UI pieces, including routing and a CustomAuthStateProvider for authenticated component state.
4. Business logic layer
- Application/Services contains the use-case logic for the app’s major features:
- ProfileService
- LikeService
- MatchService
- MessageService
- ModerationService
- AdminService
- GameService
- LocationService
- RandomUserService
- API controllers appear to be thin wrappers over these services.
5. Domain model
- Domain/Entities holds the core data model for dating and social interactions:
- users and profiles
- likes and matches
- conversations and messages
- blocks and reports
- game invites/sessions
- profile images and daily action counts
- Domain/Enums captures lifecycle/status values such as account, report, invite, and session states.
6. Persistence boundary
- Infrastructure/Data/AppDbContext.cs is the EF Core persistence gateway.
- Infrastructure/Repositories/Repository.cs implements the repository abstraction defined by Domain/Interfaces/IRepository.cs.
- The main data flow is: controller/component → application service → repository/DbContext → database.
7. External service integration
- Domain/ExternalModels suggests integrations with outside APIs for:
- location data
- random user generation
- These integrations are wrapped by LocationService and RandomUserService, keeping external schemas out of the rest of the app.
8. Authentication and user management
- Areas/Identity is the scaffolded ASP.NET Core Identity area for registration, login, password reset, email confirmation, 2FA, and account management.
- CustomAuthStateProvider bridges auth state into the component-based UI.
- This makes identity a first-class subsystem rather than custom-built authentication.
9. Feature domains
- The app’s functional center is a dating/social platform:
- profiles and images
- liking and matching
- messaging and conversations
- blocking and moderation/reporting
- admin workflows
- game/session interactions
- These are likely the key boundaries to show in a diagram because each maps cleanly to a service and controller pair.
10. Operational and delivery concerns
- docker-compose.yml and WebApp/Dockerfile indicate containerized deployment.
- GitHub Actions workflows cover CI and Docker image creation.
- EF Core migrations in Infrastructure/Migrations show schema evolution is managed in code.
11. Tests
- WebApp.Test is a separate test project, currently with UserTest.cs.
- It appears to target domain/service behavior rather than UI, so the most important test boundary is likely the application/domain layer.
12. Architectural summary for diagramming
- The cleanest diagram is: UI surfaces and API controllers at the top, application services in the middle, domain entities/interfaces underneath, and Infrastructure/EF Core + external APIs at the bottom.
- Identity runs alongside the main app as a separate framework-backed subsystem, but shares the same host and authentication context.
Main entry points: Services Services hub · Program.cs Program.cs · Interfaces Service contracts · Entities Entities
Components 18
Web host
Single ASP.NET Core application entry points and UI surfaces
- Program.cs · Configures hosting, DI, auth, EF Core, and routing
WebApp/Program.cs - MVC site · Server-rendered pages and home controller
WebApp/Controllers/Web/HomeController.cs - API controllers · Thin controller layer for feature endpoints
WebApp/Controllers/API - Identity area · Scaffolded ASP.NET Core Identity pages for account flows
WebApp/Areas/Identity - Components UI · Razor component surface and custom auth state
WebApp/Components - DTOs & VMs · Transport and view models that separate UI from domain entities
WebApp/Presentation
Application layer
Use-case services that coordinate dating-app features
- Services hub · Main orchestration layer for feature workflows
WebApp/Application/Services - Profiles · Profile creation, updates, and profile images
WebApp/Application/Services/ProfileService.cs - Likes & matches · Like and match lifecycle logic
WebApp/Application/Services/LikeService.cs - Messaging · Conversations and message delivery logic
WebApp/Application/Services/MessageService.cs - Moderation & admin · Reports, blocks, and admin workflows
WebApp/Application/Services/ModerationService.cs - Game & location · Game sessions plus location and random-user integrations
WebApp/Application/Services/GameService.cs
Domain model
Entities, interfaces, and external contracts
- Entities · Core dating, social, and session entities
WebApp/Domain/Entities - Service contracts · Abstractions for services and repositories
WebApp/Domain/Interfaces - External models · Schemas for location and random-user APIs
WebApp/Domain/ExternalModels
Infrastructure
EF Core persistence and repository implementation
- AppDbContext · EF Core persistence gateway for the domain model
WebApp/Infrastructure/Data/AppDbContext.cs - Repository · Implements the repository abstraction over the database
WebApp/Infrastructure/Repositories/Repository.cs - Database · Persisted application data managed through EF Core
Connections 29
- Program.cs → MVC site: hosts · Registers MVC routing and site pages
- Program.cs → API controllers: maps · Exposes API controllers
- Program.cs → Identity area: enables · Wires the Identity area into the same host
- Program.cs → Components UI: serves · Provides the component-based UI surface
- Program.cs → Services hub: injects · Registers application services in DI
- Program.cs → AppDbContext: configures · Sets up EF Core and persistence
- MVC site → DTOs & VMs: uses · Renders view models and DTO-adjacent shapes
- API controllers → Services hub: calls · Thin wrapper around application use cases
- Components UI → Services hub: calls · Component actions use the same application services
- Components UI → DTOs & VMs: binds · Uses presentation models for component state
- Services hub → Profiles: contains · Profile use-case logic
- Services hub → Likes & matches: contains · Like and match orchestration
- Services hub → Messaging: contains · Conversation and messaging orchestration
- Services hub → Moderation & admin: contains · Moderation and admin orchestration
- Services hub → Game & location: contains · Game, location, and external-user orchestration
- Profiles → Service contracts: depends on · Uses repository and service abstractions
- Likes & matches → Service contracts: depends on · Uses repository and service abstractions
- Messaging → Service contracts: depends on · Uses repository and service abstractions
- Moderation & admin → Service contracts: depends on · Uses repository and service abstractions
- Game & location → Service contracts: depends on · Uses repository and service abstractions
- Profiles → Entities: reads/writes · Works with user profiles and images
- Likes & matches → Entities: reads/writes · Works with likes and matches
- Messaging → Entities: reads/writes · Works with conversations and messages
- Moderation & admin → Entities: reads/writes · Works with blocks and reports
- Game & location → Entities: reads/writes · Works with game invites, sessions, and counters
- Game & location → External models: maps · Wraps external location and random-user schemas
- Service contracts → Repository: implemented by · Repository abstraction is implemented in infrastructure
- Repository → AppDbContext: uses · Persists through EF Core
- AppDbContext → Database: persists to · Stores application state in the backing database