# juanfelipecano/planner architecture

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

- Interactive diagram: https://gitdiagram.com/juanfelipecano/planner
- Repository: https://github.com/juanfelipecano/planner

## Overview

##### Project Type & Purpose
- PlannerApp is a front-end web application built with Angular CLI (version 17.2.3). It appears to be designed as a planner/todo management or scheduling application, with dedicated modules for account management (registration, account creation), authentication (sign in), and planning (tasks, dashboard, profile).
- The README explains how to serve, build, and test the project, but most of the architectural details can be derived from the structured “src” directory.

##### File Structure
- Top-level directories include configuration and environment files (angular.json, tsconfig files, src/environments) which set up the build and development environment.
- The “src/app” folder is subdivided into:
- API: Contains modules for http services, interceptors (for error handling and headers), and API requests/responses. This shows that the app interacts with external back-end services.
- Common: Includes providers, common services (e.g., session storage, translation), and base classes. This components can be considered as utilities or shared services.
- Config: Holds global and service-specific configuration settings, as well as imports and translations configurations.
- Features: Organized by domain (account, authentication, planner, public) where each feature has its own routing, pages, components, guards, repositories, and sometimes micro-level config.
- Shared: Contains UI components (alerts, date pickers, full screen, tabs etc.), animations, directives, pipes, and decorators. This is likely the design system or reusable component library for the project.
- There are additional files and folders for tests (.spec.ts files) throughout the project, demonstrating that unit testing is an integral part of the system.

##### Main Components and Their Relationships
- Client/UI Layer (Angular Components):
- Main App Component: Entrypoint for the application.
- Feature Modules: Account, Authentication, Planner, and Public pages. Each feature module may have its own routing (e.g., account.routes.ts, authentication.routes.ts, planner.routes.ts) and components for pages and dialogs.
- Shared Components: Reusable UI components (ds-button, ds-input, ds-header, alerts, etc.), animations, and directives that enhance the UI experience.
- API & Communication:
- HTTP Service: Located in the “src/app/api/http-service”, responsible for making HTTP calls.
- Interceptors (error and headers): Clear designation of handling HTTP errors and adding required headers for every outgoing request.
- Requests, Responses, and Services: Structured abstraction for creating API request objects and handling service-level logic.
- Common and Configuration Layers:
- Common Providers/Services: Session Storage and translation management, global providers.
- Config: Centralized app configuration and import/execution of shared modules.
- Build and Deployment Mechanisms:
- Azure and GitHub workflows (.azure, .github folders) indicate CI/CD pipelines for building and testing.
- Environment-specific configurations suggest that the build can adapt to different deployment environments.

##### Elements
- Clear labels for each component (e.g., “Account Feature Module – Registration Page, Account Repository”, “HTTP Service”, “Error Interceptor”, “Shared ds-button Component”).
- Data flow from UI components to services.
- Communication from API modules to external services (if any).
- Dependencies between configuration modules, providers, and the rest of the app.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        mainApp["Main App Component"] 
        account["Account Feature Module"]
        auth["Authentication Feature Module"]
        planner["Planner Feature Module"]
        pub["Public Feature Module"]
    end

    %% Shared Components & Providers
    subgraph "Shared & Providers"
        sharedComponents["Shared UI Components"]
        sessionStorage["Session Storage Provider"]
        translation["Translation Provider"]
    end

    %% API Communication Layer
    subgraph "API Communication"
        http["HTTP Service"]
        errorInter["Error Interceptor"]
        headersInter["Headers Interceptor"]
        apiServices["API Services"]
    end

    %% Configuration Layer
    subgraph "Configurations"
        globalConfig["Global Configuration"]
        angularConfig["angular.json"]
        envs["Environments"]
    end

    %% CI/CD & Deployment Layer
    subgraph "CI/CD & Deployment"
        azure["Azure Workflows"]
        github["GitHub Workflows"]
    end

    %% Relationships from Presentation Layer
    mainApp -->|"routes"| account
    mainApp -->|"routes"| auth
    mainApp -->|"routes"| planner
    mainApp -->|"routes"| pub

    %% Feature Modules use API Communication
    account -->|"uses"| http
    auth -->|"uses"| http
    planner -->|"uses"| http
    pub -->|"uses"| http

    %% HTTP Service relationships
    http -->|"intercepts"| errorInter
    http -->|"intercepts"| headersInter
    http -->|"calls"| apiServices

    %% Shared Components & Providers Integration
    sessionStorage -->|"availableTo"| mainApp
    translation -->|"availableTo"| mainApp
    sharedComponents -->|"integratedIn"| mainApp

    %% Configuration Dependencies
    globalConfig -->|"configures"| mainApp
    angularConfig -->|"defines"| globalConfig
    envs -->|"defines"| globalConfig

    %% CI/CD Integration
    azure -->|"CI/CD"| globalConfig
    github -->|"CI/CD"| globalConfig

    %% Styling Classes
    class mainApp,account,auth,planner,pub presentation
    class sharedComponents,sessionStorage,translation shared
    class http,errorInter,headersInter,apiServices api
    class globalConfig,angularConfig,envs config
    class azure,github cicd

    %% Click Events
    click mainApp "https://github.com/juanfelipecano/planner/blob/main/src/app/app.component.ts"
    click account "https://github.com/juanfelipecano/planner/tree/main/src/app/features/account"
    click auth "https://github.com/juanfelipecano/planner/tree/main/src/app/features/authentication"
    click planner "https://github.com/juanfelipecano/planner/tree/main/src/app/features/planner"
    click pub "https://github.com/juanfelipecano/planner/tree/main/src/app/features/public"
    click sharedComponents "https://github.com/juanfelipecano/planner/tree/main/src/app/shared/components"
    click http "https://github.com/juanfelipecano/planner/blob/main/src/app/api/http-service/http.service.ts"
    click errorInter "https://github.com/juanfelipecano/planner/blob/main/src/app/api/interceptors/error/error.interceptor.ts"
    click headersInter "https://github.com/juanfelipecano/planner/blob/main/src/app/api/interceptors/headers/headers.interceptor.ts"
    click apiServices "https://github.com/juanfelipecano/planner/tree/main/src/app/api/requests"
    click sessionStorage "https://github.com/juanfelipecano/planner/blob/main/src/app/common/providers/session-storage.provider.ts"
    click translation "https://github.com/juanfelipecano/planner/blob/main/src/app/common/providers/translate.provider.ts"
    click globalConfig "https://github.com/juanfelipecano/planner/tree/main/src/app/config"
    click angularConfig "https://github.com/juanfelipecano/planner/blob/main/angular.json"
    click envs "https://github.com/juanfelipecano/planner/tree/main/src/environments"
    click azure "https://github.com/juanfelipecano/planner/tree/main/.azure/workflows"
    click github "https://github.com/juanfelipecano/planner/tree/main/.github/workflows"

    %% Class Definitions for Colors
    classDef presentation fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef shared fill:#D7BDE2,stroke:#6C3483,stroke-width:2px;
    classDef api fill:#A9DFBF,stroke:#145A32,stroke-width:2px;
    classDef config fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef cicd fill:#F5CBA7,stroke:#BA4A00,stroke-width:2px;
```
