# takuyaw-w/vue3-with-todo architecture

> Architecture diagram of the GitHub repository takuyaw-w/vue3-with-todo, 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/takuyaw-w/vue3-with-todo
- Repository: https://github.com/takuyaw-w/vue3-with-todo

## Overview

##### Main Components
- Frontend Application Layer:
- Views: Represent pages (e.g., TodoList, CreateTodo, EditTodo, Error views) where users interact with the application.
- Components: Divided into “atoms” (e.g., NBtn, NTextInput, NBadge) and “organisms” (e.g., NNav, NTodoItems) that follow the atomic design pattern.
- Composables: Utilities encapsulating business logic (e.g., useCreateTodo, useEditTodo, useTodoView) to handle stateful behavior and reusability.
- Router: Contains routing configurations and navigation management (src/router).
- Store: Central state management (todoStore) that holds and updates the TODO data.
- Utilities: Helper functions (e.g., stringsHelper) that support repeated operations.

- Assets & Styling:
- Static assets (CSS, images) collected under “assets” directories.
- Global styles applied to the entire application.

- Configuration & Build:
- Tooling and configuration files (Vite, ESLint, Prettier, TypeScript configs) that enable robust development and testing environments.

- Testing:
- Unit tests under components’ __tests__.
- End-to-end tests using Playwright and Vitest configuration files.

##### Relationships & Interactions
- Data Flow:
- User interactions in the Views and Components trigger events which, via composable functions, update the central store.
- The Router defines navigation between Views (e.g., editing a TODO or listing them).
- The Store communicates changes back to the UI components ensuring the reactive update of displayed data.

- Architectural Patterns & Design Principles:
- Atomic Design: Components are organized into “atoms” (small, reusable UI elements) and “organisms” (composite groupings forming larger UI sections).
- Separation of Concerns: Clear division of UI, state management, business logic (via composables), and routing.
- Component-driven Architecture: Emphasis on modularity that aids in testing (note the dedicated __tests__ directory).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        subgraph "Views"
            TL["TodoList View"]:::presentation
            CT["CreateTodo View"]:::presentation
            ET["EditTodo View"]:::presentation
            EV["Error View"]:::presentation
        end
        subgraph "Components"
            subgraph "Atoms"
                A1["NBtn"]:::atom
                A2["NTextInput"]:::atom
                A3["NBadge"]:::atom
                A4["NSelectbox"]:::atom
                A5["NTextarea"]:::atom
            end
            subgraph "Organisms"
                O1["NNav"]:::organism
                O2["NTodoItems"]:::organism
                O3["NTodoItem"]:::organism
                O4["NAddInputForm"]:::organism
                O5["NEditInputForm"]:::organism
            end
        end
    end

    %% Business Logic Layer
    subgraph "Business Logic"
        C1["useCreateTodo Composable"]:::logic
        C2["useEditTodo Composable"]:::logic
        C3["useTodoView Composable"]:::logic
        S["Central Store (todoStore)"]:::logic
    end

    %% Infrastructure & Tools
    subgraph "Infrastructure"
        R["Router"]:::infra
        U["Utility Functions (stringsHelper)"]:::infra
        GS["Global Styles"]:::infra
    end

    %% Testing
    subgraph "Testing"
        UT["Unit Tests"]:::test
        E2E["End-to-End Tests"]:::test
    end

    %% Relationships

    %% Router directs to Views
    R -->|"routes"| TL
    R -->|"routes"| CT
    R -->|"routes"| ET
    R -->|"routes"| EV

    %% Views trigger composables
    TL -->|"triggers"| C3
    CT -->|"triggers"| C1
    ET -->|"triggers"| C2

    %% Composables update the central store and get support from utility functions
    C1 -->|"updates"| S
    C2 -->|"updates"| S
    C3 -->|"updates"| S
    U -->|"supports"| C1
    U -->|"supports"| C2
    U -->|"supports"| C3

    %% Store feeds updated data back to views
    S -->|"feeds"| TL
    S -->|"feeds"| CT
    S -->|"feeds"| ET

    %% Global styles application
    GS -->|"styles"| TL

    %% Component integration: Atoms used in organisms
    A1 -->|"used_in"| O1
    A2 -->|"used_in"| O4
    A2 -->|"used_in"| O5
    A3 -->|"used_in"| O2
    A4 -->|"used_in"| O3
    A5 -->|"used_in"| O5

    %% Organisms appear in Views
    O1 -->|"present_in"| TL
    O2 -->|"present_in"| TL
    O3 -->|"present_in"| TL
    O4 -->|"present_in"| CT
    O5 -->|"present_in"| ET

    %% Click Events
    click TL "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/views/TodoList.vue"
    click CT "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/views/CreateTodo.vue"
    click ET "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/views/EditTodo.vue"
    click EV "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/views/Errors/NotFoundError.vue"
    click A1 "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/components/atoms/NBtn.vue"
    click A2 "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/components/atoms/NTextInput.vue"
    click A3 "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/components/atoms/NBadge.vue"
    click A4 "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/components/atoms/NSelectbox.vue"
    click A5 "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/components/atoms/NTextarea.vue"
    click O1 "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/components/orgnisms/NNav.vue"
    click O2 "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/components/orgnisms/NTodoItems.vue"
    click O3 "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/components/orgnisms/NTodoItem.vue"
    click O4 "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/components/orgnisms/NAddInputForm.vue"
    click O5 "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/components/orgnisms/NEditInputForm.vue"
    click C1 "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/composables/useCreateTodo.ts"
    click C2 "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/composables/useEditTodo.ts"
    click C3 "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/composables/useTodoView.ts"
    click R "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/router/index.ts"
    click S "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/store/todoStore.ts"
    click U "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/util/stringsHelper.ts"
    click GS "https://github.com/takuyaw-w/vue3-with-todo/blob/main/src/assets/main.css"
    click UT "https://github.com/takuyaw-w/vue3-with-todo/tree/main/src/components/__tests__"
    click E2E "https://github.com/takuyaw-w/vue3-with-todo/tree/main/e2e"

    %% Styles
    classDef presentation fill:#f9f,stroke:#333,stroke-width:2px;
    classDef logic fill:#ff9,stroke:#333,stroke-width:2px;
    classDef infra fill:#9cf,stroke:#333,stroke-width:2px;
    classDef test fill:#fc9,stroke:#333,stroke-width:2px;
    classDef atom fill:#dff,stroke:#000,stroke-width:2px;
    classDef organism fill:#dfd,stroke:#000,stroke-width:2px;
```
