# meghanab1909/cc-project architecture

> Architecture diagram of the GitHub repository meghanab1909/cc-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/meghanab1909/cc-project
- Repository: https://github.com/meghanab1909/cc-project

## Overview

Docksmith builds Docker-like images from Docksmithfiles, lists and removes them, and runs commands in isolated Linux root filesystems. The main workflow starts at the CLI: build instructions are parsed and executed with layer caching, then manifests and layer archives are stored; run loads an image, assembles its filesystem, applies environment and command settings, and invokes the shared isolation primitive. The README also documents COPY, RUN, WORKDIR, ENV, CMD, cache reuse, environment overrides, and filesystem isolation. The GUI terminal is present but its integration with Docksmith commands is not established by the excerpts.

Main entry points: [`builder/build_engine.py`](https://github.com/meghanab1909/cc-project/blob/main/builder/build_engine.py) (Build Engine), [`runtime/runtime.py`](https://github.com/meghanab1909/cc-project/blob/main/runtime/runtime.py) (Run Orchestration), [`main.py`](https://github.com/meghanab1909/cc-project/blob/main/main.py) (CLI Commands), [`utils/image_store.py`](https://github.com/meghanab1909/cc-project/blob/main/utils/image_store.py) (Image Manifests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Interfaces"]
  node_cli["CLI Commands<br/>[main.py]"]
  node_terminal["GUI Terminal<br/>[docksmith.py]"]
end

subgraph group_build["Image Build"]
  node_parser["Instruction Parser<br/>[parser.py]"]
  node_builder["Build Engine<br/>[build_engine.py]"]
  node_cache["Build Cache<br/>[cache.py]"]
  node_layer_engine["Layer Utilities<br/>[layer_engine.py]"]
end

subgraph group_runtime["Container Runtime"]
  node_runtime_api["Run Orchestration<br/>[runtime.py]"]
  node_filesystem["Rootfs Assembly<br/>[runtime.py]"]
  node_isolation["Linux Isolation<br/>[runtime.py]"]
end

subgraph group_storage["Image Storage"]
  node_manifests[("Image Manifests<br/>[image_store.py]")]
  node_layers[("Layer Archives<br/>[image_store.py]")]
  node_cache_files[("Cache Records<br/>[image_store.py]")]
end

node_user(("Operator"))

node_user -->|"invokes"| node_cli
node_cli -->|"builds image"| node_builder
node_builder -->|"parses instructions"| node_parser
node_builder -->|"checks cache"| node_cache
node_builder -->|"runs build steps"| node_runtime_api
node_builder -->|"loads and saves"| node_manifests
node_builder -->|"writes and extracts"| node_layers
node_builder -->|"stores cache"| node_cache_files
node_cli -->|"lists and removes"| node_manifests
node_cli -->|"runs container"| node_runtime_api
node_runtime_api -->|"loads image"| node_manifests
node_runtime_api -->|"assembles rootfs"| node_filesystem
node_filesystem -->|"extracts layers"| node_layers
node_runtime_api -->|"executes command"| node_isolation
node_builder -.->|"uses utilities"| node_layer_engine

click node_cli "https://github.com/meghanab1909/cc-project/blob/main/main.py"
click node_terminal "https://github.com/meghanab1909/cc-project/blob/main/docksmith.py"
click node_parser "https://github.com/meghanab1909/cc-project/blob/main/builder/parser.py"
click node_builder "https://github.com/meghanab1909/cc-project/blob/main/builder/build_engine.py"
click node_cache "https://github.com/meghanab1909/cc-project/blob/main/builder/cache.py"
click node_layer_engine "https://github.com/meghanab1909/cc-project/blob/main/builder/layer_engine.py"
click node_runtime_api "https://github.com/meghanab1909/cc-project/blob/main/runtime/runtime.py"
click node_filesystem "https://github.com/meghanab1909/cc-project/blob/main/runtime/runtime.py"
click node_isolation "https://github.com/meghanab1909/cc-project/blob/main/runtime/runtime.py"
click node_manifests "https://github.com/meghanab1909/cc-project/blob/main/utils/image_store.py"
click node_layers "https://github.com/meghanab1909/cc-project/blob/main/utils/image_store.py"
click node_cache_files "https://github.com/meghanab1909/cc-project/blob/main/utils/image_store.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_terminal toneBlue
class node_parser,node_builder,node_cache,node_layer_engine toneAmber
class node_runtime_api,node_filesystem,node_isolation toneMint
class node_manifests,node_layers,node_cache_files toneRose
class node_user toneIndigo
```

## Components

### User Interfaces

- [CLI Commands](https://github.com/meghanab1909/cc-project/blob/main/main.py): `main.py`
- [GUI Terminal](https://github.com/meghanab1909/cc-project/blob/main/docksmith.py): `docksmith.py`

### Image Build

- [Instruction Parser](https://github.com/meghanab1909/cc-project/blob/main/builder/parser.py): `builder/parser.py`
- [Build Engine](https://github.com/meghanab1909/cc-project/blob/main/builder/build_engine.py): `builder/build_engine.py`
- [Build Cache](https://github.com/meghanab1909/cc-project/blob/main/builder/cache.py): `builder/cache.py`
- [Layer Utilities](https://github.com/meghanab1909/cc-project/blob/main/builder/layer_engine.py): `builder/layer_engine.py`

### Container Runtime

- [Run Orchestration](https://github.com/meghanab1909/cc-project/blob/main/runtime/runtime.py): `runtime/runtime.py`
- [Rootfs Assembly](https://github.com/meghanab1909/cc-project/blob/main/runtime/runtime.py): `runtime/runtime.py`
- [Linux Isolation](https://github.com/meghanab1909/cc-project/blob/main/runtime/runtime.py): `runtime/runtime.py`

### Image Storage

- [Image Manifests](https://github.com/meghanab1909/cc-project/blob/main/utils/image_store.py): `utils/image_store.py`
- [Layer Archives](https://github.com/meghanab1909/cc-project/blob/main/utils/image_store.py): `utils/image_store.py`
- [Cache Records](https://github.com/meghanab1909/cc-project/blob/main/utils/image_store.py): `utils/image_store.py`

### Other components

- **Operator**

## Connections

- Operator → CLI Commands: invokes (evidence: `README.md`)
- CLI Commands → Build Engine: builds image (evidence: `main.py`)
- Build Engine → Instruction Parser: parses instructions (evidence: `builder/build_engine.py`)
- Build Engine → Build Cache: checks cache (evidence: `builder/build_engine.py`)
- Build Engine → Run Orchestration: runs build steps (evidence: `builder/build_engine.py`)
- Build Engine → Image Manifests: loads and saves (evidence: `builder/build_engine.py`)
- Build Engine → Layer Archives: writes and extracts (evidence: `builder/build_engine.py`)
- Build Engine → Cache Records: stores cache (evidence: `builder/build_engine.py`)
- CLI Commands → Image Manifests: lists and removes (evidence: `main.py`)
- CLI Commands → Run Orchestration: runs container (evidence: `main.py`)
- Run Orchestration → Image Manifests: loads image (evidence: `runtime/runtime.py`)
- Run Orchestration → Rootfs Assembly: assembles rootfs (evidence: `runtime/runtime.py`)
- Rootfs Assembly → Layer Archives: extracts layers (evidence: `runtime/runtime.py`)
- Run Orchestration → Linux Isolation: executes command (evidence: `runtime/runtime.py`)
- Build Engine → Layer Utilities: uses utilities (evidence: `builder/build_engine.py`)
