-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8a25f3
commit cc84619
Showing
4 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Documentations | ||
This directory | ||
# Precondition | ||
- Python 3.6 >= | ||
- [Graphviz](https://graphviz.gitlab.io/download/) | ||
- [Diagrams](https://diagrams.mingrammer.com/docs/getting-started/installation#quick-start) | ||
|
||
# Generate the network diagram | ||
|
||
## Install Diagram | ||
1. Install [Graphviz](https://graphviz.gitlab.io/download/) | ||
1. Install [Diagrams](https://diagrams.mingrammer.com/docs/getting-started/installation#quick-start) | ||
|
||
## Generate Image | ||
2. Run `phthon diagram.py` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# diagram.py | ||
from diagrams import Cluster, Diagram, Edge | ||
from diagrams.onprem.compute import Server | ||
from diagrams.onprem.database import Postgresql | ||
from diagrams.onprem.vcs import Github | ||
from diagrams.generic.device import Mobile, Tablet | ||
from diagrams.onprem.client import Users | ||
from diagrams.aws.iot import IotCertificate | ||
|
||
spbase_attr = { | ||
"bgcolor": "lightgreen" | ||
} | ||
|
||
with Diagram("Flamingo Service Architecture", filename="diagram", show=False): | ||
tablet = Tablet("Tablet users") | ||
mobile = Mobile("Mobile users") | ||
github = Github("Repository") | ||
with Cluster("Render"): | ||
frontend = Server("Frontend (React)") | ||
backend = Server("Backend (Go)") | ||
render = frontend - backend | ||
with Cluster("Superbase", graph_attr=spbase_attr): | ||
database = Postgresql("Database") | ||
auth = IotCertificate("Auth") | ||
sbase = [database, auth] | ||
|
||
backend >> database | ||
backend >> Edge(label="Authentication (Google)") >> auth | ||
frontend >> Edge(label="Authentication (Google)") >> auth | ||
github >> Edge(label="Deploy") >> render | ||
tablet >> frontend | ||
mobile >> frontend |