# ciromirkin/boar architecture

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

- Interactive diagram: https://gitdiagram.com/ciromirkin/boar
- Repository: https://github.com/ciromirkin/boar

## Overview

##### Project type and purpose
- Boar is a single-page web application built with React and TypeScript.
- Purpose: organize tasks with boards, columns, and an archive, all in the browser.

##### File structure
Top-level groupings:
- public/ & index.html – static assets, Netlify config (hosting)
- src/ – main application code
– ui/ – low-level UI primitives (buttons, inputs, dialogs, etc.)
– sharedByModules/ – cross-cutting concerns (Header, Theme, hooks, utils)
– modules/ – domain features broken out by area (board, columnList, taskList, archive, reminder)
– lib/ – generic utilities
– i18next/ – internationalization setup
– Router.tsx, App.tsx – top-level container and routing
– store.ts – centralized state management wiring reducers
- docs/ – documentation
- cypress.config.ts – end-to-end tests
- configuration files – ESLint, Prettier, Vite, Tailwind, TS

##### Additional insights from README
- SPA to create, move, delete, archive tasks across user-definable columns.
- Uses unit tests (in-repo .test.ts files) and Cypress for quality.
- Deploys to Netlify (public/netlify.toml).

##### Main components
a. User’s Browser (Client)
b. React Application – subdivided into:
- Presentation Layer
– Router & Pages (App, 404, Help, Configs)
– UI primitives (ui/)
– Feature components (modules/.../components)
- State Management Layer
– store.ts (combines reducers)
– Reducers & Actions per domain: boardReducer, columnListReducer, taskListReducers, archiveReducer, reminder context
– Persistence adapters (localStorageBoard, localStorageColumnList, localStorageTaskLists, localStorageArchive)
- Domain Layer (modules/…/models & repositories)
– Domain models (Board, Column, Task, Archive)
– Repositories for data access abstraction over localStorage
- Cross-cutting services
– i18next internationalization
– ThemeContext & Language toggle
– ErrorBoundary
– Utilities (getErrorMessage, getTime, etc.)
c. Browser LocalStorage (persistent client storage)
d. Build & Deployment pipeline
- Vite (vite.config.ts) → bundled static assets
- Netlify hosting (public/netlify.toml, _redirects)

##### Relationships & interactions
- User events → React components → dispatch Actions → Reducers update State → Persist to localStorage → Components re-render
- Router drives which page/component tree mounts
- Shared services (i18n, ThemeContext) wrap App and inject configuration into components
- Build pipeline: source files → Vite → static assets → Netlify → CDN → User’s browser

##### Architectural patterns & principles
- Component-based UI (React + functional components + hooks)
- Unidirectional data flow (Flux-style actions → reducers → state → view)
- Separation of concerns: UI primitives vs feature components vs state vs persistence
- Domain modeling: each module has its own models, actions, reducers, persistence adapter
- Context API for cross-cutting features (theme, reminders, language)

