# patrykwitek/garden-design-app-.net-angular architecture

> Architecture diagram of the GitHub repository patrykwitek/garden-design-app-.net-angular, 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/patrykwitek/garden-design-app-.net-angular
- Repository: https://github.com/patrykwitek/garden-design-app-.net-angular

## Overview

##### Main Components

Frontend Layer:
- Angular Application (TypeScript/JavaScript)
- Components Module
- Services Module
- Shared Components
- Models/Interfaces
- Assets (3D models, textures, translations)
- WebGL/ThreeJS Integration

Backend Layer:
- ASP.NET Core API
- Controllers
- Data Layer (Entity Framework Core)
- Services
- DTOs
- Middleware
- Authentication/Authorization

Database:
- SQLite Database (indicated by the presence of SQLite dependencies)

##### Key Architectural Elements

a) Client-Side (Frontend):
- Core Modules:
- * App Module
- * Shared Module
- * Components (Admin, Garden Tools, Navigation)
- Services:
- * Engine Service (3D rendering)
- * Garden Service
- * Project Service
- * User Service
- State Management:
- * User Authentication
- * Project Data
- * Garden Elements

b) Server-Side (Backend):
- API Controllers:
- * Projects
- * Login
- * Language
- * Solution
- Data Access:
- * Entity Framework Core
- * Repositories
- * Unit of Work Pattern
- Domain Entities:
- * User
- * Project
- * Garden Elements
- * Environment

##### Integration Points

Key interactions:
- JWT Authentication Flow
- API Endpoints Communication
- File Generation (PDF)
- 3D Model Loading
- Database Operations

##### Specific Implementation Details

Specialized components:
- 3D Visualization Engine:
- * ThreeJS Integration
- * Camera Controls
- * Element Manipulation
- Garden Design Tools:
- * Element Placement
- * Ground Management
- * Environment Settings

**Top Layer: User Interface & Client Logic**
**Middle Layer: API & Business Logic**
**Bottom Layer: Data Storage & Persistence**

##### Flow Indicators

Key flows:
- User authentication process
- Project creation/modification
- 3D model rendering pipeline
- PDF generation process
- Data persistence operations

##### The modular structure of both frontend and backend

This system design should reflect the application's focus on 3D garden design while showing how all components work together to provide the complete functionality described in the README.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        AppModule["App Module"]:::frontend
        SharedModule["Shared Module"]:::frontend
        Components["Components"]:::frontend
        
        subgraph Services
            EngineService["Engine Service"]:::service
            GardenService["Garden Service"]:::service
            ProjectService["Project Service"]:::service
            UserService["User Service"]:::service
        end
        
        subgraph Tools
            GardenTool["Garden Element Tool"]:::tool
            EntranceTool["Entrance Tool"]:::tool
        end
        
        subgraph Components_Detail
            AdminComp["Admin Components"]:::component
            NavComp["Navigation"]:::component
            GardenTools["Garden Tools"]:::component
        end
        
        subgraph Assets
            Models["3D Models"]:::asset
            Textures["Textures"]:::asset
        end
    end
    
    subgraph Backend
        subgraph Controllers
            ProjectsCtrl["Projects Controller"]:::controller
            LoginCtrl["Login Controller"]:::controller
            APIControllers["API Controllers"]:::controller
        end
        
        subgraph DataLayer
            EFContext["Entity Framework Context"]:::data
            Repositories["Repositories"]:::data
            UnitOfWork["Unit of Work"]:::data
        end
        
        subgraph Auth
            TokenService["Token Service"]:::security
            AuthExtensions["Authentication Extensions"]:::security
        end
        
        subgraph Domain
            DTOs["DTO Models"]:::model
            Entities["Entity Models"]:::model
        end
        
        ExceptionMiddleware["Exception Middleware"]:::middleware
    end
    
    Database[(SQLite Database)]:::database
    
    %% Relationships
    AppModule --> SharedModule
    AppModule --> Components
    Components --> Components_Detail
    Services --> Components
    Tools --> Components
    
    Components --> APIControllers
    APIControllers --> DataLayer
    DataLayer --> Database
    Auth --> APIControllers
    DTOs --> APIControllers
    Entities --> DataLayer
    
    %% Click Events
    click AppModule "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/frontend/src/app/app.module.ts"
    click SharedModule "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/frontend/src/app/shared-modules/shared.module.ts"
    click Components "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/tree/main/frontend/src/app/components/"
    click EngineService "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/frontend/src/app/services/engine.service.ts"
    click GardenService "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/frontend/src/app/services/garden.service.ts"
    click ProjectService "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/frontend/src/app/services/project.service.ts"
    click UserService "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/frontend/src/app/services/user.service.ts"
    click AdminComp "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/tree/main/frontend/src/app/components/admin/"
    click NavComp "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/tree/main/frontend/src/app/components/nav/"
    click GardenTools "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/tree/main/frontend/src/app/components/nav-garden-options/"
    click APIControllers "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/tree/main/backend/Controllers/"
    click ProjectsCtrl "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/backend/Controllers/ProjectsController.cs"
    click LoginCtrl "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/backend/Controllers/LoginController.cs"
    click EFContext "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/backend/Data/Context/DataContext.cs"
    click Repositories "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/tree/main/backend/Repositories/"
    click UnitOfWork "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/backend/Data/UnitOfWork.cs"
    click DTOs "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/tree/main/backend/DTO/"
    click TokenService "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/backend/Services/TokenService.cs"
    click AuthExtensions "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/backend/Extensions/IdentityServiceExtensions.cs"
    click ExceptionMiddleware "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/backend/Middleware/ExceptionMiddleware.cs"
    click Entities "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/tree/main/backend/Entities/"
    click Models "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/tree/main/frontend/src/assets/3d models/"
    click Textures "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/tree/main/frontend/src/assets/textures/"
    click GardenTool "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/frontend/src/app/tools/garden-element-tool.service.ts"
    click EntranceTool "https://github.com/patrykwitek/Garden-Design-App-.NET-Angular/blob/main/frontend/src/app/tools/entrance-tool.service.ts"
    
    %% Styles
    classDef frontend fill:#2196F3,color:white
    classDef service fill:#1976D2,color:white
    classDef tool fill:#0D47A1,color:white
    classDef component fill:#64B5F6,color:white
    classDef asset fill:#90CAF9,color:black
    classDef controller fill:#4CAF50,color:white
    classDef data fill:#388E3C,color:white
    classDef security fill:#f44336,color:white
    classDef model fill:#81C784,color:black
    classDef middleware fill:#66BB6A,color:white
    classDef database fill:#FFC107,color:black
```
