# nxpatterns/enterprise-software-architecture architecture

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

- Interactive diagram: https://gitdiagram.com/nxpatterns/enterprise-software-architecture
- Repository: https://github.com/nxpatterns/enterprise-software-architecture

## Overview

##### Project Type and Purpose
- This is a documentation & tooling repository (“Elvis”) built around Nx workspaces, Angular, NestJS, and related technologies.
- It serves two roles:
a. A **content platform** (Markdown articles, PDFs, SVG assets) for tutorials and best practices.
b. A **toolkit** (Python scripts, Node/NPM config) to automate and modernize existing Nx-based Angular/NestJS projects (e.g., fixing webpack configs).

##### File‑Structure Analysis
- Root level
- package.json          – NPM scripts and dependencies (e.g., markdown linters, build tooling)
- .gitignore, .gitattributes, .vscode  – VCS and editor config
- /articles
- Organized by topic: Angular, JavaScript, Nest.js, Nx, TypeScript
- Contains both placeholder dirs (.gitkeep) and ready‐to‐read PDFs (e.g., Quick‑Start guides)
- /assets/svg
- /scripts/python/webpack-related-issues
- A set of Python utilities to programmatically modify Nx workspace JSON, package.json, project.json
- Automates “use local package,” “update version,” “remove from config,” etc.

##### Key Points from README
- “Elvis” is both the **brand** and the **ongoing documentation project** for enterprise‑grade Nx workspaces.
- The first deliverable: “NestJS for Angular Experts” tutorial (found under articles/Nest.js…).
- The author’s goal: steadily expand this knowledge base and the accompanying automation tools.

a. Main Components
- Content Repository
– Markdown articles, PDFs, SVG assets
- Tooling Engine
– Python script modules for workspace/config automation
– NPM scripts (as entry points)
- Local Authoring Environment
– VSCode + markdownlint (per .markdownlint.json)
– Node.js runtime + Python runtime
- External Nx Workspace (Target Projects)
– Repositories that get modified by the Python scripts
- CI/Publishing Pipeline (optional)
– GitHub Actions or another CI to lint, build, and deploy docs (e.g., to GitHub Pages)

b. Relationships & Data Flows
1. **Author** edits Markdown in /articles and SVG in /assets/svg.
2. **Local tooling**
– NPM scripts invoke markdownlint & previewers
– Python scripts read/write target project files (nx.json, package.json)
3. **Version Control**
– Changes pushed to GitHub (“webia1/elvis”)
4. **CI/Publishing**
– On push: lint → build static site → deploy to hosting

c. Architectural Patterns & Principles
- **Separation of Concerns**:
- Content vs. tooling scripts vs. assets
- **Modular Tooling**:
- Each Python script addresses a single config‐tweaking task
- **Convention over Configuration**:
- Scripts assume Nx workspace layout (nx.json, project.json locations)
- **Extensibility**:
- New tutorial topics → create new subfolders under /articles
- New automation tasks → add new Python modules under scripts/

