componentes.puml (2069B)
1 @startuml componentes 2 title SIGA - Diagrama de Componentes 3 4 skinparam componentStyle uml2 5 6 actor "Cliente HTTP\n(curl, testes, futura UI)" as Cliente 7 8 node "Máquina única" { 9 10 component "users\n(Elixir/Phoenix, :4000)" as Users { 11 portin "POST /users\nPOST /login" as UsersApi 12 [UserController\nSessionController] as UCtrl 13 [Accounts] as UAcc 14 [Users.Auth\n(gateway)] as UGw 15 [Repo (Ecto)] as URepo 16 UsersApi --> UCtrl 17 UCtrl --> UAcc 18 UAcc --> URepo 19 UAcc --> UGw 20 } 21 22 component "event_registration\n(Zig, :16000)" as Events { 23 portin "GET /event\nGET /event/{id}\nPOST /event" as EventsApi 24 [server] as EServer 25 [auth.zig\n(gateway)] as EGw 26 [repository] as ERepo 27 EventsApi --> EServer 28 EServer --> EGw 29 EServer --> ERepo 30 } 31 32 component "auth\n(Go, localhost:8080)" as Auth { 33 portin "API interna" as AuthApi 34 [handlers] as AHandlers 35 [repository] as ARepo 36 AuthApi --> AHandlers 37 AHandlers --> ARepo 38 } 39 40 component "signups\n(Go, :8081)" as Reg { 41 portin "POST /signup\nPUT /presence\nGET /signup/{id}" as RegApi 42 [handlers] as RHandlers 43 [authenticate\neventExists\n(clientes HTTP)] as RGw 44 [repository] as RRepo 45 RegApi --> RHandlers 46 RHandlers --> RGw 47 RHandlers --> RRepo 48 } 49 50 database "users_dev.db\n(DATABASE_PATH em prod)" as UDb 51 database "events.db" as EDb 52 database "db.db\n(credentials, sessions)" as ADb 53 database "db.db\n(signups)" as RDb 54 55 URepo --> UDb 56 ERepo --> EDb 57 ARepo --> ADb 58 RRepo --> RDb 59 } 60 61 Cliente --> UsersApi : HTTP/JSON 62 Cliente --> EventsApi : HTTP/JSON\nBearer token 63 Cliente --> RegApi : HTTP/JSON\nBearer token 64 65 UGw --> AuthApi : HTTP/JSON\n(criar credencial, login) 66 EGw --> AuthApi 67 RGw --> AuthApi 68 RGw --> EventsApi : HTTP\n(consultar evento) 69 70 note right of Auth 71 Rotas: POST /credentials, POST /login, 72 POST /logout/{uuid}, GET /{uuid} 73 74 event_registration e signups chamam 75 GET /{uuid} em toda requisição 76 para validar o token. 77 78 Escuta só em localhost (ADR-005). 79 Clientes nunca acessam diretamente. 80 end note 81 82 @enduml