# darshan-darsh2003/first-ng-app architecture

> Architecture diagram of the GitHub repository darshan-darsh2003/first-ng-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/darshan-darsh2003/first-ng-app
- Repository: https://github.com/darshan-darsh2003/first-ng-app

## Overview

##### Project Type Analysis
This is a single-page application (SPA) built with Angular 17.x, focusing on todo list management functionality. The architecture should reflect Angular's component-based structure and the application's feature organization.

##### Main Components

A. Core Application Layer:
- AppComponent as the root component
- App.config.ts and app.routes.ts as configuration elements

B. Feature Components (organize in a hierarchical structure):
- Home Component
- Todos Component (main feature)
- Supporting Components:
- Header Component
- Counter Component
- Greeting Component
- Todo Item Component

C. Service Layer:
- TodosService (show as a singleton service)

D. Utility Layers:
- Pipes (FilterTodosPipe)
- Directives (HighlightCompletedTodoDirective)
- Models (todo.type.ts)

**┌─ Angular Application ──────────────────────────┐**

- ┌─ Core ─────────┐    ┌─ Services ───────┐   │
- AppComponent   │    │ TodosService     │   │
- AppConfig      │    └─────────────────┘   │
- AppRoutes      │                          │
- ┘                           │

- ┌─ Features ──────────────────────────────┐ │
- ┌─ Home ─┐  ┌─ Todos ──────────────┐   │ │
- TodosComponent       │   │ │
- ┘  │ TodoItemComponent    │   │ │
- ┘    │ │
- ┌─ Shared ────────────────────────┐   │ │
- HeaderComponent                 │   │ │
- CounterComponent               │   │ │
- GreetingComponent             │   │ │
- ┘   │ │
- ┘ │

- ┌─ Utilities ───────────────────────────┐ │
- FilterTodosPipe                       │ │
- HighlightCompletedTodoDirective       │ │
- Todo Model                            │ │
- ┘ │
- ┘

##### Important Notes

- Component-based architecture
- Separation of concerns between components, services, and utilities
- Unidirectional data flow pattern used in Angular
- Entry points and bootstrapping process

Remember to use standard UML notation where appropriate but feel free to simplify when it adds clarity. The goal is to communicate the architecture effectively rather than strictly adhering to formal notation.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Angular_Application
        subgraph Core
            AppComponent["AppComponent"]:::core
            AppConfig["AppConfig"]:::core
            AppRoutes["AppRoutes"]:::core
        end

        subgraph Services
            TodosService["TodosService"]:::service
        end

        subgraph Features
            subgraph Home
                HomeComponent["HomeComponent"]:::feature
            end

            subgraph Todos
                TodosComponent["TodosComponent"]:::feature
                TodoItemComponent["TodoItemComponent"]:::feature
                TodosComponent --> TodoItemComponent
            end

            subgraph Shared
                HeaderComponent["HeaderComponent"]:::feature
                CounterComponent["CounterComponent"]:::feature
                GreetingComponent["GreetingComponent"]:::feature
            end
        end

        subgraph Utilities
            FilterTodosPipe["FilterTodosPipe"]:::utility
            HighlightDirective["HighlightCompletedTodoDirective"]:::utility
            TodoModel["Todo Model"]:::model
        end

        %% Core relationships
        AppComponent --> HomeComponent
        AppComponent --> TodosComponent
        AppComponent --> HeaderComponent

        %% Service relationships
        TodosService -.-> TodosComponent
        TodosService -.-> TodoItemComponent

        %% Utility relationships
        TodoModel -.-> TodosComponent
        TodoModel -.-> TodoItemComponent
        FilterTodosPipe -.-> TodosComponent
        HighlightDirective -.-> TodoItemComponent
    end

    %% Click events for component mapping
    click AppComponent "https://github.com/Darshan-darsh2003/first-ng-app/blob/main/src/app/app.component.ts"
    click AppConfig "https://github.com/Darshan-darsh2003/first-ng-app/blob/main/src/app/app.config.ts"
    click AppRoutes "https://github.com/Darshan-darsh2003/first-ng-app/blob/main/src/app/app.routes.ts"
    click HomeComponent "https://github.com/Darshan-darsh2003/first-ng-app/blob/main/src/app/home/home.component.ts"
    click TodosComponent "https://github.com/Darshan-darsh2003/first-ng-app/blob/main/src/app/todos/todos.component.ts"
    click HeaderComponent "https://github.com/Darshan-darsh2003/first-ng-app/blob/main/src/app/components/header/header.component.ts"
    click CounterComponent "https://github.com/Darshan-darsh2003/first-ng-app/blob/main/src/app/components/counter/counter.component.ts"
    click GreetingComponent "https://github.com/Darshan-darsh2003/first-ng-app/blob/main/src/app/components/greeting/greeting.component.ts"
    click TodoItemComponent "https://github.com/Darshan-darsh2003/first-ng-app/blob/main/src/app/components/todo-item/todo-item.component.ts"
    click TodosService "https://github.com/Darshan-darsh2003/first-ng-app/blob/main/src/app/services/todos.service.ts"
    click FilterTodosPipe "https://github.com/Darshan-darsh2003/first-ng-app/blob/main/src/app/pipes/filter-todos.pipe.ts"
    click HighlightDirective "https://github.com/Darshan-darsh2003/first-ng-app/blob/main/src/app/directives/highlight-completed-todo.directive.ts"
    click TodoModel "https://github.com/Darshan-darsh2003/first-ng-app/blob/main/src/app/components/models/todo.type.ts"

    %% Styling
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef feature fill:#4CAF50,stroke:#2E7D32,color:white
    classDef service fill:#FFC107,stroke:#FFA000,color:black
    classDef utility fill:#9E9E9E,stroke:#616161,color:white
    classDef model fill:#9C27B0,stroke:#7B1FA2,color:white

    %% Legend
    subgraph Legend
        CoreLegend["Core Component"]:::core
        FeatureLegend["Feature Component"]:::feature
        ServiceLegend["Service"]:::service
        UtilityLegend["Utility"]:::utility
        ModelLegend["Model"]:::model
    end
```
