---
# System prepended metadata

title: Untitled

---

```plantuml
@startuml

actor       "pemilik kendaraan"     as actor1
boundary "website samsat" as web_samsat
control "module registrasi" as module_registrasi
control "module login" as module_login
control "module check user" as module_check_user
entity "user " as user
database "db_samsat" as db


actor1 -> web_samsat : visit website
actor1 -> web_samsat : /login
web_samsat -> module_login : controller login
module_login -> module_check_user : check user and password exist
module_check_user -> user : model user
user -> db : <<get user by username & password>>
db -> user : return data and save to model user
user -> module_check_user
module_check_user -> module_check_user
note left: check model user
alt model user is null/empty
module_check_user -> web_samsat : return response failed
 group create new user
    actor1 -> web_samsat : /registrasi
web_samsat -> module_registrasi : controller register
module_registrasi -> module_check_user : check user and password exist
module_check_user -> user : model user
user -> db : <<get user by username & password>>
db -> user : return data and save to model user
user -> module_check_user
module_check_user -> module_check_user
note left
check model user
user null or not null
end note
module_check_user -> module_registrasi : send model user
group user not null
        module_check_user -> module_registrasi: return error; user already exist
module_registrasi -> web_samsat : return response username already exist
    end
module_registrasi -> db : <<insert new user>>
    end
end
module_check_user -> web_samsat : return response success login
@enduml
```