Skip to content

ArtemySinitsa/okta-react-node-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic CRUD App with Node + React

This example app shows how to create a Node.js API and display its data with a React UI. To follow along step-by-step, check out the blog post.

This project was bootstrapped with Create React App.

Prerequisites: Node.js, Yarn, and SQLite.

Getting Started

To install this example application, run the following commands:

git clone https://github.com/oktadeveloper/okta-react-node-example.git
cd okta-react-node-example
yarn

This will get a copy of the project install locally. You will need to set up some environment variables before the app will run properly.

To integrate Okta's Identity Platform for user authentication, you'll first need to:

You will need to create an application in Okta:

  • Log in to your Okta account, then navigate to Applications and click the Add Application button
  • Select Single-Page App and click Next
  • Give your application a name (e.g. "My React App")
  • Change the Base URI to http://localhost:3000/ and the Login redirect URI to http://localhost:3000/implicit/callback, then click Done
  • Save your Client ID for later

Your Okta application should have settings similar to the following:

Okta Application Settings

Now create a file called .env.local in the project root and add the following variables, replacing the values with your own from the previous steps.

.env.local

REACT_APP_OKTA_CLIENT_ID={yourClientId}
REACT_APP_OKTA_ORG_URL=https://{yourOktaOrgUrl}

Now you can run both the Node API server and the React frontend with the same command:

yarn start

Links

This example uses the following libraries provided by Okta:

Help

Please raise an issue if you find a problem with the example application, or visit our Okta Developer Forums. You can also email [email protected] if would like to create a support ticket.

License

Apache 2.0, see LICENSE.

About

A simple React.js + Node.js example app.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 91.0%
  • HTML 9.0%