# maheshkumarsingh/meetyourmatch architecture

> Architecture diagram of the GitHub repository maheshkumarsingh/meetyourmatch, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maheshkumarsingh/meetyourmatch
- Repository: https://github.com/maheshkumarsingh/meetyourmatch

## Overview

##### Project Type & Purpose
- This is a full-stack dating web application (“MeetYourMatch”) combining an Angular 18 single-page frontend with an ASP.NET Core 8 Web API backend.
- It offers user registration/login, role-based access, photo uploads (via Cloudinary), real-time chat/presence (SignalR), and persistent data storage (SQL via EF Core).

##### High-Level File Structure Analysis
- Top level:
- API/ – ASP.NET Core Web API project
- README.md, MeetYourMatch.sln – solution and documentation
- API/Controllers – HTTP endpoints (Account, Users, Messages, Likes, Admin, Fallback)
- API/ServiceContracts & Services – service interfaces and implementations (Repository, UnitOfWork, TokenService, PhotoService)
- API/Data – DbContext, migrations, seed data (EF Core with SQL scripts & JSON seed)
- API/Entities & DTOs – domain models (AppUser, AppRole, Message, Photo, Like, Group/Connection) and data transfer objects
- API/SignalR – real-time hubs (MessageHub, PresenceHub) and trackers
- API/Helpers & Extensions – AutoMapper profiles, pagination, JWT/Identity extensions, middleware (global error handling)
- API/wwwroot – Angular build output (static SPA) hosted by .NET
- Configuration: appsettings.json, launchSettings, Azure Web Deploy profiles

##### README Insights
- Confirms Angular frontend and .NET backend separation with outputPath directed to API/wwwroot
- Highlights tech stack: Angular CLI, RxJS, Bootstrap/ngx-bootstrap, SignalR; ASP.NET Core Identity, JWT, EF Core, AutoMapper, Cloudinary, Azure App Service.
- Deployment on Azure (Linux/Windows), CI/CD via GitHub Actions (.github/workflows).

1. Angular 18 Frontend (Client SPA)
2. ASP.NET Core 8 Web API
– Controllers (REST endpoints)
– Business/Domain Layer (Services & UnitOfWork)
– Data Access Layer (Repositories & EF Core DbContext)
– SignalR Hubs (MessageHub, PresenceHub)
– Middleware (Exception, Authentication)
3. SQL Database (Azure SQL / Local SQL Server)
4. Cloudinary (Photo storage)
5. External Identity (JWT token issuing via IdentityService)
6. CI/CD Pipeline (GitHub Actions → Azure App Service)

- Browser → (HTTPS requests) → Angular SPA assets (served from API/wwwroot)
- Angular → (REST/HTTP + JWT in headers) → API Controllers → Services → Repositories → SQL DB
- Angular ↔ (SignalR over WebSockets) ↔ MessageHub & PresenceHub → PresenceTracker & Group management → Broadcast to connected clients
- API → Cloudinary SDK/API calls for photo upload/download
- GitHub Actions → Azure App Service (deploy Angular build & .NET API)

c. Architectural Patterns & Design Principles:
- Layered (Presentation → API → Services → Repositories → Database)
- Repository + Unit of Work for data persistence
- DTOs + AutoMapper for data shaping between layers
- Middleware for cross-cutting concerns (error handling, logging, JWT validation)
- Real-time pub/sub via SignalR hubs
- Dependency Injection throughout ASP.NET Core

