# Build a Basic CRUD App with Node and React

**URL:** <https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896>\
**Category:** Developer Blog Comments\
**Created:** [July 10, 2018, 4:15pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896 "2018-07-10T16:15:08Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [August 13, 2019, 5:38pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/41 "2019-08-13T17:38:33Z")

</div>

**Matt Raible**

Thanks for reporting the issues you’re having with this tutorial Alexandre. If you’re using the same versions we specify in the tutorial, then it sounds like there’s a bug. If you’re trying to use new versions, or install dependencies w/o version numbers, things will likely break.

If you want to try working with the versions used in this blog post, a shortcut is to clone the [example app](https://github.com/oktadeveloper/okta-react-node-example "https://github.com/oktadeveloper/okta-react-node-example"), change the Okta settings to use yours, then run it.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 19, 2019, 2:07pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/42 "2019-12-19T14:07:01Z")

</div>

**Dale Mc Diarmid**

Do you have equivalent guides for SAML integration?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [March 24, 2020, 7:04pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/43 "2020-03-24T19:04:11Z")

</div>

**Novajed**

Hey there! Dev who recently followed this article. Learned that there’s a few things to migrate in order to do this in 2020. This [README](https://github.com/okta/okta-oidc-js/tree/master/packages/okta-react#migrating-from-1x-to-20 "https://github.com/okta/okta-oidc-js/tree/master/packages/okta-react#migrating-from-1x-to-20") addresses everything so people can get up and running. Hope it helps!

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [April 10, 2020, 1:55am UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/44 "2020-04-10T01:55:47Z")

</div>

**Arlety Delgado**

Hey! I’m very new to React, so I’m finding it difficult to know what needs to be changed. Could you please post what needs to be changed? Thank you!

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [October 3, 2020, 11:06pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/45 "2020-10-03T23:06:11Z")

</div>

**Eloise Zeng**

Hello,

How can I add new columns to the database table? In index.js, I replaced   
const Post = database.define(‘posts’, {  
 title: Sequelize.STRING,  
 email: Sequelize.STRING,  
});

with

const Post = database.define(‘posts’, {  
 title: Sequelize.STRING,  
 email: Sequelize.STRING,  
});

Then in PostEditor.js, I replaced   
\<field name=“body”\>  
 {({ input }) =\> (  
 \<textfield classname="{classes.marginTop}" label=“Body” autofocus="" {…input}=""/\>  
 )}  
 \</field\>

with

\<field name=“email”\>  
 {({ input }) =\> (  
 \<textfield classname="{classes.marginTop}" label=“Body” autofocus="" {…input}=""/\>  
 )}  
 \</field\>

I got the error SQLITE\_ERROR: no such column: email in the console.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [October 19, 2020, 5:38pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/46 "2020-10-19T17:38:24Z")

</div>

**Conor Macken**

@minoation thanks for this comment, made me aware of the need to migrate.

For anyone going through this tutorial in 2020 here’s a commit with the updates you need to do to make this work with okta-react version 3

[https://github.com/cwmacken…](https://github.com/cwmacken/okta-react-node-example/commit/b613e0ff150ab3468ea98c681f7cc21422316eaa "https://github.com/cwmacken/okta-react-node-example/commit/b613e0ff150ab3468ea98c681f7cc21422316eaa")

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [January 2, 2021, 2:34am UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/47 "2021-01-02T02:34:35Z")

</div>

**Graham Charles**

This line in `LoginButton.js` causes not-a-function errors:

`const authenticated = await this.props.authState.isAuthenticated();`

As far as I can tell, it should be a property:

`const authenticated = await this.props.authState.isAuthenticated;`

Maybe it’s a version thing?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [January 7, 2021, 2:47pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/48 "2021-01-07T14:47:02Z")

</div>

**Ibrahim Bhabay**

This article is kind of confusing. Bradley has created the application for Authorization code flow, but ended up implementing implicit flow. This is because the authorization is happening through redirect uri on react side and then the access code is sent to node server to access the API. I think this is quite misleading! Could you please show how to serve an SPA using Authorization code flow.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [January 20, 2021, 7:18pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/49 "2021-01-20T19:18:03Z")

</div>

**Matt Raible**

Are you using `@okta/okta-react@3.0.8` like this tutorial recommends? If so, it might be a bug and we should fix it. If not, I recommend looking for a newer article, like [A Quick Guide to React Login Options](https://developer.okta.com/blog/2020/12/16/react-login "https://developer.okta.com/blog/2020/12/16/react-login"). You can find all our React articles by going to the [react tag](https://developer.okta.com/blog/tags/react "https://developer.okta.com/blog/tags/react").

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [January 20, 2021, 7:20pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/50 "2021-01-20T19:20:18Z")

</div>

**Matt Raible**

This post is a couple years old, so it’s possible things have changed. I searched and don’t see the word “implicit” mentioned in this article. What makes you think it uses implicit flow?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [January 20, 2021, 9:00pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/51 "2021-01-20T21:00:30Z")

</div>

**USS Cognizant**

Hi, On _**MacOS 10.14.6 (18G6032)**_, getting to Login page and logging in with Okta was quick. **But the POSTS-MANAGER link gives an empty page** (with just the header). No errors on Chrome-console and Shell-console, whatsoever. Tried with both `yarn start` as well as `npm start`. I suspect something IS BROKEN with the React-code. Chrome-Console NETWORK tab shows only Okta traffic. Nothing sent to localhost:3001. I tried running `npm run start;web` and `npm run watch:server` separately. Same exact behavior! Other REACT-Code issues: After login, I do NOT see the “human icon”. Help!

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [January 20, 2021, 10:18pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/52 "2021-01-20T22:18:45Z")

</div>

**Matt Raible**

Are you using the same version numbers this tutorial is using? If so, you might try comparing your code with the example’s code. [https://github.com/oktadeve…](https://github.com/oktadeveloper/okta-react-node-example "https://github.com/oktadeveloper/okta-react-node-example")

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [January 21, 2021, 8:07pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/53 "2021-01-21T20:07:51Z")

</div>

**USS Cognizant**

Yessir. The exact commands as on github [README.md](http://README.md "README.md") (so … there not anything in those commands to specify as versions. All versions are actually in package.json); The only unspecified items are Node.JS version (I used v10 and v14). And neither of these 2 Node.JS versions made any difference. As such, I’m not great at React.js. To compound it, the use of epilogue makes it hard for me to debug it myself. Worst of all, no errors or warnings in Chrome console!

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [January 21, 2021, 10:17pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/54 "2021-01-21T22:17:29Z")

</div>

**nemesisnz**

Nice tutorial. But unfortunately the Okta portion doesn’t work.

I have gone through the steps to the section on adding the login/logout link. Including the process of signing up with Okta. The login link in the app displays fine. Clicking on it shows me an Okta login prompt. Logging in using my original credentials sends me back to the app, but no logged in state is displayed and it’s easy to see why. Even found in the final github repo.

[https://github.com/oktadeve…](https://github.com/oktadeveloper/okta-react-node-example/blob/1e79e71bf033819df851d22e78aea63685441a64/src/components/LoginButton.js#L47 "https://github.com/oktadeveloper/okta-react-node-example/blob/1e79e71bf033819df851d22e78aea63685441a64/src/components/LoginButton.js#L47")

authenticated is always null. Removing this line displays the login link again. Seems to me that the block returning the menu can never run.

Is this tutorial outdated? The repo seems to have been updated regularly.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [January 22, 2021, 1:17pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/55 "2021-01-22T13:17:11Z")

</div>

**USS Cognizant**

UPDATE: I gave up on this app. I tried another app from Okta’s sample repo; This time I went with **ANOTHER** REACT.js app (w/ Spring API backend), that worked JUST FINE. Took me less than 3 minutes! Clearly the ABOVE app’s REACT.js code wont work on a Mac. Something’s broken inside in the REACT.js code.   
FYI: This works → `https://github.com/oktadeveloper/okta-spring-boot-react-crud-example`

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [January 27, 2021, 5:15am UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/56 "2021-01-27T05:15:36Z")

</div>

**Matt Raible**

I’m pretty sure this tutorial works if you use the commands and versions specified. I updated it a couple of times to fix bugs myself. I’m glad you found another one that works for you!

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [March 10, 2021, 10:30pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/57 "2021-03-10T22:30:36Z")

</div>

**Vinicius Feitosa**

Great article.

If you are having trouble obtaining the token, within the file `src/pages/PostsManager.js` the correct one would be :

`authorization: Bearer ${await this.props.authService.getAccessToken()}`   
[https://media3.giphy.com/me…](https://media3.giphy.com/media/n5oYbKrHYXylq/giphy.gif "https://media3.giphy.com/media/n5oYbKrHYXylq/giphy.gif")

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [March 23, 2021, 10:32pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/58 "2021-03-23T22:32:32Z")

</div>

**Ajarn Nelson**

isAuthticated is not working. I keep getting its undefined. How do I define it?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [March 23, 2021, 10:57pm UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/59 "2021-03-23T22:57:47Z")

</div>

**Matt Raible**

Are you using the same library versions this post uses? If you are, you might try comparing your code with this blog post’s [example app on GitHub](https://github.com/oktadeveloper/okta-react-node-example "https://github.com/oktadeveloper/okta-react-node-example").

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [June 7, 2021, 5:50am UTC](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896/60 "2021-06-07T05:50:40Z")

</div>

**xingvoong**

I tried to log in to the app but my username and password are not working.  
I tried to reset it but it does not work either ☹

[Previous page](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896.md?page=2)

[Next page](https://devforum.okta.com/t/build-a-basic-crud-app-with-node-and-react/16896.md?page=4)
