# moabukar/tech-vault architecture

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

- Interactive diagram: https://gitdiagram.com/moabukar/tech-vault
- Repository: https://github.com/moabukar/tech-vault

## Overview

##### Project Type and Purpose
- Tech Vault is an open-source repository of curated engineering interview questions, challenges, and hands-on labs. It’s primarily a documentation and code‐sample library (Markdown + challenge code) with an accompanying CLI tool for question retrieval.

##### File Structure Analysis
- Top-level folders (“coding‐challenges”, “devops-challenges”, “dsa-challenges”) each contain subfolders per question, with code, configs, and README.
- “misc/py” and “misc/go” hold the random question generator scripts.
- CI/deployment manifests scattered under challenge codes (GitHub workflows, Ansible, Terraform, Serverless).
- No dedicated “frontend” or “backend” folder—this is a content repo plus tooling.

##### Key Components
a. GitHub Repository (Content Store)
- Stores Markdown docs & challenge code.
- Hosts multiple modules: Coding, DevOps, DSA, Misc.
- Exposes content via GitHub web UI or git clone.
b. CI/CD (GitHub Actions)
- Validation workflows under `.github/workflows` in challenges (e.g., Q30, Q42).
- Runs tests (e.g., Python tests in Q16), linting, Terraform validation.
c. Tech Vault CLI
- Two implementations (Python, Go) under `misc/py` & `misc/go`.
- Packages question files, applies filters (category, difficulty).
- Distributed as a pip or Go module.
d. Consumers
- Engineers browse content on GitHub Pages or local clone.
- Use CLI to fetch random or specific questions offline.
e. External Services
- Terraform Cloud or AWS for Terraform-based challenges.
- AWS Lambda for serverless examples.
- Docker/Kubernetes clusters for container/K8s challenges.

##### Relationships & Data Flow
- Developers → commit new questions/code → GitHub Repo
- Repo → triggers → CI/CD Pipelines → builds/tests → status badges
- Repo → serves → GitHub Pages (docs view)
- Users → git clone / GitHub UI → read questions
- Users → install & run CLI → fetch/quiz questions
- Challenge code → deploys → external infra (AWS, Docker, K8s)

##### Architectural Patterns
- Modular content directories (one module per topic)
- “Paper” architecture: flat file storage, no monolithic application
- CLI tool as thin client on top of repository
- GitOps/Infrastructure as Code for challenge environments

