# matteo-peronnet/plancktimetracker architecture

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

- Interactive diagram: https://gitdiagram.com/matteo-peronnet/plancktimetracker
- Repository: https://github.com/matteo-peronnet/plancktimetracker

## Overview

##### Main Application Architecture

a) Electron Components:
- Main Window (mainWindow.js)
- System Tray (planckTray.js)
- Auto Updater (updater.js)

b) Frontend Application:
- Components Layer
- Views/Layouts Layer
- Store (Redux) Layer
- Services Layer

c) External Services:
- Connections to any backend services the app communicates with

##### Detailed Component Breakdown

Frontend Architecture (React):

a) Views Layer:
- Home
- Login
- Project
- Task
- Timer (with sub-components for Steps)

b) State Management:
- Ducks (Redux modules):
- app
- intl
- planck
- timer
- user
- Middleware
- Services:
- authentication
- customer
- task
- timeSpent
- timeSpentType

c) Supporting Systems:
- i18n (Internationalization)
- Routes
- Components

##### Data Flow

- IPC (Inter-Process Communication) between Electron and React
- Redux action/state flow
- Service API calls
- Event handling paths

##### Specific Elements

- System tray integration
- Time tracking core functionality
- Authentication flow
- Internationalization system
- Route protection (isPrivate.js)
- User session handling

##### Technical Details to Note

Annotations for:
- Webpack configuration
- Build process
- Update mechanism
- Environment configurations

**[Electron Shell]**

- [Main Process]
- Main Window
- System Tray
- Auto Updater

- [Renderer Process]

- [React Application]
- Components
- Views/Layouts
- Providers

- [Redux Store]
- Ducks
- Middleware
- Services

- [Supporting Systems]
- i18n
- Routes
- Utils

Important Considerations:

##### Update mechanism flow

Remember to indicate the build and deployment pipeline, as the presence of webpack configs and CI/CD files suggests this is an important aspect of the system.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Electron Shell"
        MainProcess["Main Process"]
        MainWindow["Main Window"]:::electron
        SystemTray["System Tray"]:::electron
        AutoUpdater["Auto Updater"]:::electron
        
        MainProcess --> MainWindow
        MainProcess --> SystemTray
        MainProcess --> AutoUpdater
    end

    subgraph "React Application"
        Views["Views Layer"]
        Components["Components Layer"]
        Store["Redux Store"]
        Services["Services Layer"]
        Support["Supporting Systems"]

        subgraph "Views"
            Home["Home View"]:::view
            Login["Login View"]:::view
            Project["Project View"]:::view
            Task["Task View"]:::view
            Timer["Timer View"]:::view
            TimerSteps["Timer Steps"]:::view
            TimerInfo["Timer Information"]:::view
        end

        subgraph "Redux"
            ReduxStore["Store Configuration"]:::redux
            Ducks["Redux Ducks"]:::redux
            Middleware["Redux Middleware"]:::redux
            
            ReduxStore --> Ducks
            ReduxStore --> Middleware
        end

        subgraph "Services"
            Auth["Authentication"]:::service
            Customer["Customer"]:::service
            TaskService["Task"]:::service
            TimeTracking["Time Tracking"]:::service
        end

        subgraph "Supporting"
            I18n["Internationalization"]:::support
            Routes["Route Configuration"]:::support
            RouteProtection["Route Protection"]:::support
            SessionHandler["User Session"]:::support
        end
    end

    MainWindow --> Views
    Store --> Services
    Views --> Store
    Components --> Views
    Support --> Views

%% Click Events
click MainWindow "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/app/mainWindow.js"
click SystemTray "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/app/planckTray.js"
click AutoUpdater "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/app/updater.js"
click Home "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/views/layouts/Home/index.js"
click Login "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/views/layouts/Login/index.js"
click Project "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/views/layouts/Project/index.js"
click Task "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/views/layouts/Task/index.js"
click Timer "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/views/layouts/Timer/index.js"
click TimerSteps "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/views/layouts/Timer/Steps/Tracker.js"
click TimerInfo "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/views/layouts/Timer/Steps/TimerInformation.js"
click ReduxStore "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/store/index.js"
click Ducks "https://github.com/Matteo-Peronnet/PlanckTimeTracker/tree/master/src/store/ducks"
click Middleware "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/store/middleware/reduxCasesMiddleware.js"
click Auth "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/store/services/authentication.js"
click Customer "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/store/services/customer.js"
click TaskService "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/store/services/task.js"
click TimeTracking "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/store/services/timeSpent.js"
click I18n "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/i18n/index.js"
click RouteProtection "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/routes/isPrivate.js"
click Routes "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/routes/routes.js"
click SessionHandler "https://github.com/Matteo-Peronnet/PlanckTimeTracker/blob/master/src/routes/withUser.js"

%% Styling
classDef electron fill:#3498db,stroke:#2980b9,color:white
classDef view fill:#2ecc71,stroke:#27ae60,color:white
classDef redux fill:#9b59b6,stroke:#8e44ad,color:white
classDef service fill:#e67e22,stroke:#d35400,color:white
classDef support fill:#95a5a6,stroke:#7f8c8d,color:white

%% Legend
subgraph Legend
    E["Electron Component"]:::electron
    V["View Component"]:::view
    R["Redux Component"]:::redux
    S["Service Component"]:::service
    SP["Support Component"]:::support
end
```
