# nfelger/dewt architecture

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

- Interactive diagram: https://gitdiagram.com/nfelger/dewt
- Repository: https://github.com/nfelger/dewt

## Overview

##### Main Application Components

a) Presentation Layer
- AgendaView
- CalendarScaffolding
- DraftTimebox
- Timebox
- Notifications
- Workhours
- Them with the main application container

b) Data Management Layer
- TimeboxData
- WorkhoursData
- Database Interface

##### Technical Architecture

a) Build & Development Tools
- Webpack (bundling)
- Babel (transpilation)
- Jest (testing)
- Cypress (E2E testing)

b) Application Flow
- Entry point (index.js)
- Components
- Helpers & Utilities
- Form Validations

##### Testing Infrastructure

A testing section showing:
- Jest unit tests
- Cypress integration tests

##### Component Relationships

Following interactions:
- index.js → main application container
- Components → Data Management Layer
- Helpers & Validations → Components
- Database → Data Management Layer

##### Frontend Focus
- Client-side architecture
- Clear separation between UI and data management
- Build pipeline

##### Testing Coverage
- Both unit and E2E testing coverage
- What components are tested

##### Data Flow
- How data moves between components
- Form validation flow
- Demonstrate database interactions

##### Build Process
- Webpack configuration flow
- Babel transformation process
- Output structure (dist folder)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Legend"
        UI[UI Component]:::ui
        DM[(Data Management)]:::data
        UT{{"Utility/Helper"}}:::utility
        TST[[Test]]:::test
        BLD[[Build Tool]]:::build
        style Legend fill:#f5f5f5,stroke:#333
    end

    subgraph "Presentation Layer"
        AV[AgendaView]:::ui
        CS[CalendarScaffolding]:::ui
        DT[DraftTimebox]:::ui
        TB[Timebox]:::ui
        NT[Notifications]:::ui
        WH[Workhours]:::ui
    end

    subgraph "Data Management Layer"
        TBD[(TimeboxData)]:::data
        WHD[(WorkhoursData)]:::data
        DBI[(Database Interface)]:::data
    end

    subgraph "Application Core"
        EP[Entry Point]:::core
        MAC[Main Application Container]:::core
        FV{{"Form Validations"}}:::utility
        HU{{"Helpers & Utilities"}}:::utility
    end

    subgraph "Testing Infrastructure"
        JUT[[Jest Unit Tests]]:::test
        CYP[[Cypress E2E Tests]]:::test
    end

    subgraph "Build Tools"
        WP[[Webpack]]:::build
        BB[[Babel]]:::build
        JST[[Jest]]:::build
        CY[[Cypress]]:::build
    end

    EP --> MAC
    MAC --> AV & CS & DT & TB & NT & WH
    
    AV & CS & DT & TB & NT & WH --> TBD & WHD
    TBD & WHD --> DBI
    
    FV --> DT & TB
    HU --> AV & CS & DT & TB & NT & WH
    
    JUT -.-> FV & HU
    CYP -.-> AV & CS & DT & TB & NT & WH
    
    WP --> EP
    BB --> EP
    
    %% Click events for component mapping
    click AV "https://github.com/nfelger/dewt/blob/master/src/components/agenda_view.js"
    click CS "https://github.com/nfelger/dewt/blob/master/src/components/calendar_scaffolding.js"
    click DT "https://github.com/nfelger/dewt/blob/master/src/components/draft_timebox.js"
    click TB "https://github.com/nfelger/dewt/blob/master/src/components/timebox.js"
    click NT "https://github.com/nfelger/dewt/blob/master/src/components/notifications.js"
    click WH "https://github.com/nfelger/dewt/blob/master/src/components/workhours.js"
    click TBD "https://github.com/nfelger/dewt/blob/master/src/timebox_data.js"
    click WHD "https://github.com/nfelger/dewt/blob/master/src/workhours_data.js"
    click DBI "https://github.com/nfelger/dewt/blob/master/src/database.js"
    click EP "https://github.com/nfelger/dewt/blob/master/src/index.js"
    click MAC "https://github.com/nfelger/dewt/blob/master/src/components/dewt.js"
    click FV "https://github.com/nfelger/dewt/blob/master/src/form_validations.js"
    click HU "https://github.com/nfelger/dewt/blob/master/src/helpers.js"
    click JUT "https://github.com/nfelger/dewt/blob/master/tests/form_validations.test.js"
    click CYP "https://github.com/nfelger/dewt/blob/master/cypress/integration/day_spec.js"
    click WP "https://github.com/nfelger/dewt/blob/master/webpack.config.js"
    click BB "https://github.com/nfelger/dewt/blob/master/.babelrc"
    click JST "https://github.com/nfelger/dewt/blob/master/jest.config.js"
    click CY "https://github.com/nfelger/dewt/blob/master/cypress.json"

    classDef ui fill:#3498db,stroke:#2980b9,color:#fff
    classDef data fill:#2ecc71,stroke:#27ae60,color:#fff
    classDef utility fill:#f1c40f,stroke:#f39c12,color:#fff
    classDef test fill:#e74c3c,stroke:#c0392b,color:#fff
    classDef build fill:#95a5a6,stroke:#7f8c8d,color:#fff
    classDef core fill:#9b59b6,stroke:#8e44ad,color:#fff
```
