# uberney2/pro-decider-front architecture

> Architecture diagram of the GitHub repository uberney2/pro-decider-front, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/uberney2/pro-decider-front
- Repository: https://github.com/uberney2/pro-decider-front

## Overview

##### Project Type and Purpose
- This project is a front-end application built with React and TypeScript, configured with Vite for fast development and HMR.
- The file tree indicates a structured single-page application with multiple routes (pages) – for example, account management (create, edit, key people), pursuits, login, and home – suggesting a feature-rich UI with different screens.
- The README emphasizes a minimal setup and explains ESLint extensions, reinforcing that the focus is on front-end development best practices.

##### Analyzing the File Structure
- Top-Level:
- Core configuration files such as package.json, tsconfig files, vite.config.ts, and index.html are present.
- The "public" and "src" directories handle static assets and source code respectively.
- In the "src" directory:
- The "components" folder is organized into UI pieces (e.g., PursuitCard, TagInput, navbar) with modular CSS, implying reuse across different pages.
- The "pages" directory contains several subdirectories (account, pursuits, login, home, protectedLayout) that represent feature-specific views. This aligns with typical routing and layout patterns in a React app.
- The "context" directory (with files like AuthContext.tsx) suggests the use of React’s context API to manage global state (e.g., authentication).
- The "service" directory groups modules like accountService, authService, etc., which implies a dedicated layer for handling API calls or business logic.
- The "types" directory defines TypeScript models/interfaces used throughout the app to enforce type safety.

a. Main Components to Include:
- UI Layer: Break this into two parts, based on pages and reusable components:
- Pages: Components for account management (create, edit, key people), pursuits (various dimension pages, create, edit, view), login, home, and protected layouts.
- Reusable UI Components: Navigation bar, PursuitCard, TagInput, etc.
- State Management: The AuthContext (and possibly other context providers) managing global state.
- Service Layer: Represent the service modules (authService, accountService, projectService, etc.) abstracting data fetching and business logic.
- Type Definitions: Incorporate the TypeScript types folder as the underlying data contracts that tie the UI and services together.
- Infrastructure & Tooling: Include the Vite bundler and hot module replacement (HMR) process along with ESLint configuration which enforces code quality disciplines.

b. Relationships and Interactions:
- Routes -> Pages: Illustrate how different URLs map to specific page components.
- Context Layer: Show how pages and components consume AuthContext for authentication and user data management.

c. Architectural Patterns and Design Principles:
- Component-based UI: The modular organization of components and CSS modules.
- Separation of Concerns: Distinguish between UI presentation (components/pages), state management (context), and business logic/API calls (services).
- Type Safety: Integration of TypeScript throughout (notably in types and tsconfig files) ensuring contract consistency.

d. Technologies, Frameworks, and Tools:
- React for building UI components and managing component state.
- Vite as a rapid bundler and development server for fast refresh (HMR).
- TypeScript for robust type-checking.
- ESLint (and its specific plugins for React and TypeScript) for code quality.
- CSS Modules for scoped styling within components.

