Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5e2e3a5

Browse files
author
Ivan Franchin
committed
Project upgrade
- Upgrade to Spring Boot 3.4.3; - Upgrade to SpringDoc OpenAPI 2.8.5; - Upgrade some NPM packages; - Update README.
1 parent 38aa68e commit 5e2e3a5

File tree

4 files changed

+37
-37
lines changed

4 files changed

+37
-37
lines changed

‎README.md‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
2121

2222
- ### order-api
2323

24-
`Spring Boot` Web Java backend application that exposes a Rest API to create, retrieve and delete orders. If a user has `ADMIN` role he/she can also retrieve information of other users or delete them.
24+
`Spring Boot` Web Java backend application that exposes a Rest API to create, retrieve, and delete orders. If a user has the `ADMIN` role, he/she can also retrieve information of other users or delete them.
2525

26-
The application secured endpoints can just be accessed if a valid JWT access token is provided.
26+
The application's secured endpoints can only be accessed if a valid JWT access token is provided.
2727

2828
`order-api` stores its data in [`Postgres`](https://www.postgresql.org/) database.
2929

@@ -47,9 +47,9 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
4747

4848
`React` frontend application where a user with role `USER` can create an order and retrieve a specific order. On the other hand, a user with role `ADMIN` as access to all secured endpoints.
4949

50-
In order to access the application, a `user` or `admin` must login using his/her `username` and `password`. All the requests coming from `order-ui` to secured endpoints in `order-api` have the JWT access token. This token is generated when the `user` or `admin` logins.
50+
In order to access the application, a `user` or `admin` must log in using his/her `username` and `password`. All the requests coming from `order-ui` to secured endpoints in `order-api` include the JWT access token. This token is generated when the `user` or `admin` logs in.
5151

52-
`order-ui` uses [`Semantic UI React`](https://react.semantic-ui.com/) as CSS-styled framework.
52+
`order-ui` uses [`Semantic UI React`](https://react.semantic-ui.com/) as a CSS-styled framework.
5353

5454
## Prerequisites
5555

@@ -62,7 +62,7 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
6262

6363
- In a terminal, make sure you are inside the `springboot-react-jwt-token` root folder;
6464

65-
- Run the following command to start docker compose containers:
65+
- Run the following command to start Docker Compose containers:
6666
```
6767
docker compose up -d
6868
```
@@ -124,7 +124,7 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
124124
{ "password": "user", "username": "user" }
125125
```
126126
127-
- Click `Execute` button. It should return something like:
127+
- Click the `Execute` button. It should return something like:
128128
```
129129
Code: 200
130130
{ "accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9..." }
@@ -139,16 +139,16 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
139139
140140
- In `Value` input field, paste the copied token;
141141
142-
- Click `Authorize` button and then, click `Close` button;
142+
- Click the `Authorize` button and then, click the `Close` button;
143143
144-
- To create an order, click `POST /api/orders` and then, click `Try it out` button;
144+
- To create an order, click `POST /api/orders` and then, click the `Try it out` button;
145145
146146
- Provide the `description` of the order:
147147
```
148148
{ "description": "Buy two iPhones" }
149149
```
150150
151-
- Click `Execute` button. It should return something like:
151+
- Click the `Execute` button. It should return something like:
152152
```
153153
Code: 200
154154
{
@@ -182,15 +182,15 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
182182
HTTP/1.1 401
183183
```
184184
185-
- Call `POST /auth/authenticate` to get `admin` JWT access token:
185+
- Call `POST /auth/authenticate` to get the `admin` JWT access token:
186186
```
187187
ADMIN_ACCESS_TOKEN="$(curl -s -X POST http://localhost:8080/auth/authenticate \
188188
-H 'Content-Type: application/json' \
189189
-d '{"username": "admin", "password": "admin"}' | jq -r .accessToken)"
190190
echo $ADMIN_ACCESS_TOKEN
191191
```
192192
193-
- Call again `GET /api/orders`, now with `admin` JWT access token:
193+
- Call `GET /api/orders` again, now with the `admin` JWT access token:
194194
```
195195
curl -i -H "Authorization: Bearer $ADMIN_ACCESS_TOKEN" localhost:8080/api/orders
196196
```
@@ -268,13 +268,13 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
268268
269269
- **jwt.io**
270270
271-
With [jwt.io](https://jwt.io) you can inform the JWT token and the online tool decodes the token, showing its header and payload.
271+
With [jwt.io](https://jwt.io), you can input the JWT token, and the online tool decodes the token, showing its header and payload.
272272
273273
## Shutdown
274274
275275
- To stop `order-api` and `order-ui`, go to the terminals where they are running and press `Ctrl+C`;
276276
277-
- To stop and remove docker compose containers, network and volumes, go to a terminal and, inside the `springboot-react-jwt-token` root folder, run the command below:
277+
- To stop and remove Docker Compose containers, network, and volumes, go to a terminal and, inside the `springboot-react-jwt-token` root folder, run the command below:
278278
```
279279
docker compose down -v
280280
```

‎order-api/pom.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>3.4.0</version>
8+
<version>3.4.3</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<groupId>com.ivanfranchin</groupId>
@@ -29,7 +29,7 @@
2929
<properties>
3030
<java.version>21</java.version>
3131
<jjwt.version>0.12.6</jjwt.version>
32-
<springdoc-openapi.version>2.7.0</springdoc-openapi.version>
32+
<springdoc-openapi.version>2.8.5</springdoc-openapi.version>
3333
</properties>
3434
<dependencies>
3535
<dependency>

‎order-ui/package-lock.json‎

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎order-ui/package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"private": true,
55
"dependencies": {
66
"@testing-library/jest-dom": "^6.6.3",
7-
"@testing-library/react": "^16.1.0",
8-
"@testing-library/user-event": "^14.5.2",
7+
"@testing-library/react": "^16.2.0",
8+
"@testing-library/user-event": "^14.6.1",
99
"react": "^18.3.1",
1010
"react-dom": "^18.3.1",
1111
"react-scripts": "5.0.1",
1212
"web-vitals": "^4.2.4",
13-
"axios": "^1.7.9",
13+
"axios": "^1.8.2",
1414
"react-router-dom": "^7.0.2",
1515
"semantic-ui-react": "^2.1.5"
1616
},

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /