Skip to content

Commit 7897015

Browse files
committed
Updates after QA
1 parent d94de0a commit 7897015

18 files changed

Lines changed: 63 additions & 198 deletions

File tree

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
This example app shows how to create a Spring Boot API and CRUD (create, read, update, and delete) its data with a React app.
44

5-
<!--Please read []() to see how this app was created.-->
5+
Please read [Use React and Spring Boot to Build a Simple CRUD App](https://developer.okta.com/blog/2018/07/19/simple-crud-react-and-spring-boot) to see how this app was created.
66

7-
**Prerequisites:** [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) and [Node.js](https://nodejs.org/).
7+
**Prerequisites:** [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html), [Node.js 8+](https://nodejs.org/), and [Yarn](https://yarnpkg.com/en/docs/install). You can use npm instead of Yarn, but you'll need to translate the Yarn syntax to npm.
88

99
> [Okta](https://developer.okta.com/) has Authentication and User Management APIs that reduce development time with instant-on, scalable user infrastructure. Okta's intuitive API and expert support make it easy for developers to authenticate, manage, and secure users and roles in any application.
1010
@@ -39,15 +39,14 @@ yarn && yarn start
3939
You can also run everything using Maven:
4040

4141
```bash
42-
./mvnw package -Pprod
43-
java -jar target/*.jar
42+
./mvnw -Pprod
4443
```
4544

4645
### Create an Application in Okta
4746

4847
You will need to [create an OIDC Application in Okta]() to get your values to perform authentication.
4948

50-
Log in to your Okta Developer account (or [sign up](https://developer.okta.com/signup/) if you don’t have an account) and navigate to **Applications** > **Add Application**. Click **Web**, click **Next**, and give the app a name you’ll remember. Add `http://localhost:8080/login` as a login redirect URI and click **Done**.
49+
Log in to your Okta Developer account (or [sign up](https://developer.okta.com/signup/) if you don’t have an account) and navigate to **Applications** > **Add Application**. Click **Web**, click **Next**, and give the app a name you’ll remember. Specify `http://localhost:8080/login/oauth2/code/okta` as a Login redirect URI. Click **Done**, then click **Edit** to edit General Settings. Add `http://localhost:3000` and `http://localhost:8080` as Logout redirect URIs, then click **Save**.
5150

5251
#### Server Configuration
5352

@@ -82,7 +81,7 @@ This example uses the following open source libraries:
8281
8382
## Help
8483
85-
Please post any questions as comments on the [blog post](), or visit our [Okta Developer Forums](https://devforum.okta.com/). You can also email developers@okta.com if you would like to create a support ticket.
84+
Please post any questions as comments on the [blog post](https://developer.okta.com/blog/2018/07/19/simple-crud-react-and-spring-boot), or visit our [Okta Developer Forums](https://devforum.okta.com/). You can also email developers@okta.com if you'd like to create a support ticket.
8685
8786
## License
8887

app/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"bootstrap": "^4.1.2",
6+
"bootstrap": "4.1.2",
77
"react": "^16.4.1",
8-
"react-cookie": "^2.2.0",
8+
"react-cookie": "2.2.0",
99
"react-dom": "^16.4.1",
10-
"react-router-dom": "^4.3.1",
10+
"react-router-dom": "4.3.1",
1111
"react-scripts": "1.1.4",
12-
"reactstrap": "^6.3.0"
12+
"reactstrap": "6.3.0"
1313
},
1414
"scripts": {
1515
"start": "react-scripts start",

app/src/App.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
}
2929

3030
.container, .container-fluid {
31-
padding-top: 20px;
31+
margin-top: 20px;
3232
}

app/src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ class App extends Component {
2222
}
2323
}
2424

25-
export default App;
25+
export default App;

app/src/GroupEdit.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class GroupEdit extends Component {
1919
postalCode: ''
2020
};
2121

22-
2322
constructor(props) {
2423
super(props);
2524
const {cookies} = props;

app/src/GroupList.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Button, ButtonGroup, Container, Table } from 'reactstrap';
33
import AppNavbar from './AppNavbar';
44
import { Link, withRouter } from 'react-router-dom';
55
import { instanceOf } from 'prop-types';
6-
import { withCookies, Cookies } from 'react-cookie';
6+
import { Cookies, withCookies } from 'react-cookie';
77

88
class GroupList extends Component {
99
static propTypes = {
@@ -36,9 +36,9 @@ class GroupList extends Component {
3636
},
3737
credentials: 'include'
3838
}).then(() => {
39-
let updatedGroups = [...this.state.groups].filter(i => i.id !== id);
40-
this.setState({groups: updatedGroups});
41-
});
39+
let updatedGroups = [...this.state.groups].filter(i => i.id !== id);
40+
this.setState({groups: updatedGroups});
41+
});
4242
}
4343

4444
render() {
@@ -62,7 +62,7 @@ class GroupList extends Component {
6262
})}</td>
6363
<td>
6464
<ButtonGroup>
65-
<Button size="sm" color="primary" tag={Link} to={"/groups/" + group.id}>Edit</Button>
65+
<Button size="sm" color="primary" tag={Link} to={'/groups/' + group.id}>Edit</Button>
6666
<Button size="sm" color="danger" onClick={() => this.remove(group.id)}>Delete</Button>
6767
</ButtonGroup>
6868
</td>

app/src/Home.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ class Home extends Component {
7373
}
7474
}
7575

76-
export default withCookies(Home);
76+
export default withCookies(Home);

app/yarn.lock

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ boolbase@~1.0.0:
10801080
version "1.0.0"
10811081
resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
10821082

1083-
bootstrap@^4.1.2:
1083+
bootstrap@4.1.2:
10841084
version "4.1.2"
10851085
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.1.2.tgz#aee2a93472e61c471fc79fb475531dcbc87de326"
10861086

@@ -1315,8 +1315,8 @@ caniuse-api@^1.5.2:
13151315
lodash.uniq "^4.5.0"
13161316

13171317
caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639:
1318-
version "1.0.30000865"
1319-
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000865.tgz#82ffb64d40f7567620aac02d3a632079689abc6b"
1318+
version "1.0.30000869"
1319+
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000869.tgz#c3da59fa8d9456df88a24bb292ede0e3798798cb"
13201320

13211321
caniuse-lite@^1.0.30000748, caniuse-lite@^1.0.30000792:
13221322
version "1.0.30000865"
@@ -1558,22 +1558,22 @@ component-emitter@^1.2.1:
15581558
version "1.2.1"
15591559
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6"
15601560

1561-
compressible@~2.0.13:
1561+
compressible@~2.0.14:
15621562
version "2.0.14"
15631563
resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.14.tgz#326c5f507fbb055f54116782b969a81b67a29da7"
15641564
dependencies:
15651565
mime-db ">= 1.34.0 < 2"
15661566

15671567
compression@^1.5.2:
1568-
version "1.7.2"
1569-
resolved "http://registry.npmjs.org/compression/-/compression-1.7.2.tgz#aaffbcd6aaf854b44ebb280353d5ad1651f59a69"
1568+
version "1.7.3"
1569+
resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.3.tgz#27e0e176aaf260f7f2c2813c3e440adb9f1993db"
15701570
dependencies:
1571-
accepts "~1.3.4"
1571+
accepts "~1.3.5"
15721572
bytes "3.0.0"
1573-
compressible "~2.0.13"
1573+
compressible "~2.0.14"
15741574
debug "2.6.9"
15751575
on-headers "~1.0.1"
1576-
safe-buffer "5.1.1"
1576+
safe-buffer "5.1.2"
15771577
vary "~1.1.2"
15781578

15791579
concat-map@0.0.1:
@@ -2274,8 +2274,8 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1
22742274
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
22752275

22762276
escodegen@^1.6.1:
2277-
version "1.10.0"
2278-
resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.10.0.tgz#f647395de22519fbd0d928ffcf1d17e0dec2603e"
2277+
version "1.11.0"
2278+
resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.0.tgz#b27a9389481d5bfd5bec76f7bb1eb3f8f4556589"
22792279
dependencies:
22802280
esprima "^3.1.3"
22812281
estraverse "^4.2.0"
@@ -2428,8 +2428,8 @@ esprima@^3.1.3:
24282428
resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
24292429

24302430
esprima@^4.0.0:
2431-
version "4.0.0"
2432-
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"
2431+
version "4.0.1"
2432+
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
24332433

24342434
esquery@^1.0.0:
24352435
version "1.0.1"
@@ -3186,8 +3186,8 @@ html-entities@^1.2.0:
31863186
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.2.1.tgz#0df29351f0721163515dfb9e5543e5f6eed5162f"
31873187

31883188
html-minifier@^3.2.3:
3189-
version "3.5.18"
3190-
resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.18.tgz#fc8b02826cbbafc6de19a103c41c830a91cffe5a"
3189+
version "3.5.19"
3190+
resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.19.tgz#ed53c4b7326fe507bc3a1adbcc3bbb56660a2ebd"
31913191
dependencies:
31923192
camel-case "3.0.x"
31933193
clean-css "4.1.x"
@@ -3985,8 +3985,8 @@ jest@20.0.4:
39853985
jest-cli "^20.0.4"
39863986

39873987
js-base64@^2.1.9:
3988-
version "2.4.6"
3989-
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.6.tgz#1d49f618bef43630cd191f4e122447acfdb947d8"
3988+
version "2.4.8"
3989+
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.8.tgz#57a9b130888f956834aa40c5b165ba59c758f033"
39903990

39913991
"js-tokens@^3.0.0 || ^4.0.0":
39923992
version "4.0.0"
@@ -4447,19 +4447,15 @@ miller-rabin@^4.0.0:
44474447
bn.js "^4.0.0"
44484448
brorand "^1.0.1"
44494449

4450-
"mime-db@>= 1.34.0 < 2":
4451-
version "1.34.0"
4452-
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.34.0.tgz#452d0ecff5c30346a6dc1e64b1eaee0d3719ff9a"
4453-
4454-
mime-db@~1.33.0:
4455-
version "1.33.0"
4456-
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db"
4450+
"mime-db@>= 1.34.0 < 2", mime-db@~1.35.0:
4451+
version "1.35.0"
4452+
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47"
44574453

44584454
mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18:
4459-
version "2.1.18"
4460-
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8"
4455+
version "2.1.19"
4456+
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.19.tgz#71e464537a7ef81c15f2db9d97e913fc0ff606f0"
44614457
dependencies:
4462-
mime-db "~1.33.0"
4458+
mime-db "~1.35.0"
44634459

44644460
mime@1.4.1:
44654461
version "1.4.1"
@@ -5559,7 +5555,7 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.2.7:
55595555
minimist "^1.2.0"
55605556
strip-json-comments "~2.0.1"
55615557

5562-
react-cookie@^2.2.0:
5558+
react-cookie@2.2.0:
55635559
version "2.2.0"
55645560
resolved "https://registry.yarnpkg.com/react-cookie/-/react-cookie-2.2.0.tgz#0ad91a04db235aa35af97032c388fe902be3560c"
55655561
dependencies:
@@ -5614,7 +5610,7 @@ react-popper@^0.10.4:
56145610
popper.js "^1.14.1"
56155611
prop-types "^15.6.1"
56165612

5617-
react-router-dom@^4.3.1:
5613+
react-router-dom@4.3.1:
56185614
version "4.3.1"
56195615
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6"
56205616
dependencies:
@@ -5700,7 +5696,7 @@ react@^16.4.1:
57005696
object-assign "^4.1.1"
57015697
prop-types "^15.6.0"
57025698

5703-
reactstrap@^6.3.0:
5699+
reactstrap@6.3.0:
57045700
version "6.3.0"
57055701
resolved "https://registry.yarnpkg.com/reactstrap/-/reactstrap-6.3.0.tgz#99c790f7293dc74e01b5907d62db675b63866e9c"
57065702
dependencies:
@@ -6043,7 +6039,7 @@ safe-buffer@5.1.1:
60436039
version "5.1.1"
60446040
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
60456041

6046-
safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
6042+
safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
60476043
version "5.1.2"
60486044
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
60496045

@@ -6739,8 +6735,8 @@ ua-parser-js@^0.7.18:
67396735
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed"
67406736

67416737
uglify-js@3.4.x, uglify-js@^3.0.13:
6742-
version "3.4.4"
6743-
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.4.tgz#92e79532a3aeffd4b6c65755bdba8d5bad98d607"
6738+
version "3.4.5"
6739+
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.5.tgz#650889c0766cf0f6fd5346cea09cd212f544be69"
67446740
dependencies:
67456741
commander "~2.16.0"
67466742
source-map "~0.6.1"

pom.xml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2323
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
2424
<java.version>1.8</java.version>
25+
<spring-security.version>5.1.0.BUILD-SNAPSHOT</spring-security.version>
2526
<frontend-maven-plugin.version>1.6</frontend-maven-plugin.version>
2627
<node.version>v10.6.0</node.version>
2728
<yarn.version>v1.8.0</yarn.version>
28-
<spring-security.version>5.1.0.BUILD-SNAPSHOT</spring-security.version>
2929
</properties>
3030

3131
<dependencies>
@@ -58,10 +58,6 @@
5858
<artifactId>h2</artifactId>
5959
<scope>runtime</scope>
6060
</dependency>
61-
<dependency>
62-
<groupId>org.springframework.boot</groupId>
63-
<artifactId>spring-boot-devtools</artifactId>
64-
</dependency>
6561
<dependency>
6662
<groupId>org.projectlombok</groupId>
6763
<artifactId>lombok</artifactId>
@@ -72,11 +68,6 @@
7268
<artifactId>spring-boot-starter-test</artifactId>
7369
<scope>test</scope>
7470
</dependency>
75-
<dependency>
76-
<groupId>org.springframework.data</groupId>
77-
<artifactId>spring-data-rest-core</artifactId>
78-
<version>3.0.8.RELEASE</version>
79-
</dependency>
8071
</dependencies>
8172

8273
<build>
@@ -202,7 +193,7 @@
202193
<repositories>
203194
<repository>
204195
<id>spring-snapshots</id>
205-
<name>Spring Snapshot Repository</name>
196+
<name>Spring Snapshots</name>
206197
<url>http://repo.spring.io/snapshot</url>
207198
</repository>
208199
</repositories>

0 commit comments

Comments
 (0)