Code
from diagrams import Diagram, Edge, Cluster
from diagrams.aws.compute import ECS, Fargate
from diagrams.aws.network import CloudFront
from diagrams.aws.storage import S3
from diagrams.firebase import _Firebase
from diagrams.gcp.storage import GCS
# from diagrams.gcp.identity import Iam
from diagrams.aws.database import Dynamodb
# from diagrams.gcp.devtools import LLMs
from diagrams.programming.language import Nodejs
from diagrams.onprem.client import Client
# Create diagram
with Diagram("System Architecture", show=False):
= Client("User")
client
with Cluster("Frontend"):
= S3("S3 - React SPA")
s3 = CloudFront("CloudFront Distribution")
cloudfront = Nodejs("React SPA")
react_spa >> Edge(label="accesses") >> react_spa
client >> cloudfront >> react_spa
s3
with Cluster("Backend"):
= ECS("Load Balancer")
load_balancer = ECS("FastAPI (Docker)")
api = Fargate("ECS Fargate")
ecs_fargate
- ecs_fargate
api >> api
load_balancer
with Cluster("VPC"):
= GCS("Google Drive")
google_drive # google_oauth = Iam("Google OAuth")
= _Firebase("Firebase w/GCP")
firebase = Dynamodb("MongoDB")
mongo_db # llms = LLMs("LLMs (OpenAI, Anthropic)")
>> Edge(label="connects to") >> google_drive
api # api >> Edge(label="authenticates with") >> google_oauth
>> Edge(label="uses") >> firebase
api >> Edge(label="stores data in") >> mongo_db
api # api >> Edge(label="queries") >> llms