185 lines
5.7 KiB
Plaintext
185 lines
5.7 KiB
Plaintext
workspace "Events-WebApi CRUD Flow" "Structurizr model za tipični CRUD tok u WebAPI-ju" {
|
|
|
|
model {
|
|
postgres = softwareSystem "PostgreSQL" "" {
|
|
tags "Database"
|
|
}
|
|
|
|
rabbitmq = softwareSystem "RabbitMQ" "" {
|
|
tags "MessageBus"
|
|
}
|
|
|
|
eventsSystem = softwareSystem "Events-WebApi" "Rješenje za upravljanje događajima i prijavama." {
|
|
clientApp = container "ClientApp" "" "Vue 3 + Vite" {
|
|
tags "Frontend"
|
|
}
|
|
|
|
webApi = container "WebAPI" "CRUD servisi" "ASP.NET Core Web API" {
|
|
tags "API"
|
|
|
|
controller = component "Controller" "Ulazna točka za CRUD nad prijavama." "ASP.NET Core Controller" {
|
|
tags "Controller"
|
|
}
|
|
|
|
validation = component "Validation" "Validacija DTO-a i poslovnih pravila prije obrade." "MediatR Pipeline + FluentValidation" {
|
|
tags "Validation"
|
|
}
|
|
|
|
mediator = component "MediatR" "Prosljeđuje command odgovarajućem handleru." "Mediator" {
|
|
tags "Mediator"
|
|
}
|
|
|
|
handler = component "Handler" "Obrada Add/Update/Delete zahtjeva i objava događaja." "Command Handler" {
|
|
tags "Handler"
|
|
}
|
|
|
|
dbContext = component "DbContext" "EF Core pristup tablicama registration, person, event i sport." "DbContext" {
|
|
tags "DbContext"
|
|
}
|
|
|
|
publishEndpoint = component "Publisher" "Objava događaja RegistrationCreated/Updated/Deleted." "MassTransit publisher" {
|
|
tags "Publisher"
|
|
}
|
|
|
|
controller -> validation "Pokreće validaciju kroz pipeline"
|
|
validation -> mediator "Prosljeđuje valjani zahtjev"
|
|
mediator -> handler "Poziva command handler"
|
|
handler -> dbContext "Čita i zapisuje podatke"
|
|
handler -> publishEndpoint "Objavljuje događaj nakon promjene registracije"
|
|
}
|
|
|
|
clientApp -> controller "Šalje CRUD zahtjev" "JSON/HTTPS"
|
|
dbContext -> postgres "Persistira promjene" "EF Core/Npgsql"
|
|
publishEndpoint -> rabbitmq "Šalje poruku" "AMQP"
|
|
}
|
|
}
|
|
|
|
views {
|
|
component webApi "WebApiComponents" {
|
|
include clientApp
|
|
include controller
|
|
include validation
|
|
include mediator
|
|
include handler
|
|
include dbContext
|
|
include publishEndpoint
|
|
include postgres
|
|
include rabbitmq
|
|
}
|
|
|
|
dynamic webApi "CreateRegistrationFlow" "Tipični CRUD tok: kreiranje prijave za događaj" {
|
|
clientApp -> controller "Korisnik šalje prijavu za događaj"
|
|
controller -> validation "Provjera DTO-a i pravila"
|
|
validation -> mediator "Valjan zahtjev ide dalje"
|
|
mediator -> handler "Poziv AddCommand handlera"
|
|
handler -> dbContext "Spremanje registracije"
|
|
dbContext -> postgres "INSERT registration"
|
|
handler -> publishEndpoint "Objava RegistrationCreated"
|
|
publishEndpoint -> rabbitmq "Slanje događaja"
|
|
autolayout lr
|
|
}
|
|
|
|
theme default
|
|
|
|
styles {
|
|
element "Element" {
|
|
background #ffffff
|
|
color #222222
|
|
stroke #444444
|
|
fontSize 40
|
|
}
|
|
|
|
element "Frontend" {
|
|
shape WebBrowser
|
|
color #1565c0
|
|
stroke #42a5f5
|
|
strokeWidth 3
|
|
fontSize 42
|
|
}
|
|
|
|
element "API" {
|
|
shape Hexagon
|
|
color #1565c0
|
|
stroke #42a5f5
|
|
strokeWidth 3
|
|
fontSize 42
|
|
}
|
|
|
|
element "Controller" {
|
|
shape RoundedBox
|
|
color #1e88e5
|
|
stroke #64b5f6
|
|
strokeWidth 3
|
|
fontSize 40
|
|
}
|
|
|
|
element "Validation" {
|
|
shape RoundedBox
|
|
color #6a1b9a
|
|
stroke #ab47bc
|
|
strokeWidth 3
|
|
fontSize 40
|
|
}
|
|
|
|
element "Mediator" {
|
|
shape RoundedBox
|
|
color #00897b
|
|
stroke #4db6ac
|
|
strokeWidth 3
|
|
fontSize 40
|
|
}
|
|
|
|
element "Handler" {
|
|
shape RoundedBox
|
|
color #2e7d32
|
|
stroke #66bb6a
|
|
strokeWidth 3
|
|
fontSize 40
|
|
}
|
|
|
|
element "DbContext" {
|
|
shape RoundedBox
|
|
color #ef6c00
|
|
stroke #ffb74d
|
|
strokeWidth 3
|
|
fontSize 40
|
|
}
|
|
|
|
element "Publisher" {
|
|
shape RoundedBox
|
|
color #5d4037
|
|
stroke #a1887f
|
|
strokeWidth 3
|
|
fontSize 40
|
|
}
|
|
|
|
element "Database" {
|
|
shape Cylinder
|
|
color #1565c0
|
|
stroke #42a5f5
|
|
strokeWidth 3
|
|
fontSize 40
|
|
description false
|
|
}
|
|
|
|
element "MessageBus" {
|
|
shape Pipe
|
|
background #fff8e1
|
|
color #8d6e63
|
|
stroke #ff9800
|
|
strokeWidth 3
|
|
width 760
|
|
height 140
|
|
fontSize 40
|
|
description false
|
|
}
|
|
|
|
relationship "Relationship" {
|
|
color #666666
|
|
thickness 2
|
|
fontSize 36
|
|
}
|
|
}
|
|
}
|
|
}
|