diff --git a/.gitignore b/.gitignore index fc30407b99..8b22c51fd9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ node_modules lerna-debug.log +c4/.structurizr +c4/workspace.json diff --git a/c4/README.md b/c4/README.md new file mode 100644 index 0000000000..78f3401e5b --- /dev/null +++ b/c4/README.md @@ -0,0 +1,23 @@ +# Quiet C4 Diagrams + +Quiet architecture presented on C4 diagrams. Currently it uses 2 diagrams - Context and Container. +Made in Structurzir +Current views saved in `/current` + +## Run locally + +1. Make sure you have Docker installed +2. Run command in terminal: ```docker pull structurizr/lite``` +3. Run docker container inside your Quiet directory and choosen porsts, example : ```docker run -it --rm -p 8080:8080 -v /home/kacper/development/quiet:/usr/local/structurizr structurizr/lite``` +4. Open `http://localhost:8080/` + +## Editing + +Everything is in file `workspace.dsl` +After change, save file and reload page. +Highly recommend extenstions for VSC: C4 DSL Extension and Structurizr. + +## Docs + +https://c4model.com/ +https://docs.structurizr.com/ diff --git a/c4/current/C1-Context.png b/c4/current/C1-Context.png new file mode 100644 index 0000000000..aa018f8f76 Binary files /dev/null and b/c4/current/C1-Context.png differ diff --git a/c4/current/C2-Container.png b/c4/current/C2-Container.png new file mode 100644 index 0000000000..3a57192bc3 Binary files /dev/null and b/c4/current/C2-Container.png differ diff --git a/c4/workspace.dsl b/c4/workspace.dsl new file mode 100644 index 0000000000..a1e1f57003 --- /dev/null +++ b/c4/workspace.dsl @@ -0,0 +1,159 @@ +workspace { + + model { + + properties { + "structurizr.groupSeparator" "/" + } + + userA = person "User A" "Owner of Quiet community" + userB = person "User B" "Member of Quiet community" + userC = person "User C" "Member of Quiet community" + userD = person "User D" "Member of Quiet community" + + quietB = softwareSystem "Quiet App B" "Linux/MacOS/Windows/Android/iOS" { + userB -> this + } + + quietC = softwareSystem "Quiet App C" "Linux/MacOS/Windows/Android/iOS" { + userC -> this + } + + quietD = softwareSystem "Quiet App D" "Linux/MacOS/Windows/Android/iOS" { + userD -> this "One peer is enough for replicating all data" + } + + quietA = softwareSystem "Quiet App" "Linux/MacOS/Windows/Android/iOS" { + + desktops = group "Desktop Apps" { + + linux = container "Linux" "React & Electron" { + userA -> this + } + + macOS = container "MacOS" "React & Electron" { + userA -> this + } + + windows = container "Windows" "React & Electron" { + userA -> this + } + } + + mobiles = group "Mobiles" { + + android = container "Android" "React Native - UI" "xd"{ + userA -> this + } + + iOS = container "iOS" "React Native - UI"{ + userA -> this + } + + androidWorker = group "Android Worker" { + + cpp = container "CPP" { + + } + + nodeAndroid = container "Node Android" { + android -> this + cpp -> this + } + + notifications = container "Notifications" "Java" { + nodeAndroid -> this + } + + } + + iOSWorker = group "iOS Worker" { + + nodeiOS = container "Node iOS" { + iOS -> this + } + + } + + } + + stateManager = container "State Manager" "Redux Toolkit & Redux Saga" { + linux -> this + macOS -> this + windows -> this + android -> this + iOS -> this + } + + + backend = group "Backend" { + + nest = container "Nest JS" "Connection Manager as a core mediator between other services" { + stateManager -> this "Conntected via Socket IO" + nodeAndroid -> this "Conntected via Socket IO" + nodeiOS -> this + } + + reigstration = container "Registration Service" { + nest -> this + } + + levelDB = container "levelDB" "local database" { + nest -> this + } + + storage = group "Storage" { + + orbitDB = container "orbitDB" { + nest -> this + } + + ipfs = container "IPFS" { + orbitDB -> this + } + + libp2p = container "libp2p"{ + ipfs -> this + } + + } + + } + + tor = container "Tor"{ + nest -> this + } + + } + + + quietA -> quietB + quietA -> quietC + + quietB -> quietA + quietB -> quietC + + quietC -> quietA + quietC -> quietB + + quietD -> quietA + quietA -> quietD + + } + + + views { + systemLandscape { + include * + autolayout + } + + container quietA { + include * + autolayout + } + + + theme default + } +} \ No newline at end of file