From 60ce90b633f5539e9df625e075a5ff8bf87bf98d Mon Sep 17 00:00:00 2001 From: Adrien Date: Sat, 6 Jan 2024 17:45:58 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Add=20C4=20Container=20diagram?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 54 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index b1d0601..781fb3d 100644 --- a/README.md +++ b/README.md @@ -5,29 +5,45 @@ [![Presentation](medias/presentation.png)](medias/presentation.mp4) ```plantuml @startuml -!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml +!include -AddElementTag("v1.0", $borderColor="#d73027") -AddElementTag("v1.1", $fontColor="#d73027") -AddElementTag("backup", $fontColor="orange") +!define ICONURL https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/v2.4.0 +!includeurl ICONURL/common.puml -AddRelTag("backup", $textColor="orange", $lineColor="orange", $lineStyle = DashedLine()) +!includeurl ICONURL/font-awesome-5/users.puml +!includeurl ICONURL/devicons2/redis.puml +!includeurl ICONURL/devicons2/sqlalchemy.puml +!includeurl ICONURL/devicons2/postgresql.puml -Person(user, "Customer", "People that need products") -Person(admin, "Administrator", "People that administrates the products via the new v1.1 components", $tags="v1.1") -Container(spa, "SPA", "angular", "The main interface that the customer interacts with via v1.0", $tags="v1.0") -Container(spaAdmin, "Admin SPA", "angular", "The administrator interface that the customer interacts with via new v1.1", $tags="v1.1") -Container(api, "API", "java", "Handles all business logic (incl. new v1.1 extensions)", $tags="v1.0+v1.1") -ContainerDb(db, "Database", "Microsoft SQL", "Holds product, order and invoice information") -Container(archive, "Archive", "Audit logging", "Stores 5 years", $tags="backup") +title Carrramba-encore-rate - Back-end -Rel(user, spa, "Uses", "https") -Rel(spa, api, "Uses", "https") -Rel_R(api, db, "Reads/Writes") -Rel(admin, spaAdmin, "Uses", "https") -Rel(spaAdmin, api, "Uses", "https") -Rel_L(api, archive, "Writes", "messages", $tags="backup") +LAYOUT_WITH_LEGEND() -SHOW_LEGEND() +Person(user, "User", "The service user", $sprite="users") + +System_Boundary(cb1, "carrramba-encore-rate") { + Container(app, "SPA", "SolidJS", "The graphical interface used by users to consume services provided") + Container(api, "carrramba-encore-rate-api", "FastAPI / SQLAlchemy", "Provides the functionalities serving API endpoints", $sprite="sqlalchemy") + ContainerDb(db, "Postgres", "PostgreSQL database", "Stores stops/stop areas/lines/shapes and associations information.", $sprite="postgresql") + ContainerDb(cache, "In-Memory cache", "Redis", "Store previously computed results (stop, line, destination, next passages, shapes).", $sprite="redis") + + Container(db_updater, "db-updater", "Sync the service static data with the IDFM ones") +} + +System_Boundary(idfm, "IDFM") { + Container_Ext(static_, "Static data") + Container_Ext(dynamic_, "Dynamic data") +} + +Rel(user, app, "Uses") + +Rel(app, api, "Uses", "JSON/HTTPS") + +Rel_R(api, db, "Reads from", "sync, PSQL") +Rel_L(api, cache, "Reads from and writes to", "sync, REdis Serialization Protocol") +Rel(api, dynamic_, "Get next passages", "JSON/HTTPS") + +Rel_L(db_updater, db, "Writes to", "sync, PSQL") +Rel(db_updater, static_, "Get stops, lines andshapes") @enduml ```