# diez111/procard architecture

> Architecture diagram of the GitHub repository diez111/procard, 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/diez111/procard
- Repository: https://github.com/diez111/procard

## Overview

##### Main Components
a. Frontend Client:
- The src directory contains the primary user interface built using TypeScript/React (evidenced by multiple .tsx components like AddTaskDialog, ChecklistGroup, TaskCard, etc.).
- UI elements and hooks for state management are included (src/store and UI components in src/components/ui).
b. Cross-Platform/Packaging Layers:
- Electron: The electron directory and associated dist-electron (and dist_electron) folders indicate support for desktop packaging, with a main.js acting as the Electron main process.
- Capacitor: The capacitor.config.ts file suggests the project may also build for mobile or other platforms via Capacitor.
c. Build and Distribution:
- The dist and dist-electron directories are used for bundled assets for web and desktop respectively.
- Dockerfile and accompanying configuration files help in containerizing or deploying the project.
d. Scripts and Utilities:
- iconoapp directory (with convertir_icono.sh) for asset conversion tasks.
- Utility libraries (src/lib) and configuration files (e.g., tailwind.config.js, tsconfig.*) that facilitate development and build processes.
e. External Integrations and Services:
- Google Calendar API integration for synchronizing tasks.
- Weather widget component for fetching and displaying weather information.
- Import/Export functionality for tasks (likely interacting with JSON data formats).

##### Relationships and Interactions
- The Frontend Client (composed of the UI components and the main application logic in src) interacts with external services for calendar and weather updates.
- Within the UI, components like TaskDialog, TagSelector, etc., interact to provide a coherent task management experience with drag-and-drop between task columns.
- Electron and Capacitor layers wrap the web-based UI into native app experiences, with Electron handling desktop-specific behavior and Capacitor potentially managing mobile integrations.
- Build/distribution pipelines (using Vite, Docker, and build scripts) convert the source code into production-ready bundles, which are then deployed or packaged accordingly.

##### Architectural Patterns and Design Principles
- Component-Based Architecture: The application is split into several reusable UI components (as seen in the src/components directory) reflecting a modular design.
- State Management: The store (found under src/store) likely uses a centralized state management pattern to share data across components.
- Separation of Concerns: Clear delineation between UI components, business logic, utility functions, and configuration files.
- Cross-Platform Support: Utilization of Electron and Capacitor to serve different platforms (desktop and mobile) while sharing a common codebase.

##### Relevant Technologies, Frameworks, and Tools
- TypeScript and React (or a similar component-based framework), as observed through the .tsx files.
- Electron for desktop app packaging.
- Capacitor for bridging web code with native mobile functionality.
- Vite as the build tool (evident from vite.config.ts).
- Tailwind CSS for styling (via tailwind.config.js).
- Docker for containerization (Dockerfile provided).
- ESLint for code linting and adherence to coding standards.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Client
    subgraph "Frontend Client"
        FE_Main["Main Application (App.tsx, main.tsx, index.css)"]:::frontend
        FE_UI["UI Components (AddTaskDialog, ChecklistGroup, etc.)"]:::frontend
        FE_UI_Sub["UI Sub-components (button, checkbox, dialog, etc.)"]:::frontend
        FE_State["State Management (board-store, label-store)"]:::frontend
        FE_Util["Utility Libraries (utils.ts)"]:::frontend
    end

    %% Cross-Platform Wrappers
    subgraph "Cross-Platform Wrappers"
        CP_Electron["Electron Packaging (main.js)"]:::packaging
        CP_Capacitor["Capacitor (capacitor.config.ts)"]:::packaging
    end

    %% Build and Distribution
    subgraph "Build and Distribution"
        BD_Web["Web Build (index.html in dist)"]:::build
        BD_Desktop["Desktop Build (dist-electron & dist_electron)"]:::build
        BD_Tooling["Build Tooling (vite.config.ts, Dockerfile, tsconfig.*, tailwind.config.js)"]:::build
    end

    %% Scripts and Utilities
    subgraph "Scripts and Utilities"
        SU_Assets["Asset Conversion (convertir_icono.sh)"]:::util
    end

    %% External Integrations
    subgraph "External Integrations"
        EI_GCal["GoogleCalendarAPI"]:::external
        EI_Weather["Weather Service (Weather.tsx)"]:::external
    end

    %% Relationships and Data Flows
    FE_Main -->|"contains"| FE_UI
    FE_UI -->|"comprises"| FE_UI_Sub
    FE_UI -->|"updates"| FE_State
    FE_Util -->|"supports"| FE_Main
    FE_UI -->|"calls_GCal"| EI_GCal
    FE_UI -->|"fetches_weather"| EI_Weather
    FE_Main -->|"wrapped_by"| CP_Electron
    FE_Main -->|"wrapped_by"| CP_Capacitor
    BD_Tooling -->|"builds"| FE_Main
    FE_Main -->|"bundled_to"| BD_Web
    CP_Electron -->|"packaged_into"| BD_Desktop
    FE_Util -->|"uses"| SU_Assets

    %% Click Events
    click FE_Main "https://github.com/diez111/procard/tree/main/src"
    click FE_UI "https://github.com/diez111/procard/tree/main/src/components"
    click FE_UI_Sub "https://github.com/diez111/procard/tree/main/src/components/ui"
    click FE_State "https://github.com/diez111/procard/tree/main/src/store"
    click FE_Util "https://github.com/diez111/procard/tree/main/src/lib"
    click CP_Electron "https://github.com/diez111/procard/tree/main/electron"
    click CP_Capacitor "https://github.com/diez111/procard/blob/main/capacitor.config.ts"
    click BD_Web "https://github.com/diez111/procard/tree/main/dist"
    click BD_Desktop "https://github.com/diez111/procard/tree/main/dist-electron"
    click BD_Tooling "https://github.com/diez111/procard/blob/main/vite.config.ts"
    click SU_Assets "https://github.com/diez111/procard/tree/main/iconoapp"
    click EI_Weather "https://github.com/diez111/procard/blob/main/src/components/Weather.tsx"

    %% Styles
    classDef frontend fill:#e6f7ff,stroke:#1890ff,stroke-width:2px;
    classDef packaging fill:#fff2e8,stroke:#fa8c16,stroke-width:2px;
    classDef build fill:#f9f0ff,stroke:#722ed1,stroke-width:2px;
    classDef util fill:#fff7e6,stroke:#faad14,stroke-width:2px;
    classDef external fill:#f6ffed,stroke:#52c41a,stroke-width:2px;
```
