Skip to content

Commit 1f3601a

Browse files
authored
Merge pull request #130 from Arquisoft/front-end
Front end
2 parents 5037e2a + 9394f02 commit 1f3601a

File tree

10 files changed

+835
-672
lines changed

10 files changed

+835
-672
lines changed
18.3 KB
Loading

docs/src/03_context_and_scope.adoc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ ifndef::imagesdir[:imagesdir: ../images]
55

66
=== Business context
77

8+
.Business Context Diagram
9+
image::03_1-business-context.png[]
10+
811
[cols="1,2a,2a", options="header"]
12+
913
|===
1014
| Actor | Input | Output
1115

@@ -19,10 +23,13 @@ ifndef::imagesdir[:imagesdir: ../images]
1923
* Statistics
2024
* Ranking
2125

22-
| External bot
26+
| External bot (Claude)
2327
| * Petitions through play()
24-
| * Answer with the next movement (in YEN notation)
28+
| * Answer with the next movement (in YEN notation), obtained by querying Claude AI
2529

30+
| External bot (Minimax)
31+
| * Petitions through play()
32+
| * Answer with the next movement (in YEN notation), obtained by applying minimax algorithm
2633
|===
2734

2835
=== Technical Context

docs/src/06_runtime_view.adoc

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,86 @@ ifndef::imagesdir[:imagesdir: ../images]
55

66
=== User Login
77

8-
This diagram the action of the user login
8+
This diagram represents the action of the user login
99

1010
[plantuml,"Login",png]
1111
----
1212
@startuml
1313
actor User
1414
participant WebApp
15-
participant UsersService
15+
participant userRoutes
16+
participant userController
17+
participant userService
18+
participant userResponseDTO
19+
participant userRepository
1620
database Database
1721
1822
User -> WebApp: Enters credentials (username/password)
19-
WebApp -> UsersService: Auth Request
20-
UsersService -> Database: Search for user & validate password hash
21-
Database --> UsersService: Return user data (or error)
23+
WebApp -> userRoutes: POST /login
24+
userRoutes -> userController: loginUser(req, res)
25+
26+
userController -> userService: loginUser(credentials)
27+
userService -> userRepository: findUserByUsername(username)
28+
userRepository -> Database: SELECT * FROM users...
29+
Database --> userRepository: Raw Data
30+
userRepository --> userService: User Entity
2231
2332
alt valid credentials
24-
UsersService --> WebApp: Login Success
33+
userService --> userController: user
34+
userController -> userResponseDTO: toUserResponseDto(user)
35+
userResponseDTO --> userController: userDTO
36+
userController --> WebApp: 200 OK (userDTO)
2537
WebApp --> User: Redirect to Game Dashboard
2638
else invalid credentials
27-
UsersService --> WebApp: Login Failed (401 Unauthorized)
39+
userService --> userController: throw Error("Invalid username or password")
40+
userController --> WebApp: 401 Unauthorized
2841
WebApp --> User: Show "Invalid username or password"
2942
end
3043
@enduml
3144
----
3245

46+
=== User Signup
47+
48+
This diagrams represent the action of signing up
49+
[plantuml,"Signup",png]
50+
----
51+
@startuml
52+
actor User
53+
participant WebApp
54+
participant userRoutes
55+
participant userController
56+
participant userService
57+
participant bcrypt
58+
participant userRepository
59+
database Database
60+
61+
User -> WebApp: Fills form (nickname, username, email, password, avatarId)
62+
User -> WebApp: Clicks "SAVE ACCOUNT"
63+
WebApp -> userRoutes: POST /createuser
64+
userRoutes -> userController: createUser(req, res)
65+
66+
userController -> userService: createUser(data)
67+
68+
userService -> userService: Validate fields & password length
69+
userService -> userRepository: findUserByUsername(username)
70+
userRepository --> userService: null (if available)
71+
userService -> userRepository: findUserByEmail(email)
72+
userRepository --> userService: null (if available)
73+
74+
userService -> bcrypt: hash(password, 10)
75+
bcrypt --> userService: hashed_password
76+
77+
userService -> userRepository: createUser(nickname, username, email, hashed_password, photo: avatarId)
78+
userRepository -> Database: INSERT INTO users...
79+
Database --> userRepository: newUser
80+
userRepository --> userService: newUser
81+
82+
userService --> userController: newUser
83+
userController --> WebApp: 201 Created ("Welcome username")
84+
WebApp --> User: navigate('/')
85+
@enduml
86+
----
87+
3388
=== User plays the game
3489

3590
This diagram shows the execution of a game

0 commit comments

Comments
 (0)