Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from diagrams import Cluster, Diagram
|
3 |
+
from diagrams.azure.compute import ContainerInstances
|
4 |
+
from diagrams.azure.integration import APIManagement
|
5 |
+
from diagrams.onprem.container import Docker
|
6 |
+
from diagrams.onprem.database import Snowflake
|
7 |
+
from diagrams.programming.framework import FastAPI
|
8 |
+
from diagrams.custom import Custom
|
9 |
+
|
10 |
+
# Define the diagram
|
11 |
+
def create_diagram():
|
12 |
+
with Diagram("Architecture Diagram", show=False):
|
13 |
+
with Cluster("Azure"):
|
14 |
+
container_registry = ContainerInstances("Azure Container Registry")
|
15 |
+
container_registry_api = APIManagement("ACR API")
|
16 |
+
|
17 |
+
with Cluster("Docker"):
|
18 |
+
docker = Docker("Docker")
|
19 |
+
slimbuster = Custom("Slim Buster", "./slimbuster.png")
|
20 |
+
|
21 |
+
with Cluster("Python"):
|
22 |
+
python = FastAPI("Python / Uvicorn")
|
23 |
+
|
24 |
+
with Cluster("Snowflake"):
|
25 |
+
snowflake = Snowflake("Snowflake")
|
26 |
+
|
27 |
+
container_registry >> docker >> slimbuster >> python
|
28 |
+
container_registry_api >> docker
|
29 |
+
python >> snowflake
|
30 |
+
|
31 |
+
return "architecture_diagram.png"
|
32 |
+
|
33 |
+
# Create and show the diagram in Streamlit
|
34 |
+
diagram = create_diagram()
|
35 |
+
st.image(diagram, caption="Architecture Diagram", use_column_width=True)
|