React Firebase Auth Example
React application example using React Router and Firebase Authentication.
Checkout the demo here.
Requirements
The following items are required to run this React application:
- Node.js version 6 or higher
- Firebase account
Installation
1. Clone the Repository
Clone this repository to your computer:
$ git clone git@github.com:risan/react-firebase-auth-example.git2. Install the Dependencies
On your terminal, go to the project directory and install all of the required dependencies:
# Go to the project directory.
$ cd react-firebase-auth-example
# Install all of the dependencies.
$ npm install
# Or if you prefer to use Yarn.
$ yarn install3. Configure the Firebase API Key
If you don't have the Firebase API key, you can go to their website at firebase.google.com and create a new account for free.
Copy the .env.example file:
cp .env.example .envOpen the .env file and set the REACT_APP_FIREBASE_API_KEY with your own Firebase API key:
REACT_APP_FIREBASE_API_KEY=YOUR_FIREBASE_API_KEY
4. Run the application 🎉
To run the application within the development mode, type the following command:
npm run start
# Or if you prefer to use Yarn
yarn startIt will start the development server. You can visit the application at localhost:3000. Play around with the code on src directory. The application will be reloaded automatically if you make any changes.
Other available commands:
# Build the application that is optimized for production.
$ npm run build
# Format the code with prettier.
$ npm run prettierLicense
MIT © Risan Bagja Pradana