d. Key Technologies & Frameworks
- Markdown + PDF for content
- SVG for vector assets
- Python 3.x for workspace automation
- Node.js + NPM for linting & possible static‐site toolchain
- Nx (implicitly, as the external target)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Local Authoring Environment"
        Author["Author"]:::external
        VSCode["VSCode Settings"]:::tooling
        NodeRuntime["Node.js Runtime"]:::tooling
        PythonRuntime["Python Runtime"]:::tooling
    end

    subgraph "Content Repository"
        Articles["Markdown Articles"]:::content
        SVGAssets["SVG Assets"]:::content
        subgraph "Articles Topics"
            AngularArticles["Angular Articles"]:::content
            JSArticles["JavaScript Articles PDF"]:::content
            NestTutorial["NestJS Tutorial PDF"]:::content
            NxArticles["Nx Articles Placeholder"]:::content
            TSArticles["TypeScript Articles Placeholder"]:::content
        end
    end

    subgraph "Automation Toolkit"
        NpmScripts["NPM Scripts & Dependencies"]:::tooling
        MDLintConfig["MarkdownLint Config"]:::tooling
        subgraph "Python Modules"
            removeFromNx["remove-from-nx-json.py"]:::tooling
            removeFromPkg["remove-from-package-json.py"]:::tooling
            removeFromProj["remove-from-project-json.py"]:::tooling
            updateVersion["update-version-in-local-package.py"]:::tooling
            useLocalPkg["use-local-package-in-package-json.py"]:::tooling
        end
    end

    subgraph "Repository Metadata"
        GitMeta[".gitignore"]:::external
        GitAttributes[".gitattributes"]:::external
        License["LICENSE.md"]:::external
        ReadMe["ReadMe.md"]:::external
    end

    subgraph "External Systems"
        GitHub["Git Repository"]:::external
        ExtNx["External Nx Workspace(s)"]:::external
        CI["CI/Publishing Service"]:::external
    end

    %% Flows
    Author --> VSCode
    Author --> NodeRuntime
    Author --> PythonRuntime
    Author --> Articles
    Author --> SVGAssets

    NodeRuntime --> NpmScripts
    NpmScripts --> MDLintConfig
    PythonRuntime --> removeFromNx
    PythonRuntime --> removeFromPkg
    PythonRuntime --> removeFromProj
    PythonRuntime --> updateVersion
    PythonRuntime --> useLocalPkg

    removeFromNx --> ExtNx
    removeFromPkg --> ExtNx
    removeFromProj --> ExtNx
    updateVersion --> ExtNx
    useLocalPkg --> ExtNx

    Author --> GitHub
    GitHub --> CI
    CI --> Articles
    CI --> SVGAssets

    %% Click Events
    click Articles "https://github.com/nxpatterns/enterprise-software-architecture/tree/main/articles/"
    click AngularArticles "https://github.com/nxpatterns/enterprise-software-architecture/tree/main/articles/Angular/"
    click JSArticles "https://github.com/nxpatterns/enterprise-software-architecture/blob/main/articles/JavaScript/JS-Function-Invocations.pdf"
    click NestTutorial "https://github.com/nxpatterns/enterprise-software-architecture/blob/main/articles/Nest.js/Quick-Start-Nx-Angular/pdf/Dark-PDF-Quick-Start-Nx-Angular-Nest-v0.7.0.pdf"
    click NxArticles "https://github.com/nxpatterns/enterprise-software-architecture/tree/main/articles/Nx/"
    click TSArticles "https://github.com/nxpatterns/enterprise-software-architecture/tree/main/articles/TypeScript/"
    click SVGAssets "https://github.com/nxpatterns/enterprise-software-architecture/tree/main/assets/svg/"
    click removeFromNx "https://github.com/nxpatterns/enterprise-software-architecture/blob/main/scripts/python/webpack-related-issues/remove-from-nx-json.py"
    click removeFromPkg "https://github.com/nxpatterns/enterprise-software-architecture/blob/main/scripts/python/webpack-related-issues/remove-from-package-json.py"
    click removeFromProj "https://github.com/nxpatterns/enterprise-software-architecture/blob/main/scripts/python/webpack-related-issues/remove-from-project-json.py"
    click updateVersion "https://github.com/nxpatterns/enterprise-software-architecture/blob/main/scripts/python/webpack-related-issues/update-version-in-local-package.py"
    click useLocalPkg "https://github.com/nxpatterns/enterprise-software-architecture/blob/main/scripts/python/webpack-related-issues/use-local-package-in-package-json.py"
    click NpmScripts "https://github.com/nxpatterns/enterprise-software-architecture/blob/main/package.json"
    click MDLintConfig "https://github.com/nxpatterns/enterprise-software-architecture/blob/main/.markdownlint.json"
    click VSCode "https://github.com/nxpatterns/enterprise-software-architecture/tree/main/.vscode/"
    click GitMeta "https://github.com/nxpatterns/enterprise-software-architecture/blob/main/.gitignore"
    click GitAttributes "https://github.com/nxpatterns/enterprise-software-architecture/blob/main/.gitattributes"
    click License "https://github.com/nxpatterns/enterprise-software-architecture/blob/main/LICENSE.md"
    click ReadMe "https://github.com/nxpatterns/enterprise-software-architecture/blob/main/ReadMe.md"

    %% Styles
    classDef content fill:#e0f7fa,stroke:#006064,color:#006064
    classDef tooling fill:#e8f5e9,stroke:#1b5e20,color:#1b5e20
    classDef external fill:#fff3e0,stroke:#e65100,color:#e65100
```
