# teselagen/tg-oss architecture

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

- Interactive diagram: https://gitdiagram.com/teselagen/tg-oss
- Repository: https://github.com/teselagen/tg-oss

## Overview

##### Project type and purpose
- This is a TypeScript/JavaScript monorepo (managed by Nx) that hosts multiple related but independent packages for bioinformatics and UI tooling.
- Its primary purpose is to provide:
- @teselagen/ove, a React-based vector editor for viewing/editing DNA/AA sequences
- @teselagen/ui, a reusable React component library
- Utility libraries (@bio-parsers, @sequence-utils, @range-utils, @file-utils) for parsing, manipulating sequences and files
- Small demo and loader tools (bounce-loader, uploader, example-demos, shared-demo)
- CI/CD pipelines (GitHub Actions) run linting, unit tests (Jest/Vitest), E2E tests (Cypress/Playwright) and publishing.

##### File structure
- Top-level config files: nx.json, tsconfig.base.json, jest.config.ts, babel.config.json, .eslintrc.json, .prettierrc, .github/workflows/*
- /packages – each subfolder is an independent npm package project.json + tsconfig.json + source, tests, demo or config files
- bio-parsers
- sequence-utils
- range-utils
- file-utils
- ove
- ui
- bounce-loader
- uploader
- shared-demo
- /example-demos & /packages/*/demo – small demo apps showing usage of the libraries
- /tools/scripts – custom publishing scripts
- Root workflows: cypress.yml, playwright.yml, update_gh_pages.yml

##### README
- Lists the six primary packages, their purpose, demo URLs, publish scripts via `nx run <pkg>:publish`
- Emphasizes monorepo publishing strategy

##### Detail without overthinking
- Both technical infra (Nx, CI) and application layers (libs, core editor, demos)

This structure will give a comprehensive, accurate architectural overview of the monorepo, its constituent packages, their interdependencies, and the DevOps processes that bind them together.

## Diagram (Mermaid)

```mermaid
flowchart TB
  subgraph "Root Tooling"
    direction TB
    NX["Nx & Yarn Workspaces"]:::root
    RootPkg["package.json (root)"]:::root
    TSConfig["tsconfig.base.json"]:::root
    Workflows["GitHub Actions & Workflows"]:::ci
    LintHooks["Husky & lint-staged"]:::ci
    ToolsConfig["Babel & Vite Configs"]:::root
    Testing["Testing Configurations"]:::test
    click NX "https://github.com/teselagen/tg-oss/blob/master/nx.json"
    click RootPkg "https://github.com/teselagen/tg-oss/blob/master/package.json"
    click TSConfig "https://github.com/teselagen/tg-oss/blob/master/tsconfig.base.json"
    click Workflows "https://github.com/teselagen/tg-oss/tree/master/.github/workflows"
    click LintHooks "https://github.com/teselagen/tg-oss/tree/master/.husky/pre-commit"
    click ToolsConfig "https://github.com/teselagen/tg-oss/blob/master/vite.config.ts"
    click Testing "https://github.com/teselagen/tg-oss/blob/master/jest.config.ts"
  end

  subgraph "Utility Libraries"
    direction TB
    BioParsers["bio-parsers"]:::util
    SequenceUtils["sequence-utils"]:::util
    RangeUtils["range-utils"]:::util
    FileUtils["file-utils"]:::util
    click BioParsers "https://github.com/teselagen/tg-oss/tree/master/packages/bio-parsers/"
    click SequenceUtils "https://github.com/teselagen/tg-oss/tree/master/packages/sequence-utils/"
    click RangeUtils "https://github.com/teselagen/tg-oss/tree/master/packages/range-utils/"
    click FileUtils "https://github.com/teselagen/tg-oss/tree/master/packages/file-utils/"
  end

  subgraph "Core & UI Libraries"
    direction TB
    UI["@teselagen/ui"]:::core
    OVE["@teselagen/ove"]:::core
    click UI "https://github.com/teselagen/tg-oss/tree/master/packages/ui/"
    click OVE "https://github.com/teselagen/tg-oss/tree/master/packages/ove/"
  end

  subgraph "Demo & Loader Utilities"
    direction TB
    BounceLoader["bounce-loader"]:::demo
    Uploader["uploader"]:::demo
    SharedDemo["shared-demo"]:::demo
    OveDemoPkg["ove/demo"]:::demo
    UIDemo["ui/demo"]:::demo
    ExampleViteDemo["oveViteDemo (example)"]:::demo
    ExampleWebpackDemo["oveWebpackDemo (example)"]:::demo
    click BounceLoader "https://github.com/teselagen/tg-oss/tree/master/packages/bounce-loader/"
    click Uploader "https://github.com/teselagen/tg-oss/tree/master/packages/uploader/"
    click SharedDemo "https://github.com/teselagen/tg-oss/tree/master/packages/shared-demo/"
    click OveDemoPkg "https://github.com/teselagen/tg-oss/tree/master/packages/ove/demo/"
    click UIDemo "https://github.com/teselagen/tg-oss/tree/master/packages/ui/demo/"
    click ExampleViteDemo "https://github.com/teselagen/tg-oss/tree/master/example-demos/oveViteDemo/"
    click ExampleWebpackDemo "https://github.com/teselagen/tg-oss/tree/master/example-demos/oveWebpackDemo/"
  end

  %% Dependencies
  BioParsers --> SequenceUtils
  RangeUtils --> SequenceUtils
  FileUtils --> SequenceUtils
  SequenceUtils --> UI
  SequenceUtils --> OVE
  BioParsers --> OVE
  UI --> OVE
  UI --> SharedDemo
  OVE --> OveDemoPkg
  OVE --> ExampleViteDemo
  OVE --> ExampleWebpackDemo
  BounceLoader --> UI
  Uploader --> UI

  %% Orchestration & CI
  NX --> BioParsers
  NX --> SequenceUtils
  NX --> RangeUtils
  NX --> FileUtils
  NX --> UI
  NX --> OVE
  NX --> BounceLoader
  NX --> Uploader
  NX --> SharedDemo
  NX --> OveDemoPkg
  NX --> UIDemo
  NX --> ExampleViteDemo
  NX --> ExampleWebpackDemo
  CI[CI/CD Pipeline]:::ci
  CI --> NX
  ToolsConfig --> NX
  Testing --> NX

  classDef root fill:#dddddd,stroke:#888888,color:#000000
  classDef util fill:#2B8CC4,stroke:#000000,color:#ffffff
  classDef core fill:#4CAF50,stroke:#000000,color:#ffffff
  classDef demo fill:#F9A825,stroke:#000000,color:#000000
  classDef ci fill:#EF6C00,stroke:#000000,color:#ffffff
  classDef test fill:#FF5722,stroke:#000000,color:#ffffff
```
