Firebase is a great JSON based realtime database that let's you easily bind their db objects to DOM objects - which plays very well with React.
This project was created using create-react-app
and assumes a basic understanding of React.
- You'll need to sign up for a Firebase account if you don't have one already.
- Create a Firebase project that you want to use for this.
- Get the config for your Firebase database from the Project Settings by clicking the big red button that says, Add Firebase to your web app.
- Replace the config object in
src/fire.js
with the config object from Step 3. - In the console, run:
npm install
npm install -g firebase-tools
(if you don't already have it)firebase init
- select Database and Hosting, then press Enter. Select the Firebase project that you created earlier. Keep the database rules file by pressing Enter. You'll want to use "build" for the public directory (for deploying with Firebase hosting), as this is the directory that has been optimized for production. Select yes to configure as a single page app. Do NOT overwrite the index.html file - type "N" and press Enter.
- When you're ready, in the console execute,
npm run deploy
(this is configured in the package.json file) orfirebase deploy
. - You can run the app locally by executing
npm start
.