diff --git a/README.md b/README.md index 3f78814e..87d21140 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ REST API Endpoints documentation is available on https://linagora.github.io/ToM- [Matrix specification](https://spec.matrix.org/latest/server-server-api/#server-discovery) * [@twake/retry-promise](packages/retry-promise): simple module extending javascript Promise with retry strategy +## Target architecture + +![target architecture](./docs/arch.png) + ## Twake-Chat docker This repository provides a docker image. Here are the environment variables: diff --git a/docs/arch.dot b/docs/arch.dot new file mode 100644 index 00000000..bed39357 --- /dev/null +++ b/docs/arch.dot @@ -0,0 +1,54 @@ +digraph { + nodesep=1 + subgraph cluster_external { + style=dotted + label=External + fontcolor=olivedrab3 + "External Twake-Chat" [color=olivedrab3] + "External Matrix" [color=olivedrab3] + "Client" [color=green] + } + subgraph cluster_frontends { + style=invisible + shape=doubleoctagon + margin=20 + label=frontends + color=gray50 + fontcolor=gray50 + "SSO" [color=blue,shape=box,group=frontend] + "Synapse" [color=blue,fontcolor=black,shape=box] + "Tom Server" [color=blue,fontcolor=black,shape=box] + } + subgraph cluster_db { + bgcolor="#eeeeff" + style=dashed + label=DB + fontcolor=blue + "Filesystem" [color=blue,fontcolor=blue,shape=cylinder,group=db] + "Postgres" [color=blue,fontcolor=blue,shape=cylinder,group=db] + "Redis" [color=blue,fontcolor=blue,shape=cylinder,group=db] + "LDAP" [color=blue,fontcolor=blue,shape=cylinder,group=db] + } + subgraph cluster_fede { + style=dotted + color=gray50 + fontcolor=gray50 + label=Common + "Federation Server" [color=red,shape=box,group=frontend] + } + "Client" -> "SSO" [color=red,fontcolor=red] + "Client" -> "Synapse" [color=red,fontcolor=red,label=Chat,penwidth=3] + "Client" -> "Tom Server" [color=red,fontcolor=red,label=Search,penwidth=3] + "Client" -> "Federation Server" [color=red,fontcolor=red,label=Search] + "Tom Server" -> "Postgres" [color=blue,label="Synapse + own DB",fontcolor=blue,penwidth=2] + "Tom Server" -> "LDAP" [color=blue,fontcolor=blue,label="Get user data"] + "Tom Server" -> "Redis" [color=blue,fontcolor=blue,label="Cache user data"] + "Tom Server" -> "Federation Server" [constraint=false,color=coral3,fontcolor=coral3,label="Push hashes",style=dashed] + "Tom Server" -> "Synapse" [constraint=false,color=coral3,fontcolor=red,style=dashed] + "External Matrix" -> "Synapse" [color=olivedrab3,fontcolor=olivedrab3,label=Federation] + "External Twake-Chat" -> "Synapse" [color=olivedrab3,fontcolor=olivedrab3,label=Federation] + "External Twake-Chat" -> "Federation Server" [constraint=false,color=olivedrab3,fontcolor=olivedrab3,label="Push hashes",style=dashed] + "Synapse" -> "Postgres" [color=blue,fontcolor=blue,penwidth=2] + "Synapse" -> "Filesystem" [color=blue,label="medias",fontcolor=blue,penwidth=2] + "Synapse" -> "SSO" [constraint=false,color=coral3,fontcolor=coral3,label="Validate SSO token",style=dashed] +} diff --git a/docs/arch.png b/docs/arch.png new file mode 100644 index 00000000..11485850 Binary files /dev/null and b/docs/arch.png differ diff --git a/package.json b/package.json index d62d2140..bc27765e 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,9 @@ "scripts": { "build": "npm run softClean && lerna run build", "clean": "rimraf packages/*/dist packages/*/coverage ./node_modules/.cache/nx packages/*/example/*.js*", - "doc": "node docs/swagger.cjs", + "doc": "npm run doc:swagger && npm run doc:arch", + "doc:swagger": "node docs/swagger.cjs", + "doc:arch": "dot -Tpng -o docs/arch.png docs/arch.dot", "format:check": "prettier --check .", "format:check-diff": "prettier --check $(git diff $(git rev-parse --abbrev-ref --symbolic-full-name @{u}) --name-status|grep -E '^M|A'|cut -f2)", "format:fix": "prettier --write .",