# rohanjsh/typeset architecture

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

- Interactive diagram: https://gitdiagram.com/rohanjsh/typeset
- Repository: https://github.com/rohanjsh/typeset

## Overview

##### Main Components Identification

a) View Layer
- Located in lib/src/view/
- Contains the main TypeSet widget and UI components
- Handles user interactions and rendering

b) Core Layer
- Located in lib/src/core/
- Contains the parsing and control logic
- Manages text processing and formatting

c) Models Layer
- Located in lib/src/models/
- Defines data structures and enums for styling

**┌─────────────────────────────────────────┐**
- Client App                 │
- ┘
- ↓
**┌─────────────────────────────────────────┐**
- TypeSet Widget               │
- (Entry point - lib/src/view/typeset.dart) │
- ┘
- ↓
**┌─────────────────────────────────────────┐**
- TypeSet Controller              │
- (lib/src/core/typeset_controller.dart) │
- ┘
- ↙                    ↘
**┌──────────────┐    ┌─────────────────┐**
- TypeSet Parser│    │TypeSet Reserved │
- ┘    └─────────────────┘
- ↓                    ↓
**┌─────────────────────────────────────────┐**
- Models Layer                 │
- StyleTypeEnum                        │
- StyleTypeValueModel                  │
- ┘

##### Important Details

a) Input Processing Flow:
- How raw text input flows from the TypeSet widget
- Where parsing occurs
- Where style application happens

b) Formatting Features:
- Supported formats (bold, italic, etc.)
- Where each format is processed

c) Integration Points:
- How it interfaces with Flutter's text rendering
- Backend-driven formatting capability

##### Technical Specifications

- Supported format markers (* for bold, _ for italic, etc.)
- Font size syntax (<size>)
- Link syntax (§text|url§)

##### The test coverage mirroring

Remember to maintain a balance between detail and clarity, focusing on the core text processing pipeline while still showing the supporting infrastructure.

- How text formatting requests flow through the system
- Where to add new formatting features
- How the testing structure supports the codebase
- Integration points for client applications

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client["Client Application"]
        App[Flutter Application]
    end

    subgraph View["View Layer"]
        TypeSet["TypeSet Widget"]:::view
        ContextMenu["Context Menu Handler"]:::view
        EditController["Editing Controller"]:::view
    end

    subgraph Core["Core Processing Layer"]
        TSController["TypeSet Controller"]:::core
        TSParser["TypeSet Parser"]:::core
        TSReserved["TypeSet Reserved"]:::core
    end

    subgraph Models["Models Layer"]
        StyleEnum["Style Type Enum"]:::model
        StyleValue["Style Type Value Model"]:::model
    end

    %% Relationships
    App --> TypeSet
    TypeSet --> TSController
    TypeSet --> ContextMenu
    TypeSet --> EditController
    TSController --> TSParser
    TSController --> TSReserved
    TSParser --> StyleEnum
    TSParser --> StyleValue
    TSReserved --> StyleEnum
    
    %% Legend
    subgraph Legend
        L1[View Components]:::view
        L2[Core Components]:::core
        L3[Model Components]:::model
    end

    %% Styling
    classDef view fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef model fill:#f1c40f,stroke:#f39c12,color:black

    %% Click Events
    click TypeSet "https://github.com/rohanjsh/typeset/blob/dev/lib/src/view/typeset.dart"
    click TSController "https://github.com/rohanjsh/typeset/blob/dev/lib/src/core/typeset_controller.dart"
    click TSParser "https://github.com/rohanjsh/typeset/blob/dev/lib/src/core/typeset_parser.dart"
    click TSReserved "https://github.com/rohanjsh/typeset/blob/dev/lib/src/core/typeset_reserved.dart"
    click StyleEnum "https://github.com/rohanjsh/typeset/blob/dev/lib/src/models/style_type_enum.dart"
    click StyleValue "https://github.com/rohanjsh/typeset/blob/dev/lib/src/models/style_type_value_model.dart"
    click ContextMenu "https://github.com/rohanjsh/typeset/blob/dev/lib/src/view/typeset_context_menus.dart"
    click EditController "https://github.com/rohanjsh/typeset/blob/dev/lib/src/view/typeset_editing_controller.dart"
```
