The repo stores a boilerplate with React.js for frontend, Redux for state management, and Firebase for user authentication.
- clone the repo
git clone https://github.com/avrahm/react-redux-firebase-boilerplate.git
cd
into the directory labelled react-redux-firebase-boilerplate- Inside the directory run
yarn
to install the node_modules
- Navigate to firebase.google.com
- Create a new web project. Follow Step 1 and 2 of the official Google Documentation
- After setting up the project, navigate to Authentication on Firebase and enable Email/Password
- Lastly, enable the Firestore Database to store data
-
This repo has functioning persist user logic that maintains the user state. If the web app reload, Firebase auth checks for an acitve user object and maintains the logged in state.
-
Use the componenent PrivateRoute.js to control components that require a signed in user. When a private route is selected they will be reroute to the HomePage unless a user is logged in.
<PrivateRoute path='/example' component={ExamplePage} />