File size: 1,237 Bytes
906e7e8
 
 
 
 
c23bf48
906e7e8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c23bf48
 
906e7e8
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import streamlit as st
from diagrams import Cluster, Diagram
from diagrams.azure.compute import ContainerInstances
from diagrams.azure.integration import APIManagement
from diagrams.onprem.container import Docker
#from diagrams.onprem.database import Snowflake
from diagrams.programming.framework import FastAPI
from diagrams.custom import Custom

# Define the diagram
def create_diagram():
    with Diagram("Architecture Diagram", show=False):
        with Cluster("Azure"):
            container_registry = ContainerInstances("Azure Container Registry")
            container_registry_api = APIManagement("ACR API")

        with Cluster("Docker"):
            docker = Docker("Docker")
            slimbuster = Custom("Slim Buster", "./slimbuster.png")

        with Cluster("Python"):
            python = FastAPI("Python / Uvicorn")

        #with Cluster("Snowflake"):
        #    snowflake = Snowflake("Snowflake")

        container_registry >> docker >> slimbuster >> python
        container_registry_api >> docker
        python >> snowflake

    return "architecture_diagram.png"

# Create and show the diagram in Streamlit
diagram = create_diagram()
st.image(diagram, caption="Architecture Diagram", use_column_width=True)