This repo is out of date and is archived. Check out an updated tutorial on using FusionAuth with React or the updated GitHub repository.
This project contains an example project that illustrates using FusionAuth with NodeJS and React. The Node and React applications each have their own Readme with further explanations of the applications, including configuration options. Each application also has examples of how to deploy it view Jenkins, Gitlab, or Drone.
The application uses the core features a person would want to use from software like FusionAuth. In order to do that, the Todo example includes routing to make all of these items happen. Included features are:
You will need the following things properly installed on your computer.
git clone https://github.com/fusionauth/fusionauth-nodejs-react-example
cd fusionauth-nodejs-react-example
./server npm install
./frontend npm install
Fast Path
option as a quick way to get up and running.sh -c "curl -fsSL https://raw.githubusercontent.com/FusionAuth/fusionauth-install/master/install.sh | sh"
iex (new-object net.webclient).downloadstring('https://raw.githubusercontent.com/FusionAuth/fusionauth-install/master/install.ps1)
sh -c "curl -fsSL https://raw.githubusercontent.com/FusionAuth/fusionauth-install/master/install.sh | sh -s - -z"
sh -c "curl -fsSL https://raw.githubusercontent.com/FusionAuth/fusionauth-install/master/install.sh | sh"
./fusionauth/bin/startup.sh
Cluster0
.Network Access
tab, add a new IP to be able to access the cluster.Database Access
tab, create a new user demo
with the role Read and Write any database
.demoPass
).Clusters
tab. Then click Connect
followed by Connect your application
. The default language is NodeJS. Copy the connection string.mongodb+srv://cookbook:<password>@something.mongodb.net/test?retryWrites=true&w=majority
@
and /test
-> something.mongodb.net
./server npm start
./server node --inspect server.js
./frontend npm start
Details for how to configure each application (Node / React) will be detailed in their respective folders. This section will go over how to get everything set up as information may be required by both applications.
FusionAuth Demo
).member
and check on the Default
box for that role.JWT
tab, click the Enable
button.Security
tab, click the Allow refresh token
button and uncheck the Require an API key
button.Application ID
for the new application.Application Secret
for the new application.ID
of the API key.Verify Email
button.Email Verification
for the Verification Template
.Email Verification
and Forgot Password Verification
email templates with the HTML provided.
Site Name
to your site's name.https://your-site.com/
to your own domain.From Email
in FusionAuth on both templates to the email used in the email setup.Clusters
tab, click Collections
.fusionAuthDemo
database, click roles
.Insert Document
.VIEW
text, click the blank looking button. This will be a free form editor.mongodb/roles.json
and click Insert
.