##### Essential Elements
- Clear component labels (Repo, CI/CD, CLI, User, Infra).
- File modules (rectangles)
- Processes (rounded rectangles)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Users
    User["Engineers / Users"]:::external

    %% GitHub Repository
    subgraph "GitHub Repository (Content Store)"
        direction TB
        Repo["Repo: Tech Vault"]:::repo
        CC["Coding-Challenges"]:::doc
        DC["DevOps-Challenges"]:::doc
        DS["DSA-Challenges"]:::doc
        MT["Misc Tools"]:::cli
        Repo --> CC
        Repo --> DC
        Repo --> DS
        Repo --> MT
    end

    %% CI/CD
    CICD["CI/CD (GitHub Actions)"]:::ci

    %% CLI Tools
    subgraph "Tech Vault CLI"
        direction TB
        PyCLI["Python CLI"]:::cli
        GoCLI["Go CLI"]:::cli
    end

    %% External Infra
    subgraph "External Infrastructure"
        direction TB
        subgraph "Terraform IaC Challenges"
            direction TB
            TF1["q17/main.tf"]:::ext
            TF2["q23/main.tf"]:::ext
            TF3["q24/main.tf"]:::ext
            TF4["q25/main.tf"]:::ext
            TF5["q26/infra.tf"]:::ext
            TF6["q29/main.tf"]:::ext
            TF7["q42/main.tf"]:::ext
        end
        subgraph "Serverless / Lambda"
            direction TB
            SL1["q15-serverless.yml"]:::ext
            SL2["handler.py"]:::ext
            SL3["requirements.txt"]:::ext
        end
        subgraph "Docker / Kubernetes Examples"
            direction TB
            DK1["q16 Dockerfile"]:::ext
            DK2["q32 docker-compose.yml"]:::ext
            DK3["q37 docker-compose.yml"]:::ext
            DK4["q37/backend"]:::ext
            DK5["q37/frontend"]:::ext
            DK6["q37/database"]:::ext
        end
        subgraph "Ansible Playbooks / Config"
            direction TB
            AN1["q30 playbooks"]:::ext
            AN2["q33 roles"]:::ext
            AN3["q41 roles/webserver/molecule"]:::ext
        end
        subgraph "Helm Charts"
            direction TB
            HC1["q34 charts/my-python-app"]:::ext
            HC2["q35 charts/backend"]:::ext
            HC3["q35 charts/frontend"]:::ext
            HC4["q35 helmfile/helmfile.yaml"]:::ext
        end
    end

    %% Flows
    User -->|git clone / browse| Repo
    Repo -->|push triggers| CICD
    CICD -->|"status badges"| Repo
    Repo -->|serves docs| User
    User -->|run CLI| PyCLI
    User -->|run CLI| GoCLI
    Repo -->|fetch questions| PyCLI
    Repo -->|fetch questions| GoCLI
    DC -->|deploy challenges| TF1 & TF2 & TF3 & TF4 & TF5 & TF6 & TF7
    DC -->|deploy challenges| SL1 & SL2 & SL3
    DC -->|deploy challenges| DK1 & DK2 & DK3 & DK4 & DK5 & DK6
    DC -->|deploy challenges| AN1 & AN2 & AN3
    DC -->|deploy challenges| HC1 & HC2 & HC3 & HC4

    %% Click events
    click Repo "https://github.com/moabukar/tech-vault/tree/main//"
    click CC "https://github.com/moabukar/tech-vault/tree/main//coding-challenges"
    click DC "https://github.com/moabukar/tech-vault/tree/main//devops-challenges"
    click DS "https://github.com/moabukar/tech-vault/tree/main//dsa-challenges"
    click MT "https://github.com/moabukar/tech-vault/tree/main//misc"
    click PyCLI "https://github.com/moabukar/tech-vault/blob/main//misc/py/question_count.py"
    click PyCLI "https://github.com/moabukar/tech-vault/blob/main//misc/py/randomiser.py"
    click PyCLI "https://github.com/moabukar/tech-vault/blob/main//misc/py/requirements.txt"
    click GoCLI "https://github.com/moabukar/tech-vault/blob/main//misc/go/count_questions.go"
    click GoCLI "https://github.com/moabukar/tech-vault/blob/main//misc/go/random.go"
    click CICD "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q30/.github/workflows/ansible.yml"
    click CICD "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q42/.github/workflows/ci.yml"
    click TF1 "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q17/terraform/main.tf"
    click TF2 "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q23/terraform/main.tf"
    click TF3 "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q24/main.tf"
    click TF4 "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q25/main.tf"
    click TF5 "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q26/infra.tf"
    click TF6 "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q29/terraform/main.tf"
    click TF7 "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q42/terraform/main.tf"
    click SL1 "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q15/q15-serverless.yml"
    click SL2 "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q17/lambda/handler.py"
    click SL3 "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q17/lambda/requirements.txt"
    click DK1 "https://github.com/moabukar/tech-vault/tree/main//devops-challenges/code/q16/Dockerfile"
    click DK2 "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q32/docker-compose.yml"
    click DK3 "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q37/docker-compose.yml"
    click DK4 "https://github.com/moabukar/tech-vault/tree/main//devops-challenges/code/q37/backend"
    click DK5 "https://github.com/moabukar/tech-vault/tree/main//devops-challenges/code/q37/frontend"
    click DK6 "https://github.com/moabukar/tech-vault/tree/main//devops-challenges/code/q37/database"
    click AN1 "https://github.com/moabukar/tech-vault/tree/main//devops-challenges/code/q30/playbooks"
    click AN2 "https://github.com/moabukar/tech-vault/tree/main//devops-challenges/code/q33/roles"
    click AN3 "https://github.com/moabukar/tech-vault/tree/main//devops-challenges/code/q41/roles/webserver/molecule"
    click HC1 "https://github.com/moabukar/tech-vault/tree/main//devops-challenges/code/q34/charts/my-python-app"
    click HC2 "https://github.com/moabukar/tech-vault/tree/main//devops-challenges/code/q35/charts/backend"
    click HC3 "https://github.com/moabukar/tech-vault/tree/main//devops-challenges/code/q35/charts/frontend"
    click HC4 "https://github.com/moabukar/tech-vault/blob/main//devops-challenges/code/q35/helmfile/helmfile.yaml"

    %% Styles
    classDef doc fill:#bbdefb,stroke:#000
    classDef cli fill:#c8e6c9,stroke:#000
    classDef ci fill:#ffe0b2,stroke:#000
    classDef ext fill:#e0e0e0,stroke:#000
    classDef repo fill:#bbdefb,stroke:#000
    classDef external fill:#e0e0e0,stroke:#000
```