##### Elements
- Optional Notation: You might want to note technological details (e.g., “Developed with React + TypeScript”, “Built with Vite”) near the relevant blocks.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "React Application"
        %% UI Layer
        subgraph "UI Layer"
            subgraph "Pages"
                subgraph "Account Pages"
                    A1("Account Overview (Account.tsx)"):::pages
                    A2("Edit Account Page (AccountEditPage.tsx)"):::pages
                    A3("Key People Form (AccountKeyPeopleForm.tsx)"):::pages
                    A4("Create Account Page (AccountCreatePage.tsx)"):::pages
                    A5("Create Account Container (AccountCreatePageContainer.tsx)"):::pages
                end
                subgraph "Pursuits Pages"
                    P1("General Pursuits Listing (Pursuits.tsx)"):::pages
                    PD1("Gut Dimension Page (GutDimensionPage.tsx)"):::pages
                    PD2("Plan Dimension Page (PlanDimensionPage.tsx)"):::pages
                    PD3("Process Dimension Page (ProcessDimensionPage.tsx)"):::pages
                    PD4("QA Dimension Page (QADimensionPage.tsx)"):::pages
                    PD5("Team Dimension Page (TeamDimensionPage.tsx)"):::pages
                    CRP1("Create Pursuit Container (NewPursuitPageContainer.tsx)"):::pages
                    CRP2("Create Pursuit Details Form (NewPursuitDetailsForm.tsx)"):::pages
                    EP1("Edit Pursuit Container (EditPursuitPageContainer.tsx)"):::pages
                    EP2("Edit Pursuit Details Form (EditPursuitDetailsForm.tsx)"):::pages
                    Padd1("Droppable Column (DroppableColumn.tsx)"):::pages
                    Padd2("Sortable Pursuit Card (SortablePursuitCard.tsx)"):::pages
                end
                subgraph "Other Pages"
                    L("Login Page (Login.tsx)"):::pages
                    H("Home Page (Home.tsx)"):::pages
                    PL("Protected Layout (protectedLayout.tsx)"):::pages
                end
            end
            subgraph "Reusable UI Components"
                N("Navbar Component (Navbar.tsx)"):::components
                PC("PursuitCard Component (PursuitCard.tsx)"):::components
                TI("TagInput Component (TagInput.tsx)"):::components
            end
        end

        %% State Management
        subgraph "State Management"
            AC("Auth Context (AuthContext.tsx)"):::context
        end

        %% Service Layer
        subgraph "Service Layer"
            AS("Account Service (accountService.ts)"):::services
            AUTHS("Auth Service (authService.ts)"):::services
            BOS("Business Owner Service (buOwnerService.ts)"):::services
            PS("Project Service (projectService.ts)"):::services
        end

        %% Type Definitions
        subgraph "Type Definitions"
            T("Types (src/types)"):::types
        end

        %% Infrastructure & Tooling
        subgraph "Infrastructure & Tooling"
            V("Vite Config & Env (vite.config.ts, vite-env.d.ts)"):::infra
            ESL("ESLint Config (eslint.config.js)"):::infra
            CF("Core Files (package.json, tsconfig.json, tsconfig.app.json, tsconfig.node.json, index.html)"):::infra
        end
    end

    %% Interactions between layers
    A4 -->|"calls"| AS
    A2 -->|"updates"| AS
    L -->|"calls"| AUTHS
    L -->|"updates"| AC
    H -->|"consumes"| AC
    P1 -->|"fetches"| PS
    EP1 -->|"updates"| PS
    L -->|"renders"| N
    P1 -->|"renders"| PC
    P1 -->|"renders"| TI
    AUTHS -->|"auth_update"| AC

    %% Overall UI Layer interactions
    %% Pages interact with Context and Service layers
    A1 --- AC
    PD1 --- PS
    CRP1 --- PS

    %% Classes for colors and styles
    classDef pages fill:#add8e6,stroke:#1f78b4,stroke-width:2px;
    classDef components fill:#87cefa,stroke:#4682b4,stroke-width:2px;
    classDef context fill:#d4edda,stroke:#28a745,stroke-width:2px;
    classDef services fill:#ffdead,stroke:#ff8c00,stroke-width:2px;
    classDef types fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
    classDef infra fill:#fffacd,stroke:#f0e68c,stroke-width:2px;

    %% Click Events for Pages - Account
    click A1 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/account/Account.tsx"
    click A2 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/account/edit-account/AccountEditPage.tsx"
    click A3 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/account/key-people/AccountKeyPeopleForm.tsx"
    click A4 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/account/create-account/AccountCreatePage.tsx"
    click A5 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/account/create-account/AccountCreatePageContainer.tsx"

    %% Click Events for Pages - Pursuits
    click P1 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/pursuits/Pursuits.tsx"
    click PD1 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/pursuits/GutDimensionPage/GutDimensionPage.tsx"
    click PD2 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/pursuits/PlanDimensionPage/PlanDimensionPage.tsx"
    click PD3 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/pursuits/ProcessDimensionPage/ProcessDimensionPage.tsx"
    click PD4 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/pursuits/QADimensionPage/QADimensionPage.tsx"
    click PD5 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/pursuits/TeamDimensionPage/TeamDimensionPage.tsx"
    click CRP1 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/pursuits/create-pursuit/NewPursuitPageContainer.tsx"
    click CRP2 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/pursuits/create-pursuit/NewPursuitDetailsForm.tsx"
    click EP1 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/pursuits/edit-pursuit/EditPursuitPageContainer.tsx"
    click EP2 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/pursuits/edit-pursuit/EditPursuitDetailsForm.tsx"
    click Padd1 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/pursuits/DroppableColumn.tsx"
    click Padd2 "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/pursuits/SortablePursuitCard.tsx"

    %% Click Events for Pages - Other
    click L "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/login/Login.tsx"
    click H "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/home/Home.tsx"
    click PL "https://github.com/uberney2/pro-decider-front/blob/main/src/pages/protectedLayout/protectedLayout.tsx"

    %% Click Events for Reusable UI Components
    click N "https://github.com/uberney2/pro-decider-front/blob/main/src/components/navbar/Navbar.tsx"
    click PC "https://github.com/uberney2/pro-decider-front/blob/main/src/components/PursuitCard/PursuitCard.tsx"
    click TI "https://github.com/uberney2/pro-decider-front/blob/main/src/components/TagInput/TagInput.tsx"

    %% Click Event for State Management
    click AC "https://github.com/uberney2/pro-decider-front/blob/main/src/context/AuthContext.tsx"

    %% Click Events for Service Layer
    click AS "https://github.com/uberney2/pro-decider-front/blob/main/src/service/accountService.ts"
    click AUTHS "https://github.com/uberney2/pro-decider-front/blob/main/src/service/authService.ts"
    click BOS "https://github.com/uberney2/pro-decider-front/blob/main/src/service/buOwnerService.ts"
    click PS "https://github.com/uberney2/pro-decider-front/blob/main/src/service/projectService.ts"

    %% Click Event for Type Definitions
    click T "https://github.com/uberney2/pro-decider-front/tree/main/src/types"

    %% Click Events for Infrastructure & Tooling
    click V "https://github.com/uberney2/pro-decider-front/blob/main/vite.config.ts"
    click ESL "https://github.com/uberney2/pro-decider-front/blob/main/eslint.config.js"
    click CF "https://github.com/uberney2/pro-decider-front/blob/main/package.json"
```
