git clone https://github.com/codediodeio/angular-firestarter.git f2
cd f2
time npm install
# takes 13 minutes & 36 seconds on my computervim src/environments/environments.ts
cd functions/;npm install --save firebase-functions@latest
- https://console.firebase.google.com/
- Click + near the middle of the screen to add a new project.
- I'll name this one matt-f2 --- name yours whatever you like.
- Check the accept the controller-controller terms
- Click Create project
- Click continue and go to your project's URL -- Mine is https://console.firebase.google.com/project/matt-f2/overview
- Click the </> icon for web configuration.
- Copy the config object. You'll copy these values to the envrionment.ts files of the project (there are two of them).
- https://console.firebase.google.com/project/matt-f2/authentication/users and setup google authentication.
- https://console.firebase.google.com/project/matt-f2/database create cloud firestore database with rules in test mode.
- cd to the main root
ng serve
- http://localhost:4200
- Click login and use your google account
- Click firestore the upper right -- add a few notes
- Navigate from firestore.com project's database -- see that you've added a few records to the NoSQL datastore
npm install -g firebase-tools
# this is a one time setupfirebase login
# You're prompted via your web browserfirebase list
# lists your firebase projectsfirebase use matt-f2
# whatever project you are usingtime ng build
# takes 28 seconds on my computertime firebase deploy
# takes 2 minutes & 7 seconds on my computer- Visit https://matt-f2.firebaseapp.com login, make some notes, be happy.
- Improve the cloud firestore rules by requiring authenticated users:
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read: if request.auth.uid != null;
allow write: if request.auth.uid != null;
}
}
}
- The commit history of this work might interest you: https://github.com/payne/f2/commits/master