diff --git a/docs/design.md b/docs/design.md new file mode 100644 index 0000000..0511e1a --- /dev/null +++ b/docs/design.md @@ -0,0 +1,86 @@ +--- +title: Design +--- + +## Architectural Overview + +This chapter contains the technical documentation for the design. + +The Development Environment Manager (DEM) provides an abstraction layer for the Development +Platform, which encompasses a collection of available resources, such as registries, catalogs, +container engines, and more. The modules that compose the platform form the core of the DEM. + +The DEM implements commands that can interact with the platform. These commands can be executed +using the command line interface (CLI). Additionally, some commands utilize a Text-based User +Interface (TUI) that can be presented on the user's terminal. + +![dem_architecture](wp-content/dem_architecture.png){: .center} + +The CLI can communicate with the platform in two ways: + +1. Over the Platform API, which can be achieved by instantiating the DevEnvLocalSetup class. +2. By registering a UserOutput class, which is used by the core modules to interact with the user. + +## Core Components + +The dependency graph of the core modules is illustrated below: + +![dependency_graph](wp-content/core_module_dependency_graph.png) + +As shown in the diagram, the platform module depends on the rest of the resources. This concept +allows for the creation of a unified interface for all internal resources. + +The relationships between classes in the core modules can be observed in the +[Core Class Diagram](wp-content/core_class_diagram.png). + +## Third-party Modules + +### Typer +This module is used to create a framework for the CLI commands. You can add a new command by +extending the list of functions in the main.py file and applying the @typer_cli.command() decorator. + +### Rich +Rich is a Python library used for formatting text with colors and styles, displaying advanced +content like tables, markdown, and syntax-highlighted code. +DEM employs this module to present information to the user in the command line. + +### Requests +Requests is an HTTP library for Python. + +### Readchar +This module can be used to capture character inputs. In cases where the Rich module is not suitable, +Readchar is a useful tool for obtaining user input. + +For instance, when the Rich module occupies the entire terminal for a TUI panel, Readchar can be +used to capture navigation input by reading individual characters. + +### Docker +Docker is used to communicate directly with the Docker Engine. (The Docker CLI is not utilized.) + +## Command setup + +The commands can interact with the Platform by instantiating the DevEnvLocalSetup class, which +should provide all the necessary functionality from the core modules. + +For a detailed description of the functionality of each command, please refer to the Commands +chapter. In this section, we provide flowcharts to describe the execution logic. + +- [add-cat](wp-content/flowcharts/add-cat.png) +- [add-reg](wp-content/flowcharts/add-reg.png) +- [create](wp-content/flowcharts/create.png) +- [delete](wp-content/flowcharts/delete.png) +- [del-reg](wp-content/flowcharts/del-reg.png) +- [info](wp-content/flowcharts/info.png) +- [init (without assigned dev env)](wp-content/flowcharts/init_without_assigned_dev_env.png) +- [init (with assigned dev env)](wp-content/flowcharts/init_with_assigned_dev_env.png) +- [list](wp-content/flowcharts/list.png) +- [modify](wp-content/flowcharts/modify.png) +- [uninstall](wp-content/flowcharts/uninstall.png) +- [add-host](wp-content/flowcharts/add-host.png) +- [clone](wp-content/flowcharts/clone.png) +- [del-cat](wp-content/flowcharts/del-cat.png) +- [del-host](wp-content/flowcharts/del-host.png) +- [export](wp-content/flowcharts/export.png) +- [install](wp-content/flowcharts/install.png) +- [load](wp-content/flowcharts/load.png) +- [rename](wp-content/flowcharts/rename.png) \ No newline at end of file diff --git a/docs/wp-content/core_class_diagram.png b/docs/wp-content/core_class_diagram.png new file mode 100644 index 0000000..6ac5d2b Binary files /dev/null and b/docs/wp-content/core_class_diagram.png differ diff --git a/docs/wp-content/core_module_dependency_graph.png b/docs/wp-content/core_module_dependency_graph.png new file mode 100644 index 0000000..3cef62b Binary files /dev/null and b/docs/wp-content/core_module_dependency_graph.png differ diff --git a/docs/wp-content/dem_architecture.png b/docs/wp-content/dem_architecture.png new file mode 100644 index 0000000..c0becde Binary files /dev/null and b/docs/wp-content/dem_architecture.png differ diff --git a/docs/wp-content/flowcharts/add-cat.png b/docs/wp-content/flowcharts/add-cat.png new file mode 100644 index 0000000..68a22a2 Binary files /dev/null and b/docs/wp-content/flowcharts/add-cat.png differ diff --git a/docs/wp-content/flowcharts/add-host.png b/docs/wp-content/flowcharts/add-host.png new file mode 100644 index 0000000..07bb707 Binary files /dev/null and b/docs/wp-content/flowcharts/add-host.png differ diff --git a/docs/wp-content/flowcharts/add-reg.png b/docs/wp-content/flowcharts/add-reg.png new file mode 100644 index 0000000..5b522f9 Binary files /dev/null and b/docs/wp-content/flowcharts/add-reg.png differ diff --git a/docs/wp-content/flowcharts/clone.png b/docs/wp-content/flowcharts/clone.png new file mode 100644 index 0000000..642564a Binary files /dev/null and b/docs/wp-content/flowcharts/clone.png differ diff --git a/docs/wp-content/flowcharts/create.png b/docs/wp-content/flowcharts/create.png new file mode 100644 index 0000000..221cf7c Binary files /dev/null and b/docs/wp-content/flowcharts/create.png differ diff --git a/docs/wp-content/flowcharts/del-cat.png b/docs/wp-content/flowcharts/del-cat.png new file mode 100644 index 0000000..46c761c Binary files /dev/null and b/docs/wp-content/flowcharts/del-cat.png differ diff --git a/docs/wp-content/flowcharts/del-host.png b/docs/wp-content/flowcharts/del-host.png new file mode 100644 index 0000000..2ecf85d Binary files /dev/null and b/docs/wp-content/flowcharts/del-host.png differ diff --git a/docs/wp-content/flowcharts/del-reg.png b/docs/wp-content/flowcharts/del-reg.png new file mode 100644 index 0000000..c118137 Binary files /dev/null and b/docs/wp-content/flowcharts/del-reg.png differ diff --git a/docs/wp-content/flowcharts/delete.png b/docs/wp-content/flowcharts/delete.png new file mode 100644 index 0000000..1ed242a Binary files /dev/null and b/docs/wp-content/flowcharts/delete.png differ diff --git a/docs/wp-content/flowcharts/export.png b/docs/wp-content/flowcharts/export.png new file mode 100644 index 0000000..babf587 Binary files /dev/null and b/docs/wp-content/flowcharts/export.png differ diff --git a/docs/wp-content/flowcharts/info.png b/docs/wp-content/flowcharts/info.png new file mode 100644 index 0000000..f9ecd2c Binary files /dev/null and b/docs/wp-content/flowcharts/info.png differ diff --git a/docs/wp-content/flowcharts/init_with_assigned_dev_env.png b/docs/wp-content/flowcharts/init_with_assigned_dev_env.png new file mode 100644 index 0000000..a395e6f Binary files /dev/null and b/docs/wp-content/flowcharts/init_with_assigned_dev_env.png differ diff --git a/docs/wp-content/flowcharts/init_without_assigned_dev_env.png b/docs/wp-content/flowcharts/init_without_assigned_dev_env.png new file mode 100644 index 0000000..c197946 Binary files /dev/null and b/docs/wp-content/flowcharts/init_without_assigned_dev_env.png differ diff --git a/docs/wp-content/flowcharts/install.png b/docs/wp-content/flowcharts/install.png new file mode 100644 index 0000000..de2f114 Binary files /dev/null and b/docs/wp-content/flowcharts/install.png differ diff --git a/docs/wp-content/flowcharts/list.png b/docs/wp-content/flowcharts/list.png new file mode 100644 index 0000000..cd8fcd9 Binary files /dev/null and b/docs/wp-content/flowcharts/list.png differ diff --git a/docs/wp-content/flowcharts/load.png b/docs/wp-content/flowcharts/load.png new file mode 100644 index 0000000..86986d7 Binary files /dev/null and b/docs/wp-content/flowcharts/load.png differ diff --git a/docs/wp-content/flowcharts/modify.png b/docs/wp-content/flowcharts/modify.png new file mode 100644 index 0000000..3d9a563 Binary files /dev/null and b/docs/wp-content/flowcharts/modify.png differ diff --git a/docs/wp-content/flowcharts/rename.png b/docs/wp-content/flowcharts/rename.png new file mode 100644 index 0000000..6233830 Binary files /dev/null and b/docs/wp-content/flowcharts/rename.png differ diff --git a/docs/wp-content/flowcharts/uninstall.png b/docs/wp-content/flowcharts/uninstall.png new file mode 100644 index 0000000..b72c681 Binary files /dev/null and b/docs/wp-content/flowcharts/uninstall.png differ diff --git a/mkdocs.yml b/mkdocs.yml index a1ca1a4..b53fb08 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -78,4 +78,5 @@ nav: - 'index.md' - 'installation.md' - 'development_environments.md' - - 'commands.md' \ No newline at end of file + - 'commands.md' + - 'design.md' \ No newline at end of file