# ruslanpidhainyi/ew-travelapp-.net8-angular17 architecture

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

- Interactive diagram: https://gitdiagram.com/ruslanpidhainyi/ew-travelapp-.net8-angular17
- Repository: https://github.com/ruslanpidhainyi/ew-travelapp-.net8-angular17

## Overview

##### High-Level Components

a) Client-Side (Angular Frontend):
- User Interface Modules (Auth, Posts, Messages, Admin)
- Services Layer
- Interceptors
- Guards
- Models

b) Server-Side (ASP.NET Core Backend):
- Controllers
- DTOs
- Services
- Repositories
- SignalR Hubs

c) External Services:

##### Component Relationships

a) Client-Server Communication:
- WebSocket connection for real-time features (SignalR)

b) Data Flow:

##### Detailed Component Breakdown

Create sub-sections showing:

a) Frontend Architecture:
**Angular Frontend**
- Core Modules
- Authentication
- User Management
- Posts Management
- Messaging
- Shared Services
- Account Service
- Message Service
- Posts Service
- Real-time Components
- SignalR Clients

b) Backend Architecture:
**ASP.NET Core API**
- Controllers Layer
- Business Logic Layer
- Services
- DTOs
- Data Access Layer
- Repositories
- Entity Models
- Real-time Hubs
- MessageHub
- PresenceHub

##### Special Features to Highlight

- Real-time messaging system
- Photo upload functionality
- User authentication flow
- Admin management features

##### Technical Details

Annotations showing:
- Angular version
- .NET Core version
- SignalR implementation
- JWT authentication flow
- Repository pattern implementation
- Entity Framework Core usage

##### Data Flow Patterns

Illustrate:
- User authentication flow
- Post creation and management
- Message handling
- Real-time presence tracking
- Photo upload process

Remember to:
- Use consistent symbols and notation
- Brief descriptions for complex interactions
- Security boundaries
- Scalability points

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client["Angular Frontend"]
        direction TB
        UI["User Interface Layer"]
        
        subgraph Modules["Core Modules"]
            direction TB
            Auth["Authentication Module"]:::frontend
            Posts["Posts Module"]:::frontend
            Messages["Messages Module"]:::frontend
            Admin["Admin Module"]:::frontend
        end
        
        subgraph Services["Services Layer"]
            direction TB
            AccService["Account Service"]:::frontend
            PostService["Posts Service"]:::frontend
            MsgService["Message Service"]:::frontend
            AdminService["Admin Service"]:::frontend
        end
        
        subgraph Security["Security Layer"]
            direction TB
            Guards["Auth Guards"]:::security
            Interceptors["JWT & Error Interceptors"]:::security
        end
    end
    
    subgraph Server["ASP.NET Core Backend"]
        direction TB
        subgraph Controllers["Controllers Layer"]
            direction TB
            AccController["Account Controller"]:::backend
            PostController["Posts Controller"]:::backend
            MsgController["Messages Controller"]:::backend
            AdminController["Admin Controller"]:::backend
        end
        
        subgraph BLL["Business Logic Layer"]
            direction TB
            DTOs["Data Transfer Objects"]:::backend
            TokenService["Token Service"]:::backend
            PhotoService["Photo Service"]:::backend
        end
        
        subgraph DAL["Data Access Layer"]
            direction TB
            Repos["Repositories"]:::backend
            DbContext["App DbContext"]:::backend
        end
        
        subgraph RealTime["Real-time Communication"]
            direction TB
            MsgHub["Message Hub"]:::backend
            PresenceHub["Presence Hub"]:::backend
        end
        
        ErrorMiddleware["Exception Middleware"]:::backend
    end
    
    Database[(SQL Database)]:::database
    Cloudinary["Cloudinary Storage"]:::external
    
    UI --> Modules
    Modules --> Services
    Services --> Security
    Security --> Controllers
    Controllers --> BLL
    BLL --> DAL
    DAL --> Database
    PhotoService --> Cloudinary
    RealTime --> Services
    
    %% Click events for component mapping
    click Auth "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/tree/main/Client/src/app/login/"
    click Posts "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/tree/main/Client/src/app/offers/"
    click Messages "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/tree/main/Client/src/app/messages/"
    click Admin "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/tree/main/Client/src/app/admin/"
    click AccService "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/Client/src/app/_services/account.service.ts"
    click PostService "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/Client/src/app/_services/posts.service.ts"
    click MsgService "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/Client/src/app/_services/message.service.ts"
    click AdminService "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/Client/src/app/_services/admin.service.ts"
    click Guards "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/tree/main/Client/src/app/_guards/"
    click Interceptors "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/Client/src/app/_interceptors/jwt.interceptor.ts"
    click AccController "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/API/Controllers/AccountController.cs"
    click PostController "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/API/Controllers/PostsController.cs"
    click MsgController "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/API/Controllers/MessagesController.cs"
    click AdminController "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/API/Controllers/AdminController.cs"
    click DTOs "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/tree/main/API/DTOs/"
    click TokenService "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/API/Services/TokenService.cs"
    click PhotoService "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/API/Services/PhotoService.cs"
    click Repos "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/tree/main/API/Data/Repositories/"
    click DbContext "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/API/Data/AppDbContext.cs"
    click MsgHub "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/API/SignalR/MessageHub.cs"
    click PresenceHub "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/API/SignalR/PresenceHub.cs"
    click ErrorMiddleware "https://github.com/RuslanPidhainyi/EW-TravelApp-.Net8-Angular17/blob/main/API/Middleware/ExceptionMiddleware.cs"
    
    %% Styling
    classDef frontend fill:#2196F3,color:white
    classDef backend fill:#4CAF50,color:white
    classDef security fill:#f44336,color:white
    classDef database fill:#607D8B,color:white
    classDef external fill:#FFC107,color:black
    
    %% Legend
    subgraph Legend
        Frontend["Frontend Component"]:::frontend
        Backend["Backend Component"]:::backend
        Security["Security Component"]:::security
        Database2["Database"]:::database
        External["External Service"]:::external
    end
```
