# mskvszkyt/fitcheck architecture

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

- Interactive diagram: https://gitdiagram.com/mskvszkyt/fitcheck
- Repository: https://github.com/mskvszkyt/fitcheck

## Overview

##### Project type and purpose
- This is a full-stack social platform (“FitCheck”) comprising three main modules:
- ASP.NET Core Backend (REST API & business logic)
- React Frontend (SPA for users)
- WPF Desktop Admin (moderation & admin tasks)
- The platform persists user, post, comment, notification, follower data in a SQLite database and stores media files (avatars, post media) on disk.

##### File structure
- Top-level directories:
- backend/ – ASP.NET Core project with Controllers (MVC), DTOs, Models, Services, Data (EF Core, migrations), and wwwroot/uploads.
- frontend/ – React + TypeScript Vite project with src/components, src/pages, src/services (API interceptor), contexts, public assets.
- desktop app/FitCheck_WPFApp/ – WPF MVVM application (Views, ViewModels, Models, Services).
- LoginRequestsTest & LoginViewModelTests – unit tests for API DTOs and WPF VM logic.
- Shared/ – shared props/items across solutions.
- Notice: backend uses layered structure (Controllers → Services → Data). Desktop app follows MVVM (Views ↔ ViewModels ↔ Models + ApiService).

##### README insights
- Clearly states the three modules and how to run/deploy each.
- Mentions default admin credentials and configuration files (appsettings.json, interceptor.ts BASE_URL).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Tier
    subgraph "Presentation Tier" 
        direction TB
        ReactSPA["React SPA"]:::presentation
        WPFAdmin["WPF Desktop Admin"]:::presentation
    end

    %% React SPA Details
    subgraph "React SPA Components" 
        direction TB
        App["App.tsx"]:::presentation
        Components["Components"]:::presentation
        Pages["Pages"]:::presentation
        Interceptor["interceptor.ts"]:::presentation
        ProfileContext["ProfileContext.tsx"]:::presentation
    end

    ReactSPA --> App
    ReactSPA --> Components
    ReactSPA --> Pages
    ReactSPA --> Interceptor
    ReactSPA --> ProfileContext

    click App "https://github.com/mskvszkyt/fitcheck/blob/main/frontend/src/App.tsx"
    click Components "https://github.com/mskvszkyt/fitcheck/tree/main/frontend/src/components"
    click Pages "https://github.com/mskvszkyt/fitcheck/tree/main/frontend/src/pages"
    click Interceptor "https://github.com/mskvszkyt/fitcheck/blob/main/frontend/src/services/interceptor.ts"
    click ProfileContext "https://github.com/mskvszkyt/fitcheck/blob/main/frontend/src/contexts/ProfileContext.tsx"

    %% WPF Admin Details
    subgraph "WPF MVVM Client" 
        direction TB
        Views["Views"]:::presentation
        ViewModels["ViewModels"]:::presentation
        ModelsClient["Models"]:::presentation
        ApiServiceClient["ApiService.cs"]:::presentation
        AuthServiceClient["AuthService.cs"]:::presentation
    end

    WPFAdmin --> Views
    WPFAdmin --> ViewModels
    WPFAdmin --> ModelsClient
    WPFAdmin --> ApiServiceClient
    WPFAdmin --> AuthServiceClient

    click Views "https://github.com/mskvszkyt/fitcheck/tree/main/desktop app/FitCheck_WPFApp/Views"
    click ViewModels "https://github.com/mskvszkyt/fitcheck/tree/main/desktop app/FitCheck_WPFApp/ViewModels"
    click ModelsClient "https://github.com/mskvszkyt/fitcheck/tree/main/desktop app/FitCheck_WPFApp/Models"
    click ApiServiceClient "https://github.com/mskvszkyt/fitcheck/blob/main/desktop app/FitCheck_WPFApp/Services/ApiService.cs"
    click AuthServiceClient "https://github.com/mskvszkyt/fitcheck/blob/main/desktop app/FitCheck_WPFApp/Services/AuthService.cs"

    %% Backend Tier
    subgraph "Application Tier (API & Business Logic)" 
        direction TB
        Controllers["Controllers"]:::backend
        Services["Services"]:::backend
        DTOs["DTOs"]:::backend
        DataContext["ApplicationDbContext"]:::backend
    end

    ReactSPA -->|HTTPS| Controllers
    WPFAdmin -->|HTTPS| Controllers

    Controllers --> Services
    Services --> DataContext
    Services -->|File ops| FileStorage
    Controllers --> DTOs

    %% Data Tier
    subgraph "Data & Storage" 
        direction TB
        SQLiteDB["SQLite (fitcheck.db)"]:::data
        Migrations["EF Core Migrations"]:::data
        FileStorage["Uploads (avatars, posts)"]:::data
    end

    DataContext --> SQLiteDB
    DataContext --> Migrations
    DataContext --> FileStorage

    click SQLiteDB "https://github.com/mskvszkyt/fitcheck/blob/main/backend/Data/fitcheck.db"
    click Migrations "https://github.com/mskvszkyt/fitcheck/blob/main/backend/Migrations/ApplicationDbContextModelSnapshot.cs"
    click FileStorage "https://github.com/mskvszkyt/fitcheck/tree/main/backend/wwwroot/uploads/avatars"

    %% Configuration & Shared
    Shared["Shared Library"]:::aux
    Config["appsettings.json & launchSettings.json"]:::aux

    Controllers --> Config
    ReactSPA --> Config
    Shared --> Controllers
    Shared --> ReactSPA
    Shared --> WPFAdmin

    %% Styles
    classDef presentation fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef backend fill:#d4edda,stroke:#333,stroke-width:1px
    classDef data fill:#fff3cd,stroke:#333,stroke-width:1px
    classDef aux fill:#e2e3e5,stroke:#333,stroke-width:1px
```