d. Key Technologies & Frameworks:
- Frontend: Angular 18, RxJS, ngx-bootstrap, ngx-toastr, ng-gallery, Bootstrap 5, Font Awesome
- Backend: ASP.NET Core 8, EF Core 8, ASP.NET Core Identity, JWT, AutoMapper, SignalR
- Storage: Azure SQL (or local SQL), Cloudinary (image hosting)
- Infrastructure: Azure App Service, GitHub Actions CI/CD

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        direction TB
        Browser["User Browser"]:::frontend
        AngularSPA["Angular 18 SPA"]:::frontend
    end

    %% Server Layer
    subgraph "Server Layer (ASP.NET Core 8 Web API)"
        direction TB

        API_Project["API Project"]:::api
        Controllers["Controllers"]:::controller
        ServicesLayer["Business & Domain Services"]:::service
        DataAccess["Data Access & Persistence"]:::data
        EntitiesDTOs["Entities & DTOs"]:::data
        SignalRLayer["SignalR Real-Time"]:::realtime
        MiddlewareLayer["Middleware"]:::middleware
        ExtensionsLayer["Extensions & Helpers"]:::ext
        StaticHosting["Static SPA Hosting"]:::ext
        ConfigLayer["Configuration & Deployment"]:::config
    end

    %% External & Infrastructure
    subgraph "External Services & Infrastructure"
        direction TB
        SQLDB["SQL Database"]:::external
        Cloudinary["Cloudinary Image Storage"]:::external
        GitHubActions["GitHub Actions CI/CD"]:::infra
        AzureApp["Azure App Service"]:::infra
    end

    %% Connections
    Browser -->|"loads SPA assets"\nHTTPS| AngularSPA
    AngularSPA -->|"REST API calls\n+ JWT"| Controllers
    Controllers -->|"invoke services"| ServicesLayer
    ServicesLayer -->|"use UnitOfWork & Repos"| DataAccess
    DataAccess -->|"EF Core\nCRUD JSON"| SQLDB
    Controllers -->|"AutoMapper\nmap DTOs"| EntitiesDTOs
    AngularSPA <-->|"WebSocket (SignalR)\nreal-time chat"| SignalRLayer
    SignalRLayer -->|"broadcast events"| AngularSPA
    ServicesLayer -->|"upload/download"| Cloudinary
    API_Project --> Controllers
    API_Project --> ServicesLayer
    API_Project --> DataAccess
    API_Project --> EntitiesDTOs
    API_Project --> SignalRLayer
    API_Project --> MiddlewareLayer
    API_Project --> ExtensionsLayer
    API_Project --> StaticHosting
    API_Project --> ConfigLayer
    GitHubActions -->|"deploy pipeline"| AzureApp
    AzureApp -->|"hosts API & SPA"| API_Project

    %% Click events
    click AngularSPA "https://github.com/maheshkumarsingh/meetyourmatch/tree/master/API/wwwroot"
    click API_Project "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/API.csproj"
    click Controllers "https://github.com/maheshkumarsingh/meetyourmatch/tree/master/API/Controllers"
    click AccountController "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Controllers/AccountController.cs"
    click UsersController "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Controllers/UsersController.cs"
    click MessagesController "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Controllers/MessagesController.cs"
    click LikesController "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Controllers/LikesController.cs"
    click AdminController "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Controllers/AdminController.cs"
    click FallbackController "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Controllers/FallbackController.cs"
    click EntitiesDTOs "https://github.com/maheshkumarsingh/meetyourmatch/tree/master/API/DTOs"
    click ServicesLayer "https://github.com/maheshkumarsingh/meetyourmatch/tree/master/API/Services"
    click ServiceContracts "https://github.com/maheshkumarsingh/meetyourmatch/tree/master/API/ServiceContracts"
    click TokenService "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Services/TokenService.cs"
    click PhotoService "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Services/PhotoService.cs"
    click UnitOfWork "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Services/UnitOfWork.cs"
    click DataAccess "https://github.com/maheshkumarsingh/meetyourmatch/tree/master/API/Data"
    click DataContext "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Data/DataContext.cs"
    click Migrations "https://github.com/maheshkumarsingh/meetyourmatch/tree/master/API/Migrations"
    click SeedDataCS "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Data/Seed.cs"
    click SeedDataJSON "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Data/UserSeedData.json"
    click InitialDB "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Data/SQL/InitialDB.sql"
    click Entities "https://github.com/maheshkumarsingh/meetyourmatch/tree/master/API/Entities"
    click MessageHub "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/SignalR/MessageHub/MessageHub.cs"
    click PresenceHub "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/SignalR/PresenceHub/PresenceHub.cs"
    click PresenceTracker "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/SignalR/PresenceHub/PresenceTracker.cs"
    click MiddlewareLayer "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Middleware/ExceptionMiddleware.cs"
    click ExtensionsLayer "https://github.com/maheshkumarsingh/meetyourmatch/tree/master/API/Extensions"
    click AutoMapperProfiles "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Helpers/AutoMapperProfiles.cs"
    click CloudinarySettings "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Helpers/CloudinarySettings.cs"
    click Helpers "https://github.com/maheshkumarsingh/meetyourmatch/tree/master/API/Helpers"
    click IdentityServiceExtensions "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Extensions/IdentityServiceExtensions.cs"
    click StaticHosting "https://github.com/maheshkumarsingh/meetyourmatch/tree/master/API/wwwroot"
    click DevSettings "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/appsettings.Development.json"
    click LaunchSettings "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/API/Properties/launchSettings.json"
    click ServiceDependencies "https://github.com/maheshkumarsingh/meetyourmatch/tree/master/API/Properties/ServiceDependencies"
    click GitHubActions "https://github.com/maheshkumarsingh/meetyourmatch/blob/master/ .github/workflows/master_meet-your-match.yml"

    %% Styles
    classDef frontend fill:#E3F2FD,stroke:#42A5F5
    classDef api fill:#E8F5E9,stroke:#66BB6A
    classDef controller fill:#C8E6C9,stroke:#2E7D32
    classDef service fill:#FFF3E0,stroke:#FB8C00
    classDef data fill:#ECEFF1,stroke:#78909C
    classDef realtime fill:#F3E5F5,stroke:#8E24AA
    classDef middleware fill:#FBE9E7,stroke:#D84315
    classDef ext fill:#EDE7F6,stroke:#5E35B1
    classDef config fill:#ECEFF1,stroke:#546E7A
    classDef external fill:#FAFAFA,stroke:#BDBDBD
    classDef infra fill:#FFFDE7,stroke:#F9A825
```
