# shouryan01/google-tasks-desktop architecture

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

- Interactive diagram: https://gitdiagram.com/shouryan01/google-tasks-desktop
- Repository: https://github.com/shouryan01/google-tasks-desktop

## Overview

##### Project type and purpose
- This is a cross-platform desktop application built with Tauri.
- It wraps Google Tasks in a native shell, using a lightweight web UI plus a Rust back-end layer.
- Purpose: provide an optimized, lower-resource desktop client for Google Tasks.

##### File structure
- Root
- package.json, bun.lockb → JavaScript/Node build dependencies for the front-end.
- src/index.html → single-page web UI entry point.
- src-tauri/ (Tauri back-end)
- Cargo.toml, Cargo.lock → Rust project metadata.
- src/main.rs → application bootstrap: spawns a webview, registers commands.
- src/lib.rs → shared logic, command handlers.
- build.rs → codegen for Tauri capabilities.
- tauri.conf.json → Tauri configuration: window settings, allowed APIs.
- capabilities/, gen/schemas/ → JSON schemas defining OS integration (menus, notifications, permissions).

##### README for additional insights
- No custom microservices or external back-end.
- Relies on the Google Tasks REST API (via OAuth tokens managed in the front-end or by Tauri).
- Emphasis on performance metrics vs. running in a browser.

##### Main components
a. Front-end Web UI
- Your HTML/CSS/JS loaded in a Tauri WebView (Chromium or WebKit engine).
- Handles user interactions, renders tasks.
b. Tauri Runtime (Rust Back-end)
- Hosts the WebView; exposes native APIs to the front-end via IPC commands.
- Manages OAuth credential storage (secure filesystem or OS keychain).
- Implements command handlers to call out to the Google Tasks REST API.
c. Google Tasks External Service
- REST endpoints for listing, adding, updating tasks.
d. build.rs + Codegen
- At build time, generates Rust bindings for Tauri capabilities and JSON schemas.
e. Packaging/Deployment
- tauri.conf.json drives bundling into macOS (.app/.icns), Windows, Linux executables.

##### Relationships and data flows
- API response → Tauri Runtime → IPC → Web UI (two-way flow).
- build.rs/codegen → Rust code (build-time only).
- tauri.conf.json → Packaging toolchain (build settings).

##### Architectural patterns and principles
- IPC boundary between untrusted UI (web tech) and trusted back-end (Rust).
- Single-page application (SPA) front-end.
- Command pattern for front-end → back-end calls.
- Codegen for capability manifests.

##### Technologies, frameworks, libraries
- Tauri (Rust + WebView)
- Rust toolchain (Cargo, build.rs)
- Node/Bun for front-end bundling (package.json)
- Google Tasks REST API (OAuth2 authentication)
- JSON schema definitions for capabilities.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Front-end Layer
    subgraph "Front-end Web UI"
        direction TB
        UI["WebView UI<br/>(SPA)"]:::frontend
        pkg["package.json"]:::frontend
        lock["bun.lockb"]:::frontend
    end

    %% Tauri Runtime Layer
    subgraph "Tauri Runtime (Rust Back-end)"
        direction TB
        MAIN["main.rs<br/>(App Bootstrap)"]:::backend
        LIB["lib.rs<br/>(Command Handlers)"]:::backend
        CRED["Credentials Storage<br/>(Secure FS/Keychain)"]:::backend
        BUILD["build.rs<br/>(Codegen Script)"]:::config
        GEN["gen/schemas/"]:::config
        CAP_MANIFEST["capabilities/migrated.json"]:::config
        CONF["tauri.conf.json<br/>(Config/Packaging)"]:::config
        ICONS["icons/googletaskslogo.icns"]:::config
        CARGO_TOML["Cargo.toml"]:::config
        CARGO_LOCK["Cargo.lock"]:::config
    end

    %% External Service Layer
    subgraph "External Service"
        direction TB
        GOOGLE["Google Tasks REST API"]:::external
    end

    %% Packaging
    PACK["Packaging<br/>(macOS/.app, Win, Linux)"]:::config

    %% Connections
    UI -->|"invoke Command"| MAIN
    MAIN -->|"registers handlers"| LIB
    LIB -->|"reads/writes tokens"| CRED
    LIB -->|"HTTPS Request"| GOOGLE
    GOOGLE -->|"API Response"| LIB
    LIB -->|"IPC Response"| UI

    BUILD -.->|"generates schemas"| GEN
    CONF -->|"drives"| PACK

    %% Click Events
    click UI "https://github.com/shouryan01/google-tasks-desktop/blob/main/src/index.html"
    click pkg "https://github.com/shouryan01/google-tasks-desktop/blob/main/package.json"
    click lock "https://github.com/shouryan01/google-tasks-desktop/blob/main/bun.lockb"
    click MAIN "https://github.com/shouryan01/google-tasks-desktop/blob/main/src-tauri/src/main.rs"
    click LIB "https://github.com/shouryan01/google-tasks-desktop/blob/main/src-tauri/src/lib.rs"
    click BUILD "https://github.com/shouryan01/google-tasks-desktop/blob/main/src-tauri/build.rs"
    click GEN "https://github.com/shouryan01/google-tasks-desktop/tree/main/src-tauri/gen/schemas/"
    click CAP_MANIFEST "https://github.com/shouryan01/google-tasks-desktop/blob/main/src-tauri/capabilities/migrated.json"
    click CONF "https://github.com/shouryan01/google-tasks-desktop/blob/main/src-tauri/tauri.conf.json"
    click ICONS "https://github.com/shouryan01/google-tasks-desktop/blob/main/src-tauri/icons/googletaskslogo.icns"
    click CARGO_TOML "https://github.com/shouryan01/google-tasks-desktop/blob/main/src-tauri/Cargo.toml"
    click CARGO_LOCK "https://github.com/shouryan01/google-tasks-desktop/blob/main/src-tauri/Cargo.lock"

    %% Styles
    classDef frontend fill:#D0E7FF,stroke:#007BFF,color:#000;
    classDef backend fill:#D6F5D6,stroke:#28A745,color:#000;
    classDef external fill:#FFE5CC,stroke:#FF8C00,color:#000;
    classDef config fill:#E2E2E2,stroke:#A0A0A0,color:#000;
```
