React application example using React Router and Firebase Authentication.
Checkout the demo here.
The following items are required to run this React application:
- Node.js version 6 or higher
- Firebase account
Clone this repository to your computer:
$ git clone git@github.com:risan/react-firebase-auth-example.git
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 install
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 .env
Open 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
To run the application within the development mode, type the following command:
npm run start
# Or if you prefer to use Yarn
yarn start
It 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 prettier
MIT © Risan Bagja Pradana