@startuml
title Sign Up (Register)

start
:input name, email, password;
:generate or input user name;
:submit;

if (is User Name exist) then (yes)
  :User name exist;
  :Display login screen;
  end
else (no)

if (is email duplicated) then (yes)
  :Account exists;
  :Display Login screen;
  end
else (no)
  :write user information;
  :Send verification email;
  :Sign In;

if (email verified) then (no)
  fork
    :Resend verification;
    :Send verification email;
    :Display send success message;
  fork again
    :Change email;
    :input new email, password;
    if(is email duplicated) then (yes)
      :Fail to change email;
      end;
    else (no)
      :update email;
      :Send verification email;
    endif
  end fork
:User check email for verification;
end
else (yes)
  :full dashboard;
endif
stop
@enduml