# fateh-dev/joetravel architecture

> Architecture diagram of the GitHub repository fateh-dev/joetravel, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fateh-dev/joetravel
- Repository: https://github.com/fateh-dev/joetravel

## Overview

##### High-Level Architecture Components

The system should be represented with these main components:

a. Frontend Layer (Angular)
- Components structure
- Feature modules
- Shared services
- Theme/UI components

b. Backend Layer (ASP.NET Core)
- API Controllers
- Application Services
- Domain Layer
- Entity Framework Core
- Database

##### Detailed Component Breakdown

- Main App Module
- Home Module (with sub-components: Trips, Guides, Destinations, Wishlist)
- Profile Module
- Authentication Components
- Shared Components
- ABP Theme Components

- HTTP API Layer
- Application Services
- Domain Services
- Entity Framework Core
- Database Layer

##### Key Relationships to Highlight

- HTTP/API communication between frontend and backend
- Internal dependencies between layers
- Data flow patterns
- Authentication flow

##### Specific Implementation Details

- Entity relationships (Trip, Guide, Tourist, etc.)
- Service interfaces
- Core business logic components
- Cross-cutting concerns (authentication, authorization)

**[Client Layer (Angular)]**
- ↕
**[API Gateway/Controllers]**
- ↕
**[Application Services]**
- ↕
**[Domain Layer]**
- ↕
**[Infrastructure Layer]**

##### Component Relationships

Show:
- REST API calls
- Database operations
- Service dependencies
- Module communications

- Clean architecture principles
- Separation of concerns
- Domain-driven design patterns
- Microservices-ready structure

- Component types
- Layer boundaries

This will provide a clear visualization of the travel application's architecture while maintaining the appropriate level of detail for a principal software engineer to understand the system's structure and interactions.

Remember to include notes about:
- Scalability points
- Security boundaries
- Data flow patterns
- Integration points

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef database fill:#f1c40f,stroke:#f39c12,color:black
    classDef security fill:#e74c3c,stroke:#c0392b,color:white
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Frontend Layer
    subgraph Frontend
        AppModule["Main App Module"]:::frontend
        HomeModule["Home Module"]:::frontend
        ProfileModule["Profile Module"]:::frontend
        AuthComp["Authentication Components"]:::frontend
        ThemeComp["ABP Theme Components"]:::frontend
        
        subgraph HomeComponents
            Trips["Trip Components"]:::frontend
            Guides["Guide Components"]:::frontend
            Destinations["Destination Components"]:::frontend
            Wishlist["Wishlist Components"]:::frontend
        end
        
        HomeModule --> HomeComponents
        AppModule --> HomeModule
        AppModule --> ProfileModule
        AppModule --> AuthComp
        AppModule --> ThemeComp
    end

    %% Backend Layer
    subgraph Backend
        APIControllers["HTTP API Controllers"]:::backend
        AppServices["Application Services"]:::backend
        DomainServices["Domain Services"]:::backend
        EFCore["Entity Framework Core"]:::backend
        DomainModels["Domain Models"]:::backend
        AppContracts["Application Contracts"]:::backend
        
        APIControllers --> AppServices
        AppServices --> DomainServices
        DomainServices --> EFCore
        DomainServices --> DomainModels
        AppServices --> AppContracts
    end

    %% Database Layer
    DB[(Database)]:::database
    EFCore --> DB

    %% Cross-Layer Communication
    Frontend --> APIControllers

    %% External Services
    IdentityServer["Identity Server"]:::external
    FileStorage["File Storage"]:::external
    
    AuthComp --> IdentityServer
    AppServices --> FileStorage

    %% Click Events
    click AppModule "https://github.com/Fateh-Dev/JoeTravel/blob/main/angular/src/app/app.module.ts"
    click HomeModule "https://github.com/Fateh-Dev/JoeTravel/blob/main/angular/src/app/home/home.module.ts"
    click ProfileModule "https://github.com/Fateh-Dev/JoeTravel/blob/main/angular/src/app/profile/profile.module.ts"
    click AuthComp "https://github.com/Fateh-Dev/JoeTravel/blob/main/angular/src/app/login/login.component.ts"
    click ThemeComp "https://github.com/Fateh-Dev/JoeTravel/blob/main/angular/src/abp/theme.basic/theme-basic.module.ts"
    click APIControllers "https://github.com/Fateh-Dev/JoeTravel/tree/main/aspnet-core/src/Joe.Travel.HttpApi/Controllers"
    click AppServices "https://github.com/Fateh-Dev/JoeTravel/blob/main/aspnet-core/src/Joe.Travel.Application"
    click DomainServices "https://github.com/Fateh-Dev/JoeTravel/blob/main/aspnet-core/src/Joe.Travel.Domain"
    click EFCore "https://github.com/Fateh-Dev/JoeTravel/blob/main/aspnet-core/src/Joe.Travel.EntityFrameworkCore/EntityFrameworkCore/TravelDbContext.cs"
    click DomainModels "https://github.com/Fateh-Dev/JoeTravel/tree/main/aspnet-core/src/Joe.Travel.Domain/Models"
    click AppContracts "https://github.com/Fateh-Dev/JoeTravel/blob/main/aspnet-core/src/Joe.Travel.Application.Contracts"
    click Trips "https://github.com/Fateh-Dev/JoeTravel/tree/main/angular/src/app/home/trips"
    click Guides "https://github.com/Fateh-Dev/JoeTravel/tree/main/angular/src/app/home/guides"
    click Destinations "https://github.com/Fateh-Dev/JoeTravel/tree/main/angular/src/app/home/destinations"
    click Wishlist "https://github.com/Fateh-Dev/JoeTravel/tree/main/angular/src/app/home/wishlist"
```
