# teriflix/scrite architecture

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

- Interactive diagram: https://gitdiagram.com/teriflix/scrite
- Repository: https://github.com/teriflix/scrite

## Overview

##### Project type and purpose
- Scrite is a cross-platform, desktop screenwriting application built with Qt (C++ and QML).
- It provides a rich QML/Qt Quick UI, an extensive C++ backend (document model, importers/exporters, reports, automation, networking), and local file storage.

##### File structure
- Top‐level directories of interest:
– src/…   : C++ modules, organized by concern (core, document, importers, exporters, network, printing, automation, reports, quick, utils).
– qml/…   : QML definitions for UI views, controls, dialogs, overlays, tasks.
– packaging/: Platform-specific packaging scripts for Linux, macOS, Windows.
– thirdparty/: Embedded third-party libraries (Crashpad, Hunspell, poly2tri, Quazip, etc.).
– docs/: User-facing documentation and screenshots.
- Patterns & architectural choices:
– Monolithic desktop client but modular by feature.
– Qt Quick (QML) frontend bound to C++ “Quick objects” for business logic.
– Clear separation of UI layer (QML), service layer (C++ modules), and persistence/third-party layers.

##### README for additional insights
- Confirms it is a Qt 5.15.10 project combining QML and C++.
- Lists core features (import/export, reports, PDF generation).
- No external microservices—network is used for user account/updates via REST API.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External User
    User((User)):::external

    %% UI Layer
    UI["QML / Qt Quick UI Layer"]:::ui
    click UI "https://github.com/teriflix/scrite/tree/master/qml/"

    %% Bridge Layer
    Bridge["Qt Quick Engine & Quick Objects Bridge"]:::bridge
    click Bridge "https://github.com/teriflix/scrite/tree/master/src/quick/objects/"
    Items["Quick Custom Items"]:::bridge
    click Items "https://github.com/teriflix/scrite/tree/master/src/quick/items/"

    %% Service Layer
    subgraph "Service Layer"
        core["Core Service Module"]:::service
        click core "https://github.com/teriflix/scrite/tree/master/src/core/"
        document["Document Model Module"]:::service
        click document "https://github.com/teriflix/scrite/tree/master/src/document/"
        importers["Importers Module"]:::service
        click importers "https://github.com/teriflix/scrite/tree/master/src/importers/"
        exporters["Exporters Module"]:::service
        click exporters "https://github.com/teriflix/scrite/tree/master/src/exporters/"
        reports["Reports Module"]:::service
        click reports "https://github.com/teriflix/scrite/tree/master/src/reports/"
        printing["Printing Subsystem"]:::service
        click printing "https://github.com/teriflix/scrite/tree/master/src/printing/"
        automation["Automation Module"]:::service
        click automation "https://github.com/teriflix/scrite/tree/master/src/automation/"
        network["Network Module"]:::network
        click network "https://github.com/teriflix/scrite/tree/master/src/network/"
        utils["Utilities Module"]:::service
        click utils "https://github.com/teriflix/scrite/tree/master/src/utils/"
    end

    %% Persistence & File I/O
    subgraph "Persistence & File I/O"
        localfs["Local Storage & File I/O"]:::db
        click localfs "https://github.com/teriflix/scrite/blob/master/src/document/documentfilesystem.*"
        click localfs "https://github.com/teriflix/scrite/blob/master/src/core/localstorage.*"
        quazip["Quazip (ZIP Vault)"]:::db
        click quazip "https://github.com/teriflix/scrite/tree/master/3rdparty/quazip/"
    end

    %% Third-Party Libraries
    subgraph "Third-Party Libraries"
        crashpad["Crashpad (Crash Reporting)"]:::third
        click crashpad "https://github.com/teriflix/scrite/tree/master/3rdparty/crashpad/"
        sonnet["Sonnet/Hunspell (Spell Checking)"]:::third
        click sonnet "https://github.com/teriflix/scrite/tree/master/3rdparty/sonnet/"
        poly["poly2tri (Geometry)"]:::third
        click poly "https://github.com/teriflix/scrite/tree/master/3rdparty/poly2tri/"
        simplecrypt["SimpleCrypt (Encryption)"]:::third
        click simplecrypt "https://github.com/teriflix/scrite/tree/master/3rdparty/simplecrypt/"
        openssl["OpenSSL"]:::third
        click openssl "https://github.com/teriflix/scrite/tree/master/3rdparty/openssl/"
    end

    %% Packaging Layer
    subgraph "Packaging & Installer"
        linux["Linux Scripts"]:::packaging
        click linux "https://github.com/teriflix/scrite/tree/master/packaging/linux/"
        mac["macOS Scripts"]:::packaging
        click mac "https://github.com/teriflix/scrite/tree/master/packaging/mac/"
        windows["Windows Scripts"]:::packaging
        click windows "https://github.com/teriflix/scrite/tree/master/packaging/windows/"
    end

    %% External REST API
    cloud((REST API Service)):::external

    %% Connections
    User --> UI
    UI --> Bridge
    Bridge --> Items
    Items --> core
    core --> document
    document <--> importers
    document <--> exporters
    document <--> reports
    document <--> automation
    importers --> localfs
    exporters --> localfs
    reports --> localfs
    reports --> printing
    core --> localfs
    core --> crashpad
    core --> network
    network --> cloud
    core --> packaging

    %% Styles
    classDef ui fill:#D0E6FF,stroke:#0366D6,color:#0366D6;
    classDef bridge fill:#E6F2FF,stroke:#5790D9,color:#5790D9;
    classDef service fill:#E6FFE6,stroke:#2E8B57,color:#2E8B57;
    classDef db fill:#F0F0F0,stroke:#777777,color:#333333;
    classDef third fill:#F9F9F9,stroke-dasharray: 5 5,stroke:#999999,color:#555555;
    classDef network fill:#FFF4E6,stroke:#FFA500,color:#C75A00;
    classDef packaging fill:#F3E6FF,stroke:#800080,color:#5D005D;
    classDef external fill:#FFFFFF,stroke-dasharray: 5 5,stroke:#000000,color:#000000;
```
