160 lines
2.5 KiB
Markdown
160 lines
2.5 KiB
Markdown
## App Flow Charts
|
|
|
|
### App
|
|
```plantuml
|
|
@startuml
|
|
start
|
|
:Create BrighterTrades object;
|
|
:configuration app;
|
|
:run app;
|
|
stop
|
|
@enduml
|
|
```
|
|
|
|
### /index
|
|
```plantuml
|
|
@startuml
|
|
start
|
|
:Log in user;
|
|
:Load dynamic data;
|
|
:Render Landing Page;
|
|
stop
|
|
@enduml
|
|
```
|
|
|
|
### /ws
|
|
```plantuml
|
|
@startuml
|
|
start
|
|
repeat
|
|
:Listen for message;
|
|
if (Contains json?) then (yse)
|
|
:Process_received_json();
|
|
else (no)
|
|
:Display_message();
|
|
endif
|
|
repeatwhile()
|
|
@enduml
|
|
```
|
|
|
|
### /settings
|
|
```plantuml
|
|
@startuml
|
|
start
|
|
if (Logged in?) then (no)
|
|
:redirect -> "/index";
|
|
stop
|
|
else (yes)
|
|
:get_setting();
|
|
:process_command();
|
|
:redirect -> "/index";
|
|
stop
|
|
@enduml
|
|
```
|
|
|
|
### /history
|
|
```plantuml
|
|
@startuml
|
|
start
|
|
if (Logged in?) then (no)
|
|
:Return empty data;
|
|
stop
|
|
else (yes)
|
|
:Get current chart view details.;
|
|
:Request price history for the chart view.;
|
|
:Return data;
|
|
stop
|
|
@enduml
|
|
```
|
|
|
|
### /signup
|
|
```plantuml
|
|
@startuml
|
|
start
|
|
:Return rendered signup page.;
|
|
stop
|
|
@enduml
|
|
```
|
|
|
|
### /signout
|
|
```plantuml
|
|
@startuml
|
|
start
|
|
:Logout user.;
|
|
:Delete client session var.;
|
|
:redirect -> /index;
|
|
stop
|
|
@enduml
|
|
```
|
|
|
|
### /login
|
|
```plantuml
|
|
@startuml
|
|
start
|
|
:Get credentials;
|
|
:Log in user.;
|
|
if (success) then (yes)
|
|
:Set the client session var;
|
|
else (no)
|
|
endif
|
|
:Redirect -> /index;
|
|
stop
|
|
@enduml
|
|
```
|
|
|
|
### /signup_submit
|
|
```plantuml
|
|
@startuml
|
|
|
|
start
|
|
|
|
:Receive form data;
|
|
:Extract email, username, and password;
|
|
:Validate email format;
|
|
if (Valid email format?) then (yes)
|
|
:Validate username and password;
|
|
if (Valid username and password?) then (yes)
|
|
:Create new user;
|
|
if (Success) then (yes)
|
|
:Set session user;
|
|
:Redirect to homepage;
|
|
else (no)
|
|
:Flash error message;
|
|
endif
|
|
else (no)
|
|
:Flash error message;
|
|
endif
|
|
else (no)
|
|
:Flash error message;
|
|
endif
|
|
|
|
stop
|
|
|
|
@enduml
|
|
```
|
|
### /indictor_init
|
|
```plantuml
|
|
@startuml
|
|
start
|
|
|
|
if (Check if username is provided) then (yes)
|
|
:Retrieve username from request data;
|
|
else (no)
|
|
:Return error response;
|
|
stop
|
|
endif
|
|
|
|
if (Check if user is logged in) then (yes)
|
|
:Retrieve chart view for the user;
|
|
else (no)
|
|
:Return error response;
|
|
stop
|
|
endif
|
|
|
|
:Retrieve indicator data for the user;
|
|
:Return data response;
|
|
stop
|
|
|
|
@endum
|
|
```
|