diff --git a/client/.madgerc b/client/.madgerc
new file mode 100644
index 000000000..4425cb8ef
--- /dev/null
+++ b/client/.madgerc
@@ -0,0 +1,18 @@
+{
+ "fontSize": "10px",
+ "tsconfig": "tsconfig.json",
+ "fileExtensions": ["ts", "tsx", "js", "jsx"],
+ "backgroundColor": "#FFFFFF",
+ "textColor": "#FFFFFF",
+ "nodeColor": "black",
+ "noDependencyColor": "green",
+ "cyclicNodeColor": "red",
+ "edgeColor": "green",
+ "graphVizOptions": {
+ "G": {
+ "rankdir": "TB",
+ "layout": "neato",
+ "splines": "curved"
+ }
+ }
+}
\ No newline at end of file
diff --git a/client/package.json b/client/package.json
index e007508f9..7e715d2d8 100644
--- a/client/package.json
+++ b/client/package.json
@@ -20,7 +20,8 @@
"configapp": "script/config.bash",
"start": "script/start.bash",
"clean": "script/clean.bash",
- "format": "prettier --ignore-path ../.gitignore --write \"**/*.{ts,tsx,css,scss}\""
+ "format": "prettier --ignore-path ../.gitignore --write \"**/*.{ts,tsx,css,scss}\"",
+ "graph": "script/graph.bash"
},
"eslintConfig": {
"extends": [
diff --git a/client/script/clean.bash b/client/script/clean.bash
index 04e7279ef..222a856e8 100755
--- a/client/script/clean.bash
+++ b/client/script/clean.bash
@@ -1,2 +1,3 @@
#!/bin/bash
-rm -rf build/ node_modules/ coverage/ playwright-report/
\ No newline at end of file
+rm -rf build/ node_modules/ coverage/ playwright-report/
+rm src.svg test.svg
\ No newline at end of file
diff --git a/client/script/graph.bash b/client/script/graph.bash
new file mode 100755
index 000000000..01ac33756
--- /dev/null
+++ b/client/script/graph.bash
@@ -0,0 +1,9 @@
+#!/bin/bash
+PATH="$(yarn bin):$PATH"
+export PATH
+printf "Generate dependency graph for code"
+
+madge --image src.svg src
+madge --image test.svg test
+#eval madge --image src.svg "$TS_CONFIG" "$EXTENSIONS" src
+#madge --image test.svg --ts-config tsconfig.json --extensions ts,tsx test
\ No newline at end of file
diff --git a/docs/developer/client/client.md b/docs/developer/client/client.md
index 5c961606e..b2993bc27 100644
--- a/docs/developer/client/client.md
+++ b/docs/developer/client/client.md
@@ -3,3 +3,7 @@
The [Website](https://github.com/INTO-CPS-Association/DTaaS/tree/feature/distributed-demo/client#readme)
is how the end-users interact with the software platform. The website is
being developed as a React single page web application.
+
+A dependency graph for the entire codebase of the react application is:
+
+![React website dependency graph](client-dep-graph.svg)
diff --git a/docs/developer/client/src.svg b/docs/developer/client/src.svg
new file mode 100644
index 000000000..f7bbcfa16
--- /dev/null
+++ b/docs/developer/client/src.svg
@@ -0,0 +1,565 @@
+
+
+
+
+
diff --git a/docs/developer/client/test.svg b/docs/developer/client/test.svg
new file mode 100644
index 000000000..e651b2c84
--- /dev/null
+++ b/docs/developer/client/test.svg
@@ -0,0 +1,607 @@
+
+
+
+
+
diff --git a/docs/developer/servers/lib/src-dep-graph.svg b/docs/developer/servers/lib/src-dep-graph.svg
new file mode 100644
index 000000000..546c00137
--- /dev/null
+++ b/docs/developer/servers/lib/src-dep-graph.svg
@@ -0,0 +1,193 @@
+
+
+
+
+
diff --git a/script/env.sh b/script/env.sh
index 12185469e..8c853701a 100755
--- a/script/env.sh
+++ b/script/env.sh
@@ -84,4 +84,8 @@ sudo -H pip3 install mkdocs-with-pdf
sudo -H pip3 install qrcode
# Install markdownlint
-sudo gem install mdl
\ No newline at end of file
+sudo gem install mdl
+
+# Install madge for generating dependency graphs of typescript projects
+sudo apt-get install graphviz
+sudo npm install -g madge
\ No newline at end of file
diff --git a/servers/execution/runner/package.json b/servers/execution/runner/package.json
index df040d334..d753356d1 100644
--- a/servers/execution/runner/package.json
+++ b/servers/execution/runner/package.json
@@ -16,7 +16,8 @@
"syntax": "script/syntax.bash",
"test": "script/test.bash",
"test:nocov": "script/test.bash nocoverage",
- "test:watchAll": "script/test.bash watchAll"
+ "test:watchAll": "script/test.bash watchAll",
+ "graph": "script/graph.bash"
},
"bin": {
"runner": "./dist/src/main.js"
diff --git a/servers/execution/runner/script/clean.bash b/servers/execution/runner/script/clean.bash
index d5c466b7d..e2b62928a 100755
--- a/servers/execution/runner/script/clean.bash
+++ b/servers/execution/runner/script/clean.bash
@@ -1,2 +1,3 @@
#!/bin/bash
-rm -rf build node_modules coverage dist
\ No newline at end of file
+rm -rf build node_modules coverage dist
+rm src.svg test.svg
\ No newline at end of file
diff --git a/servers/execution/runner/script/graph.bash b/servers/execution/runner/script/graph.bash
new file mode 100755
index 000000000..af6695dc1
--- /dev/null
+++ b/servers/execution/runner/script/graph.bash
@@ -0,0 +1,6 @@
+#!/bin/bash
+PATH="$(yarn bin):$PATH"
+export PATH
+printf "Generate graph for source code"
+madge --image src.svg --ts-config tsconfig.json --extensions ts,tsx src
+madge --image test.svg --ts-config tsconfig.json --extensions ts,tsx test
\ No newline at end of file
diff --git a/servers/lib/package.json b/servers/lib/package.json
index 1d1d70972..2592e3e41 100644
--- a/servers/lib/package.json
+++ b/servers/lib/package.json
@@ -13,7 +13,8 @@
"clean": "script/clean.bash",
"start": "script/start.bash",
"syntax": "script/syntax.bash",
- "test": "script/test.bash"
+ "test": "script/test.bash",
+ "graph": "script/graph.bash"
},
"dependencies": {
"@apollo/client": "^3.7.10",
diff --git a/servers/lib/script/clean.bash b/servers/lib/script/clean.bash
index d5c466b7d..e2b62928a 100755
--- a/servers/lib/script/clean.bash
+++ b/servers/lib/script/clean.bash
@@ -1,2 +1,3 @@
#!/bin/bash
-rm -rf build node_modules coverage dist
\ No newline at end of file
+rm -rf build node_modules coverage dist
+rm src.svg test.svg
\ No newline at end of file
diff --git a/servers/lib/script/graph.bash b/servers/lib/script/graph.bash
new file mode 100755
index 000000000..af6695dc1
--- /dev/null
+++ b/servers/lib/script/graph.bash
@@ -0,0 +1,6 @@
+#!/bin/bash
+PATH="$(yarn bin):$PATH"
+export PATH
+printf "Generate graph for source code"
+madge --image src.svg --ts-config tsconfig.json --extensions ts,tsx src
+madge --image test.svg --ts-config tsconfig.json --extensions ts,tsx test
\ No newline at end of file