# gupcus/poc-tauri architecture

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

- Interactive diagram: https://gitdiagram.com/gupcus/poc-tauri
- Repository: https://github.com/gupcus/poc-tauri

## Overview

##### Project type and purpose
- This is a proof-of-concept desktop application built with the Tauri framework.
- It combines a React/Vite front-end (written in TypeScript/JSX) with a Rust-based backend (the Tauri “core” in `src-tauri`).
- Its domain logic revolves around a simple “note” model (see `src/nota/nota.entity.ts` and `nota.controller.ts`).

##### File structure
Top-level:
- package.json, pnpm-lock.yaml, vite.config.ts, tsconfig*.json → front-end build & dependency config (pnpm + Vite + TS).
- index.html → main HTML shell for the React app.
- src/ → React app code + domain logic:
– App.tsx, main.tsx → application entry points.
– components/ & layouts/ → UI composition (buttons, note cards, layouts).
– nota/ → domain layer: controller + entity (MVC-style separation within the front end).
– pages/ → application routes/views (Home, NewNote, Note).
– styles/ → CSS assets.
- src-tauri/ → Rust project for Tauri:
– Cargo.toml / Cargo.lock → Rust dependency config.
– src/main.rs + src/lib.rs → Rust code that initializes the Tauri runtime, defines commands exposed to the front end.
– build.rs & tauri.conf.json → build hooks + Tauri configuration (window settings, menus, permissions/capabilities).
– capabilities/default.json → permissions requested by the app (e.g., filesystem).

