https://github.com/collardeau/cra-firebase
Create React App with Firebase integration
https://github.com/collardeau/cra-firebase
firebase firestore react
Last synced: 11 months ago
JSON representation
Create React App with Firebase integration
- Host: GitHub
- URL: https://github.com/collardeau/cra-firebase
- Owner: collardeau
- Created: 2018-02-20T19:10:05.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-20T22:02:11.000Z (over 8 years ago)
- Last Synced: 2025-04-14T23:16:26.495Z (about 1 year ago)
- Topics: firebase, firestore, react
- Language: JavaScript
- Size: 145 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CRA-Firebase
[Create React App](https://github.com/facebook/create-react-app)
with some [Firebase](https://firebase.google.com/) functionality:
- automatic anonymous login
- firestore data hooks into react state via recompose
- cloud functions set up, with a `user().onCreate` trigger to create users in firestore.
## Get started
Clone the repo: `git clone https://github.com/collardeau/cra-firebase.git your-app`,
and update `package.json` with your app name
#### Set up Firebase
You might want to do this twice, for staging and production environments such as you have `my-app-staging` and my `my-app-production` as firebase projects:
- set ut your app at https://firebase.google.com
- enable anonymous login from the firebase console
- enable firestore (in test mode if you don't know about security rules)
- add your app configs to `src/config.js`
#### Install Firebase CLI
You'll need the firebase-tools installed globally, from which you can then login to your firebase account:
`npm install -g firebase-tools`
`firebase login`
#### Install the dependencies
`npm install` in the root folder AND in the `functions` folder as well.
**Make sure** you deploy the cloud functions before running the app, as this is used to create user profiles in firestore upon automatic login.
#### Deploy Cloud Functions
from the root folder:
`firebase use` to connect the right project, then:
`firebase deploy --only functions`
#### Devving
`npm run start` as per create-react-app.