##### Relevant technologies & frameworks
- React, React Router, React Context, Hooks
- TypeScript
- Vite for build
- Tailwind CSS for styling
- i18next for localization
- Cypress for E2E testing, Jest for unit tests
- Netlify for hosting

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External
    User["User"]:::external
    Browser["Browser"]:::external

    %% Source & Deployment
    Code["Source Code"]:::external
    Vite["Vite Bundler"]:::build
    Netlify["Netlify Hosting"]:::build
    Cypress["Cypress Tests"]:::build

    %% Presentation Layer
    subgraph "Presentation Layer"
        App["React Application Container"]:::presentation
        Router["Router"]:::presentation
        Page404["404 Page"]:::presentation
        HelpPage["Help Page"]:::presentation
        ConfigsPage["Configs Page"]:::presentation
        UI["UI Primitives"]:::presentation
        BoardComp["Board Component"]:::presentation
        ColumnComp["ColumnList Component"]:::presentation
        TaskComp["TaskList Component"]:::presentation
        ArchiveComp["Archive Component"]:::presentation
        ReminderComp["Reminder Component"]:::presentation
    end

    %% State Management Layer
    subgraph "State Management Layer"
        Store["Centralized Store"]:::state
        BoardReducer["BoardReducer"]:::state
        BoardActions["Board Actions"]:::state
        ColumnReducer["ColumnListReducer"]:::state
        ColumnActions["ColumnList Actions"]:::state
        TaskReducer["TaskListReducer"]:::state
        TaskActions["TaskList Actions"]:::state
        ArchiveReducer["ArchiveReducer"]:::state
        ArchiveActions["Archive Actions"]:::state
        PersistenceAdapters["Persistence Adapters"]:::state
    end

    %% Domain Layer
    subgraph "Domain Layer"
        BoardModel["Board Model"]:::domain
        BoardRepo["Board Repository"]:::domain
        ColumnListModel["ColumnList Model"]:::domain
        ColumnModel["Column Model"]:::domain
        ColumnRepo["ColumnList Repository"]:::domain
        TaskListModel["TaskList Model"]:::domain
        TaskModel["Task Model"]:::domain
        TaskRepo["TaskList Repository"]:::domain
        ArchiveModel["Archive Model"]:::domain
        ArchiveRepo["Archive Repository"]:::domain
        ReminderModel["Reminder Model"]:::domain
    end

    %% Cross-cutting Services
    subgraph "Cross-cutting Services"
        I18n["i18next Service"]:::cross
        Theme["ThemeContext"]:::cross
        Header["Header Component"]:::cross
        Utils["Utilities"]:::cross
        ErrorBoundary["Error Boundary"]:::cross
    end

    %% Persistence
    LocalStorage["Browser LocalStorage"]:::persistence

    %% Relationships
    User --> Browser
    Browser --> App
    Code --> Vite --> Netlify --> Browser
    Browser -->|loads assets| Netlify

    App --> Router
    Router --> Page404
    Router --> HelpPage
    Router --> ConfigsPage
    App --> UI
    App --> Store
    App --> I18n
    App --> Theme
    App --> ErrorBoundary

    Router --> BoardComp
    Router --> ColumnComp
    Router --> TaskComp
    Router --> ArchiveComp
    Router --> ReminderComp

    BoardComp --> Store
    ColumnComp --> Store
    TaskComp --> Store
    ArchiveComp --> Store
    ReminderComp --> Store

    Store --> BoardReducer
    Store --> ColumnReducer
    Store --> TaskReducer
    Store --> ArchiveReducer

    BoardReducer --> BoardActions
    ColumnReducer --> ColumnActions
    TaskReducer --> TaskActions
    ArchiveReducer --> ArchiveActions

    BoardActions --> PersistenceAdapters
    ColumnActions --> PersistenceAdapters
    TaskActions --> PersistenceAdapters
    ArchiveActions --> PersistenceAdapters

    PersistenceAdapters --> LocalStorage

    LocalStorage --> BoardRepo
    LocalStorage --> ColumnRepo
    LocalStorage --> TaskRepo
    LocalStorage --> ArchiveRepo

    BoardRepo --> BoardModel
    ColumnRepo --> ColumnListModel
    ColumnRepo --> ColumnModel
    TaskRepo --> TaskListModel
    TaskRepo --> TaskModel
    ArchiveRepo --> ArchiveModel
    ReminderModel

    %% Testing
    Cypress --> Code

    %% Click Events
    click App "https://github.com/ciromirkin/boar/blob/main/src/App.tsx"
    click Router "https://github.com/ciromirkin/boar/blob/main/src/Router.tsx"
    click Page404 "https://github.com/ciromirkin/boar/blob/main/src/components/404.tsx"
    click HelpPage "https://github.com/ciromirkin/boar/blob/main/src/components/Help.tsx"
    click ConfigsPage "https://github.com/ciromirkin/boar/blob/main/src/components/Configs.tsx"
    click UI "https://github.com/ciromirkin/boar/tree/main/src/ui/"
    click Store "https://github.com/ciromirkin/boar/blob/main/src/store.ts"
    click BoardComp "https://github.com/ciromirkin/boar/blob/main/src/modules/board/Board.tsx"
    click BoardReducer "https://github.com/ciromirkin/boar/blob/main/src/modules/board/state/boardReducer.ts"
    click BoardActions "https://github.com/ciromirkin/boar/blob/main/src/modules/board/state/actions.ts"
    click PersistenceAdapters "https://github.com/ciromirkin/boar/blob/main/src/modules/board/state/localstorageBoard.ts"
    click BoardModel "https://github.com/ciromirkin/boar/blob/main/src/modules/board/models/board.ts"
    click BoardRepo "https://github.com/ciromirkin/boar/blob/main/src/modules/board/models/boardRepository.ts"
    click ColumnComp "https://github.com/ciromirkin/boar/blob/main/src/modules/columnList/ColumnList.tsx"
    click ColumnReducer "https://github.com/ciromirkin/boar/blob/main/src/modules/columnList/state/columnListReducer.ts"
    click ColumnActions "https://github.com/ciromirkin/boar/blob/main/src/modules/columnList/state/actions.ts"
    click PersistenceAdapters "https://github.com/ciromirkin/boar/blob/main/src/modules/columnList/state/localStorageColumnList.ts"
    click ColumnListModel "https://github.com/ciromirkin/boar/blob/main/src/modules/columnList/models/columnList.ts"
    click ColumnModel "https://github.com/ciromirkin/boar/blob/main/src/modules/columnList/models/column.ts"
    click ColumnRepo "https://github.com/ciromirkin/boar/blob/main/src/modules/columnList/state/columnListRepository.ts"
    click TaskComp "https://github.com/ciromirkin/boar/blob/main/src/modules/taskList/TaskListInEachColumn.tsx"
    click ArchiveComp "https://github.com/ciromirkin/boar/blob/main/src/modules/taskList/archive/Archive.tsx"
    click ArchiveReducer "https://github.com/ciromirkin/boar/blob/main/src/modules/taskList/archive/state/archiveReducer.ts"
    click ArchiveActions "https://github.com/ciromirkin/boar/tree/main/src/modules/taskList/archive/state/actions"
    click PersistenceAdapters "https://github.com/ciromirkin/boar/blob/main/src/modules/taskList/archive/state/localStorageArchive.ts"
    click I18n "https://github.com/ciromirkin/boar/blob/main/src/i18next/index.ts"
    click Theme "https://github.com/ciromirkin/boar/blob/main/src/sharedByModules/Theme/ThemeContext.tsx"
    click Header "https://github.com/ciromirkin/boar/blob/main/src/sharedByModules/Header/Header.tsx"
    click Utils "https://github.com/ciromirkin/boar/blob/main/src/lib/utils.ts"
    click ErrorBoundary "https://github.com/ciromirkin/boar/blob/main/src/ErrorBoundary.tsx"
    click Vite "https://github.com/ciromirkin/boar/blob/main/vite.config.ts"
    click Netlify "https://github.com/ciromirkin/boar/blob/main/public/netlify.toml"
    click Cypress "https://github.com/ciromirkin/boar/blob/main/cypress.config.ts"

    %% Styles
    classDef presentation fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef state fill:#d4edda,stroke:#333,stroke-width:1px
    classDef domain fill:#fff3cd,stroke:#333,stroke-width:1px
    classDef cross fill:#e2e3e5,stroke:#333,stroke-width:1px
    classDef persistence fill:#f8d7da,stroke:#333,stroke-width:1px
    classDef build fill:#d1ecf1,stroke:#333,stroke-width:1px
    classDef external fill:#fdfd96,stroke:#333,stroke-width:1px
```
