Skip to content

Add UML class & sequence diagrams #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/uml/classes_SimpleWebapp.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@startuml class_diagram

class User {
- id: int
- username: str
- password: str
+ is_authenticated(): bool
}

class Item {
- id: int
- title: str
- description: str
+ save(): void
}

class AuthController {
+ login(username: str, password: str): bool
+ logout(): void
}

class ItemController {
+ create_item(data): Item
+ get_item_by_id(item_id: int): Item
}

User "1" -- "0..*" Item : owns
AuthController --> User : authenticates
ItemController --> Item : manages

@enduml
13 changes: 13 additions & 0 deletions docs/uml/sequence_create_item.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@startuml sequence_item
actor User
participant "ItemController" as IC
database "Database" as DB
entity "Item Model" as IM

User -> IC: POST /item/new (title, description)
IC -> IM: Create Item(data)
IM -> DB: INSERT item
DB --> IM: Success
IM --> IC: Item Created
IC -> User: Redirect to item page
@enduml
17 changes: 17 additions & 0 deletions docs/uml/sequence_login.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@startuml sequence_login
actor User
participant "AuthController" as AC
database "Database" as DB
entity "User Model" as UM

User -> AC: POST /login (username, password)
AC -> DB: Query user by username
DB --> AC: User data
AC -> UM: Validate password
UM --> AC: True/False
alt Valid
AC -> User: Redirect to Dashboard
else Invalid
AC -> User: Show error message
end
@enduml
Binary file added out/classes_SimpleWebapp/classes_SimpleWebapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.