# otiozee/public architecture

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

- Interactive diagram: https://gitdiagram.com/otiozee/public
- Repository: https://github.com/otiozee/public

## Overview

##### Project type and purpose
- This is a monolithic “content-and-CI” repository for the 01-Edu educational system. It houses:
- Course materials and exercises (in the ​subjects​ folder)
- Language-specific test harnesses (in ​js​ and ​sh​ directories, plus a ​dom​ folder)
- Documentation (in ​docs​)
- Miscellaneous tasks for hiring (“employment-tasks”)
- GitHub Actions workflows (.github/workflows) for automated testing and compliance checks

##### File structure
- Top-level directories
- .github/workflows – CI definitions (lint, tests, builds)
- docs – static documentation on database, setup, reviews
- dom – JS-based DOM exercises with Dockerfile and tests
- js – Node-based exercises and tests, plus Dockerfile in js/tests
- sh – Shell-script exercises with tests and entrypoints
- subjects – hundreds of individual exercise subfolders (Go, Rust, JS, HTML, etc.)
- employment-tasks – sample tasks for DevOps/dev interviews
- CI indicators
- Dockerfiles in dom, js/tests, sh/tests – build isolated test containers
- GitHub Actions YAMLs – orchestrate compliance, build, test

##### Components
a. Source repository (GitHub)
b. CI/CD Plane (GitHub Actions)
– Compliance checks (Prettier, shellcheck, link checker)
– Image build jobs (Docker builds for dom, js, sh)
– Test orchestration (shell tests, Node tests, DOM tests)
c. Content plane
– Documentation generator (static Markdown served via GitHub Pages – implied by CNAME)
– Course content store (subjects/*, docs/*)
– Test definitions (js/tests, sh/tests, dom/*.js)
d. Runner containers
– dom-runner (Dockerfile in dom/)
– js-runner (Dockerfile in js/tests/)
– sh-runner (shell environment for sh/tests/)

##### Relationships & data flows
1. Developer pushes code → GitHub repo
2. PR triggers GitHub Actions →
- Lint/compliance workflows
- Docker build jobs for each language/test harness
- Test jobs:
– sh-runner executes sh/tests via entrypoint.sh
– js-runner executes Node tests (Jest/Mocha)
– dom-runner executes DOM tests with headless browser
3. Test results & coverage feedback → GitHub status checks
4. On master merges → (optional) site deployment to GitHub Pages using CNAME

##### Architectural patterns & design principles
- Monorepo pattern: all exercises, tests, docs in one repo
- CI-as-infrastructure: all validation wired through GitHub Actions
- Containerized test harnesses: isolating language environments
- Static site delivery for documentation and exercise descriptions

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Content Layer
    subgraph "Content Layer"
        Repo["Source Repository"]:::content
        Subjects["subjects/"]:::content
        DocsFolder["docs/"]:::deployment
        DomFolder["dom/"]:::content
        JsFolder["js/"]:::content
        ShFolder["sh/"]:::content
        EmpTasks["employment-tasks/"]:::content
    end

    %% CI Layer
    subgraph "CI Layer"
        Actions["GitHub Actions"]:::ci

        subgraph "Compliance Checks"
            Prettier["Prettier"]:::ci
            ShellCheck["ShellCheck"]:::ci
            LinkCheck["Link Checker"]:::ci
            ComplianceMeta["Compliance Workflow"]:::ci
        end

        subgraph "Image Build Jobs"
            DomBuild["dom/Dockerfile"]:::ci
            JsBuild["js/tests/Dockerfile"]:::ci
            ShBuild["sh/tests/Dockerfile"]:::ci
        end

        subgraph "Test Orchestration & Runners"
            domRunner["dom-runner"]:::ci
            jsRunner["js-runner"]:::ci
            shRunner["sh-runner"]:::ci
        end
    end

    %% Deployment Layer
    subgraph "Deployment Layer"
        Status["Status Checks"]:::deployment
        Pages["GitHub Pages"]:::deployment
    end

    %% Connections
    Repo -->|"push & PR"| Actions
    Actions -->|runs| Prettier
    Actions -->|runs| ShellCheck
    Actions -->|runs| LinkCheck
    Actions -->|runs| ComplianceMeta
    Actions -->|builds| DomBuild
    Actions -->|builds| JsBuild
    Actions -->|builds| ShBuild
    Actions -->|orchestrates tests| domRunner
    Actions -->|orchestrates tests| jsRunner
    Actions -->|orchestrates tests| shRunner
    domRunner -->|"test results"| Status
    jsRunner -->|"test results"| Status
    shRunner -->|"test results"| Status
    Status -->|"checks pass"| Actions
    Actions -->|"merge to master"| Pages
    Subjects -->|content| Repo
    DocsFolder -->|docs| Repo
    DomFolder -->|exercises| Repo
    JsFolder -->|exercises| Repo
    ShFolder -->|exercises| Repo
    EmpTasks -->|samples| Repo

    %% Click Events
    click Repo "https://github.com/otiozee/public/tree/master//"
    click Subjects "https://github.com/otiozee/public/tree/master/subjects/"
    click DocsFolder "https://github.com/otiozee/public/tree/master/docs/"
    click DomFolder "https://github.com/otiozee/public/tree/master/dom/"
    click JsFolder "https://github.com/otiozee/public/tree/master/js/"
    click ShFolder "https://github.com/otiozee/public/tree/master/sh/"
    click EmpTasks "https://github.com/otiozee/public/tree/master/employment-tasks/"
    click Prettier "https://github.com/otiozee/public/blob/master/.github/workflows/ga-misc-check-prettier.yml"
    click ShellCheck "https://github.com/otiozee/public/blob/master/.github/workflows/ga-misc-check-shellcheck.yml"
    click LinkCheck "https://github.com/otiozee/public/blob/master/.github/workflows/ga-misc-check-links.yml"
    click ComplianceMeta "https://github.com/otiozee/public/blob/master/.github/workflows/ga-misc-check-compliance.yml"
    click DomBuild "https://github.com/otiozee/public/tree/master/dom/Dockerfile"
    click JsBuild "https://github.com/otiozee/public/tree/master/js/tests/Dockerfile"
    click ShBuild "https://github.com/otiozee/public/tree/master/sh/tests/Dockerfile"
    click domRunner "https://github.com/otiozee/public/blob/master/dom/entrypoint.sh"
    click jsRunner "https://github.com/otiozee/public/blob/master/js/tests/package.json"
    click shRunner "https://github.com/otiozee/public/blob/master/sh/tests/entrypoint.sh"

    %% Styles
    classDef content fill:#D6EAF8,stroke:#1B4F72
    classDef ci fill:#D5F5E3,stroke:#196F3D
    classDef deployment fill:#FCF3CF,stroke:#9A7D0A
```
