# phumal/basic-typst-resume-template architecture

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

- Interactive diagram: https://gitdiagram.com/phumal/basic-typst-resume-template
- Repository: https://github.com/phumal/basic-typst-resume-template

## Overview

##### Project type and purpose
- This is an open-source Typst “resume template” package.
- Purpose: provide a reusable, ATS-friendly resume layout, complete with formatting helpers and example files.

##### File structure
- Top-level concerns:
- .github/workflows – continuous integration (tests.yml) and release (release.yml)
- scripts/ & Justfile – local setup, packaging, and uninstall automation
- src/ – core Typst library (lib.typ) and resume entrypoint (resume.typ)
- template/ – main.typ example or fallback template
- docs/ – user manual (manual.typ)
- tests/ – test fixtures and reference outputs
- typst.toml – package metadata (name, version, dependencies)
- Patterns: clear separation of source, tests, docs, automation, and CI.

##### README for additional insights
- Describes how to import the published package (`@preview/basic-resume:0.2.8`)
- Lists formatting helper functions (#edu, #work, etc.)
- Shows a sample workflow: author sets variables, calls `#show: resume.with(...)`

##### Main components
a. Developer workstation
- Typst compiler (external tool)
- Local scripts/Just – setup, package, test commands
- Source modules (src/, template/)
- Tests (tests/)
- Docs (docs/)
b. Version control & CI/CD
- GitHub repo with workflows for test and release
- GitHub Actions runners (execute Justfile targets, run Typst tests)
c. Package registry & consumers
- Typst Package Registry (preview)
- End-user Typst projects (importing the resume template)

##### Relationships & dataflow
- Developer edits src/, template/, docs/ → commits to GitHub
- GitHub Actions “tests.yml” pulls repo → runs `just test` → Typst compiles test.typ → compares against tests/debug/ref
- On tag creation, “release.yml” builds package via `just package` → publishes to Typst registry
- Users import the published version in their .typ files → Typst compiler fetches package → generates PDF

##### Architectural patterns & design principles
- Separation of concerns: code, docs, tests, automation, CI
- Convention-over-configuration: typst.toml drives package metadata, Justfile centralizes commands
- Source as library + entrypoint (lib.typ + resume.typ)
- Test-driven delivery: fixtures in tests/, CI gating merges

##### Relevant technologies, frameworks, libraries
- Typst (compiler and package registry)
- Just (task runner)
- Bash scripts (scripts/)
- GitHub Actions (CI/CD)

##### Detail
- Tests/debug vs. tests/debug/ref comparison in CI
- Typst.toml driving the package metadata block

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Workstation
    subgraph "Developer Workstation"
        direction TB
        TypstCompiler["Typst Compiler"]:::external
        Justfile["Justfile"]:::automation
        SetupScript["scripts/setup"]:::automation
        PackageScript["scripts/package"]:::automation
        UninstallScript["scripts/uninstall"]:::automation
        srcLib["src/lib.typ"]:::source
        srcResume["src/resume.typ"]:::source
        Template["template/main.typ"]:::source
        Docs["docs/manual.typ"]:::testdocs
        TestFixture["tests/debug/test.typ"]:::testdocs
        TestRef["tests/debug/ref/"]:::testdocs
        Metadata["typst.toml"]:::testdocs
        Ignore[".typstignore"]:::testdocs
        README["README.md"]:::testdocs
        Changelog["CHANGELOG.md"]:::testdocs
        License["LICENSE"]:::testdocs
    end

    %% GitHub Repository & CI/CD
    subgraph "GitHub Repository"
        direction TB
        GHRepo["GitHub Repo"]:::external
        TestsWF[".github/workflows/tests.yml"]:::automation
        ReleaseWF[".github/workflows/release.yml"]:::automation
        ActionsRunner["GitHub Actions Runner"]:::external
    end

    %% Registry
    TypstRegistry["Typst Package Registry"]:::external

    %% End-User Consumption
    subgraph "End-User Project"
        direction TB
        Consumer["Typst Project"]:::external
        PDF["PDF Output"]:::external
    end

    %% Connections
    TypstCompiler -->|compiles src & tests| srcLib
    Justfile -->|defines tasks| SetupScript
    Justfile -->|defines tasks| PackageScript
    Justfile -->|defines tasks| UninstallScript

    %% Dev to GitHub
    TypstCompiler & Justfile & SetupScript & PackageScript & UninstallScript & srcLib & srcResume & Template & Docs & TestFixture & TestRef & Metadata & Ignore & README & Changelog & License -->|push commits| GHRepo

    %% CI Workflows
    GHRepo -->|triggers| TestsWF
    TestsWF -->|runs| ActionsRunner
    ActionsRunner -->|runs just test| TypstCompiler
    TypstCompiler -->|compares output| TestRef

    GHRepo -->|on tag| ReleaseWF
    ReleaseWF -->|runs| ActionsRunner
    ActionsRunner -->|runs just package| PackageScript
    PackageScript -->|publishes v0.2.8| TypstRegistry

    %% Consumption
    Consumer -->|import @preview/basic-resume:0.2.8| TypstRegistry
    Consumer -->|calls Typst Compiler| TypstCompiler
    TypstCompiler -->|generates| PDF

    %% Click Events
    click TestsWF "https://github.com/phumal/basic-typst-resume-template/blob/main/.github/workflows/tests.yml"
    click ReleaseWF "https://github.com/phumal/basic-typst-resume-template/blob/main/.github/workflows/release.yml"
    click Justfile "https://github.com/phumal/basic-typst-resume-template/tree/main/Justfile"
    click SetupScript "https://github.com/phumal/basic-typst-resume-template/tree/main/scripts/setup"
    click PackageScript "https://github.com/phumal/basic-typst-resume-template/tree/main/scripts/package"
    click UninstallScript "https://github.com/phumal/basic-typst-resume-template/tree/main/scripts/uninstall"
    click srcLib "https://github.com/phumal/basic-typst-resume-template/blob/main/src/lib.typ"
    click srcResume "https://github.com/phumal/basic-typst-resume-template/blob/main/src/resume.typ"
    click Template "https://github.com/phumal/basic-typst-resume-template/blob/main/template/main.typ"
    click Docs "https://github.com/phumal/basic-typst-resume-template/blob/main/docs/manual.typ"
    click TestFixture "https://github.com/phumal/basic-typst-resume-template/blob/main/tests/debug/test.typ"
    click TestRef "https://github.com/phumal/basic-typst-resume-template/tree/main/tests/debug/ref/"
    click Metadata "https://github.com/phumal/basic-typst-resume-template/blob/main/typst.toml"
    click Ignore "https://github.com/phumal/basic-typst-resume-template/blob/main/.typstignore"
    click README "https://github.com/phumal/basic-typst-resume-template/blob/main/README.md"
    click Changelog "https://github.com/phumal/basic-typst-resume-template/blob/main/CHANGELOG.md"
    click License "https://github.com/phumal/basic-typst-resume-template/tree/main/LICENSE"

    %% Styles
    classDef source fill:#D0E8FF,stroke:#0366d6,color:#000
    classDef automation fill:#D2F8D2,stroke:#28a745,color:#000
    classDef testdocs fill:#FFF4CC,stroke:#ffd33d,color:#000
    classDef external fill:#FFDDA0,stroke:#d73a49,color:#000
```
