# D1 Diagrams
## Sec 3.2 Use Case Analysis
GoogleDoc Link: [3.2 Use Case Analysis](https://docs.google.com/document/d/1PYZq8NVXlprOqfM3DefIPuxDl5Qjilrh9eMaM8wffCg/edit#heading=h.21ddyutzr0a)
### DEC112 Onboarding with ID Austria
```plantuml
@startuml
actor "User\n(DEC112 app)" as client
participant "Registration API" as api
participant "ID Austria\nPlugin" as ida
participant "SIP Service" as kamailio
collections "Identity Provider\nA-Trust" as atrust
client -> client: create DID
client -> api: request new user
api -> ida: forward request
api <-- ida: OIDC URL
client <-- api: OIDC URL
client -> atrust: authenticate
atrust -> ida: confirm authentication
ida -> api: confirm identity
api -> kamailio: create SIP credentials
api -> client: provide SIP credentials
@enduml
```
### Silent Emergency Notification from Sphereon Wallet
```plantuml
@startuml
actor "User\n(Sphereon Wallet)" as wallet
actor "User\n(Web UI)" as web
collections "Issuer\n(OwnYourData)" as issuer
participant "Registration API\n(DEC112)" as regapi
collections "Identity Provider\nA-Trust" as atrust
wallet -> wallet: create DID
wallet -> issuer: request Silent Emergency Notification credential
issuer -> regapi: request new user
issuer <-- regapi: OIDC URL
issuer --> web: redirect OIDC URL
web -> atrust: authenticate
atrust -> regapi: confirm identity
regapi -> web: provide SIP credentials
web -> wallet: Verifiable Credential\nfor Silent Emergency\nNotification
@enduml
```
### ChatGPT based Chatbot and Data Sharing
```plantuml
@startuml
skinparam sequenceMessageAlign direction
actor "User\n(DEC112 App)" as user
participant "SIP\nService" as sip
participant "NG Core\nServices" as core
participant "ChatGPT based\nChatbot" as chatbot
collections "Emergency Service\nProvider" as org
== Training Chat ==
user -> sip: setup test chat
sip -> core: routing
core -> chatbot: establish connection
group Conversation
chatbot -> user: questions
user -> chatbot: responses
end
chatbot -> user: request data-sharing consent
chatbot <-- user: confirm/deny
chatbot -> chatbot: persist conversation\nupon confirmation
== Data Sharing ==
chatbot -> org: establish\nData Agreement
chatbot <--> org: sign\nData Agreement
chatbot -> org: share cconversations@enduml
@enduml
```
### DID Rotation
```plantuml
@startuml
hide empty description
[*] -right-> v1
state "original\nDID" as v1
v1: version: 1
note top of v1
Step 0:
existing DID with
method: did:oyd
end note
v1 -down-> v2
state "new DID" as v2
v2: version: 2
note left of v2
Step 1:
create new DID with
method: did:ebsi
end note
v1 -right-> v1a
v2 -up-> v1a
state "updated\noriginal DID" as v1a
v1a: version: 1'
note top of v1a
Step 2:
update original DID with
alsoKnownAs from new DID v2
end note
note right of v1a
Step 3:
deactivate updated
original DID
end note
v1a -down-> v2a
v2 -right-> v2a
state "updated\nnew DID" as v2a
v2a: version: 2'
note right of v2a
Step 4:
update new DID with
alsoKnownAs from original DID
and proof of deactivation
end note
v2a -right-> [*]
@enduml
```
## Section 5.1 Software Modules
Google Doc Link: [Section 5.1 Software Modules](https://docs.google.com/document/d/1PYZq8NVXlprOqfM3DefIPuxDl5Qjilrh9eMaM8wffCg/edit#heading=h.2grqrue)
#### Notation
```plantuml
@startuml "architecture"
rectangle a
rectangle b
a -right-> b
note right
a sends information to b / a triggers action in b
end note
@enduml
```
```plantuml
@startuml "architecture"
rectangle a
rectangle b
a .right-> b
note right
a provides information to b (upon query from b)
end note
@enduml
```
### Registration API
```plantuml
@startuml "architecture"
skinparam NoteBackgroundColor APPLICATION
skinparam NoteBorderColor black
skinparam BackgroundColor transparent
rectangle "DEC112" {
component "DEC112 App" as app {
component "DEC112 SDK" as dec_sdk #cyan
component "Registration SDK" as reg_sdk #cyan
database "local" as app_db #cyan
reg_sdk -left-> app_db
dec_sdk .right-> app_db
}
component "DEC112 SIP Proxy" as proxy #cyan
database "Kamailio" as db #cyan
proxy <.- db
dec_sdk -down-> proxy
}
rectangle "DID Repository" {
component "Trust Registry" as semcon
}
rectangle "ID Provider" {
component "ID Austria" as id
}
rectangle "SMS Provider" {
component "SMS" as smsc
}
rectangle RegAPI as regapi #lightgreen {
rectangle "REST Endpoint" {
component "api" as rest
}
rectangle "IDA Service" {
component "gov id" as identity
}
rectangle "SMS Service" {
component "sms" as sms
}
rectangle "SIP Service" {
component "sip" as kamailio {
}
}
component "Redis" as redis {
component "hashmap\nstorage" as storage
component "publish/\nsubscribe" as pubsub
}
}
reg_sdk <-down-> rest
rest -down-> redis
kamailio <-down-> redis
kamailio -> db
sms <-down-> redis
sms -down-> smsc
app <-left- smsc
identity <-down-> redis
identity <.up- id
semcon .left-> reg_sdk
semcon .down-> regapi
@enduml
```
### Wallet
```plantuml
@startuml "architecture"
rectangle "DID Repository" {
rectangle "Trust Registry" as semcon
}
rectangle "Sphereon Wallet" {
component "SSI SDK Crypto Extensions" as crypto {
component "did:oyd Resolver" as resolver #lightgreen
component "did:oyd Provider" as provider #lightgreen
}
component "SSI Mobile Wallet" as wallet {
component "Agent" as agent #lightgreen
component "DEC112 SDK" as dec #cyan
database "local" as db
}
agent <-down-> resolver
agent <-down-> provider
agent -right-> db
agent <.right- db
db .right.> dec
}
rectangle "RegAPI" #lightgreen {
component "REST Endpoint" as regapi
}
rectangle "Issuer" #lightgreen {
component "Verifiable Credential" as vc
}
rectangle "ID Provider" {
component "ID Austria" as id
}
rectangle "DEC112" {
component "DEC112 SIP Proxy" as sip_proxy #cyan
database "Kamailio" as kamailio #cyan
sip_proxy <.. kamailio
}
regapi <-right. id
regapi -> vc
vc -down-> agent
dec -right-> sip_proxy
regapi -down-> kamailio
semcon .right.> vc
semcon .right.> provider
semcon .right.> resolver
@enduml
```
### Chatbot
```plantuml
@startuml
rectangle "Application" {
rectangle "DEC112 App" as decapp
}
rectangle "DID Repository" {
rectangle "Trust Registry" as semcon
}
rectangle "Chatbot" #lightgreen {
component "Semantic Container" {
component "DEC112 Endpoint" as endpoint
component "Chatbot Service" as chat_srv
database "storage" as db
}
endpoint -> chat_srv
chat_srv -> db
chat_srv <.right- db
}
rectangle "OpenAI" {
component "ChatGPT API" as chatgpt
}
rectangle "Emergency Service Provider" {
rectangle "Training" as org
}
decapp --> endpoint
chat_srv <.- chatgpt
chat_srv -down-> org
semcon .left-> decapp
semcon .-> org
@enduml
```
### did:oyd Method
```plantuml
@startuml
rectangle "OYDID Tools" {
component "command line" as cmd
component "Ruby Gem" as gem #cyan
component "npm package" as npm #lightgreen
cmd -down-> gem
}
rectangle "OYDID Repository / Trust Registry" {
component "Semantic Container" as oydid_semcon #cyan {
component "REST Endpoint" as api #lightgreen
database "did:oyd Trust\nRegistry" as db
api -right-> db
api <-right. db
}
}
gem .right-> api
npm .right-> api
rectangle "SOyA Ecosystem" {
component "Repository" as soya_semcon #cyan {
component "REST Endpoint" as soya_api
database "Data Model\nRegistry" as soya_db
soya_api -right-> soya_db
soya_api <.right- soya_db
}
component "Tools" as soya_tool {
component "Web CLI" as soya_web
component "command line" as soya_cmd
component "npm package" as soya_npm
}
soya_web .-> soya_api
soya_web -down-> soya_npm
soya_cmd -down-> soya_npm
}
rectangle "Uniresolver.io" as uniresolver {
component "did:oyd Resolver" as resolver #cyan
}
rectangle "Uniregistrar.io" {
component "did:oyd Provider" as provider #cyan
}
rectangle "DID Lint Service" as didlint #cyan {
component "SOyA Validation" as validate #lightgreen
}
resolver .up-> api
provider .up-> api
uniresolver .down-> validate
validate -right-> soya_web
@enduml
```
## Section 5.1 Architecture
```plantuml
@startuml "overview"
skinparam RectangleBackgroundColor white
skinparam NoteBackgroundColor APPLICATION
skinparam NoteBorderColor black
skinparam actorStyle Hollow
rectangle "Sphereon Wallet" as sphereon {
rectangle "SSI Mobile Wallet" as wallet #lightgreen
}
rectangle "Application" as aoo {
rectangle "DEC112 App" as decapp
}
rectangle "Registration" {
rectangle "DEC112 RegAPI" as regapi #lightgreen
}
rectangle "SIP Service" as sip {
rectangle "DEC112 SIP Proxy" as proxy
database "Kamailio" as db
}
rectangle "DID Repository" {
rectangle "Trust Registry" as semcon #lightgreen
}
rectangle "NG Core Services" {
rectangle "Security Service" {
rectangle "BCF" as bcf
}
rectangle "Routing Service" {
rectangle "ESRP" as esrp
}
rectangle "Mapping Service" {
rectangle "ECRF" as ecrf
}
}
rectangle "ECC Service" as sp {
rectangle "DEC112 Viewer" as border
rectangle "DEC112 Chatbot" as bot #lightgreen
rectangle "Training" as training
bot -down-> training
}
:User: -down-> wallet
:User: -down-> decapp
regapi -> db
proxy <.right. db
decapp -right-> regapi
decapp -down-> proxy
wallet -down-> proxy
wallet -down-> regapi
semcon .-> wallet
semcon .-> regapi
semcon .-> decapp
semcon .-> sp
proxy --> bcf
bcf --> esrp
esrp <.- ecrf
esrp -> border
esrp --> bot
border <-down- :Call Taker:
@enduml
```
## Section 6.1: Project Plan
```plantuml
@startgantt
printscale weekly
Project starts the 10th of July 2023
[WP1 Project Management] as [WP1] lasts 265 days and is 23% complete
[Project start] happens at 2023-07-10
[PM Setup] as [TASK1] lasts 10 days
[TASK1] is colored in Lavender/LightBlue
[D1 Requirements] happens at 2023-09-08
[D2 Design] happens at 2023-11-03
[D3 Deployment] happens at 2024-02-02
[D4 Final] happens at 2024-03-29
[WP2 Requirements and Design] as [WP2] lasts 115 days and is 54% complete
[WP2] starts at [WP1]'s start
[Requirements elicitation] as [TASK2] lasts 50 days
[TASK2] starts at [TASK1]'s end
[TASK2] is colored in Lavender/LightBlue
[System design] as [TASK3] lasts 55 days
[TASK3] starts at [TASK2]'s end
[TASK3] is colored in Lavender/LightBlue
[WP3 Infrastructure] as [WP3] lasts 184 days and is 21% complete
[WP3] starts at 2023-08-01
[DID Capabilities] as [TASK4] lasts 184 days
[TASK4] starts at [WP3]'s start
[TASK4] is colored in Lavender/LightBlue
[Wallet Function] as [TASK5] lasts 184 days
[TASK5] starts at [WP3]'s start
[TASK5] is colored in Lavender/LightBlue
[WP4 Services] as [WP4] lasts 153 days and is 5% complete
[WP4] starts at 2023-09-01
[Registration Service] as [TASK6] lasts 153 days
[TASK6] starts at [WP4]'s start
[TASK6] is colored in Lavender/LightBlue
[Chat Bot] as [TASK7] lasts 153 days
[TASK7] starts at [WP4]'s start
[TASK7] is colored in Lavender/LightBlue
[WP5 Disseminsation & Business Development] as [WP5] lasts 182 days and is 0% complete
[WP5] starts at 2023-10-1
[Business Plan] as [TASK8] lasts 182 days
[TASK8] starts at [WP5]'s start
[TASK8] is colored in Lavender/LightBlue
[Scientific Publication] as [TASK9] lasts 182 days
[TASK9] starts at [WP5]'s start
[TASK9] is colored in Lavender/LightBlue
@endgantt
```