Skip to content

Commit

Permalink
Merge pull request #1819 from TryQuiet/feature/1777
Browse files Browse the repository at this point in the history
Introduction of C4 diagrams to explain architecture to new contributors
  • Loading branch information
Kacper-RF committed Sep 18, 2023
2 parents 0a71115 + 56564d6 commit 6c1212e
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
lerna-debug.log
c4/.structurizr
c4/workspace.json
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@

* Clarify autoupdate language in update modal to let users know that the app will update on restart.

* C4 for Quiet architecture. Context and Container diagrams.

* Invite tab as default in settings
28 changes: 28 additions & 0 deletions c4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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 /__PATH_TO_REPOSITORY__/c4:/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/
Binary file added c4/current/C1-Context.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added c4/current/C2-Container.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
156 changes: 156 additions & 0 deletions c4/workspace.dsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
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" "UI layer" "React Native"{
userA -> this
}

iOS = container "iOS" "UI layer" "React Native"{
userA -> this
}

androidBackgroundWorker = group "Android Background Worker" {

cpp = container "CPP" {

}

nodeJSAndroid = container "Node.js Android" {
android -> this
cpp -> this
}

notifications = container "Notifications" "Java" {
nodeJSAndroid -> this "Conntected via WebSocket"
}

}

nodeJSiOS = container "Node.js 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"
nodeJSAndroid -> this
nodeJSiOS -> 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
}
}

0 comments on commit 6c1212e

Please sign in to comment.