##### Extract README insights
- Purpose: demonstrate how to bootstrap and run a Tauri desktop application using pnpm and Rust.
- Prerequisites: Rust toolchain, C++ build tools, VSCode extensions (Tauri, rust-analyzer).
- Commands: `pnpm install` + `pnpm tauri dev` to build & launch.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Webview Layer
    subgraph "Webview Layer"
        direction TB
        EP_MAIN["src/main.tsx"]:::frontend
        EP_APP["src/App.tsx"]:::frontend
        EP_HTML["index.html"]:::frontend

        CFG_PKG["package.json"]:::frontend
        CFG_LOCK["pnpm-lock.yaml"]:::frontend
        CFG_VITE["vite.config.ts"]:::frontend
        CFG_TS["tsconfig.json"]:::frontend
        CFG_TSNODE["tsconfig.node.json"]:::frontend
        CFG_VITEENV["src/vite-env.d.ts"]:::frontend

        UI_BOTON["BotonAbajo.jsx"]:::frontend
        UI_MININOTE["MiniNote.jsx"]:::frontend
        UI_ROOT["RootLayout.jsx"]:::frontend

        PG_HOME["Home.jsx"]:::frontend
        PG_NEW["NewNote.jsx"]:::frontend
        PG_NOTE["Note.jsx"]:::frontend

        DOM_ENTITY["nota.entity.ts"]:::frontend
        DOM_CTRL["nota.controller.ts"]:::frontend

        ST_CSS["App.css"]:::frontend
        ST_ASSETS["src/assets/"]:::frontend
    end

    %% Native Layer
    subgraph "Native Layer"
        direction TB
        TA_MAIN["src-tauri/src/main.rs"]:::native
        TA_LIB["src-tauri/src/lib.rs"]:::native

        RC_CARGO["src-tauri/Cargo.toml"]:::native
        RC_CARGO_LOCK["src-tauri/Cargo.lock"]:::native
        RC_BUILD["src-tauri/build.rs"]:::native
        RC_CONF["src-tauri/tauri.conf.json"]:::native

        CAP_DEFAULT["capabilities/default.json"]:::native
        ICONS["src-tauri/icons/"]:::native
    end

    FS["Filesystem (OS)"]:::storage

    %% Build Pipeline
    CFG_PKG -->|uses pnpm/Vite| EP_MAIN
    EP_MAIN --> EP_APP
    EP_APP --> EP_HTML
    CFG_VITE --> EP_MAIN

    %% UI Composition
    EP_APP --> UI_BOTON
    EP_APP --> UI_MININOTE
    EP_APP --> UI_ROOT
    EP_APP --> PG_HOME
    EP_APP --> PG_NEW
    EP_APP --> PG_NOTE
    EP_APP --> ST_CSS
    EP_APP --> ST_ASSETS

    %% Domain Logic
    PG_HOME --> DOM_CTRL
    PG_NEW --> DOM_CTRL
    PG_NOTE --> DOM_CTRL
    UI_ROOT --> DOM_CTRL
    DOM_CTRL --> DOM_ENTITY

    %% IPC Boundary
    DOM_CTRL -->|invoke| TA_MAIN
    TA_MAIN --> TA_LIB
    TA_LIB --> FS
    FS -->|response| TA_LIB
    TA_LIB -->|IPC return| DOM_CTRL

    %% Native Config & Capabilities
    TA_MAIN --> RC_CARGO
    TA_MAIN --> RC_CARGO_LOCK
    TA_MAIN --> RC_BUILD
    TA_MAIN --> RC_CONF
    TA_MAIN --> CAP_DEFAULT
    TA_MAIN --> ICONS

    %% Click Events
    click EP_MAIN "https://github.com/gupcus/poc-tauri/blob/main/src/main.tsx"
    click EP_APP "https://github.com/gupcus/poc-tauri/blob/main/src/App.tsx"
    click EP_HTML "https://github.com/gupcus/poc-tauri/blob/main/index.html"
    click CFG_PKG "https://github.com/gupcus/poc-tauri/blob/main/package.json"
    click CFG_LOCK "https://github.com/gupcus/poc-tauri/blob/main/pnpm-lock.yaml"
    click CFG_VITE "https://github.com/gupcus/poc-tauri/blob/main/vite.config.ts"
    click CFG_TS "https://github.com/gupcus/poc-tauri/blob/main/tsconfig.json"
    click CFG_TSNODE "https://github.com/gupcus/poc-tauri/blob/main/tsconfig.node.json"
    click CFG_VITEENV "https://github.com/gupcus/poc-tauri/blob/main/src/vite-env.d.ts"
    click UI_BOTON "https://github.com/gupcus/poc-tauri/blob/main/src/components/BotonAbajo.jsx"
    click UI_MININOTE "https://github.com/gupcus/poc-tauri/blob/main/src/components/MiniNote.jsx"
    click UI_ROOT "https://github.com/gupcus/poc-tauri/blob/main/src/layouts/RootLayout.jsx"
    click PG_HOME "https://github.com/gupcus/poc-tauri/blob/main/src/pages/Home.jsx"
    click PG_NEW "https://github.com/gupcus/poc-tauri/blob/main/src/pages/NewNote.jsx"
    click PG_NOTE "https://github.com/gupcus/poc-tauri/blob/main/src/pages/Note.jsx"
    click DOM_ENTITY "https://github.com/gupcus/poc-tauri/blob/main/src/nota/nota.entity.ts"
    click DOM_CTRL "https://github.com/gupcus/poc-tauri/blob/main/src/nota/nota.controller.ts"
    click ST_CSS "https://github.com/gupcus/poc-tauri/blob/main/src/styles/App.css"
    click ST_ASSETS "https://github.com/gupcus/poc-tauri/tree/main/src/assets/"
    click TA_MAIN "https://github.com/gupcus/poc-tauri/blob/main/src-tauri/src/main.rs"
    click TA_LIB "https://github.com/gupcus/poc-tauri/blob/main/src-tauri/src/lib.rs"
    click RC_CARGO "https://github.com/gupcus/poc-tauri/blob/main/src-tauri/Cargo.toml"
    click RC_CARGO_LOCK "https://github.com/gupcus/poc-tauri/blob/main/src-tauri/Cargo.lock"
    click RC_BUILD "https://github.com/gupcus/poc-tauri/blob/main/src-tauri/build.rs"
    click RC_CONF "https://github.com/gupcus/poc-tauri/blob/main/src-tauri/tauri.conf.json"
    click CAP_DEFAULT "https://github.com/gupcus/poc-tauri/blob/main/src-tauri/capabilities/default.json"
    click ICONS "https://github.com/gupcus/poc-tauri/tree/main/src-tauri/icons/"

    %% Styles
    classDef frontend fill:#BBDEFB,stroke:#0D47A1,color:#0D47A1
    classDef native fill:#CFD8DC,stroke:#455A64,color:#455A64
    classDef storage fill:#C8E6C9,stroke:#1B5E20,color:#1B5E20
```
