The fastest way to build Angular + Firebase apps
How to setup and deploy
1 - Create a new scaffolding project and generate it
2 - Download the generated code
3 - Configure Firebase
3.1 - Create a Firebase project at the Firebase Console.
3.2 - Enable Firestore Database
- Go to Database
- Click at 'Try Firestore Beta'
- A popup will appear
- Click at 'Enable'
3.3 - Enable Storage
- Go to Storage
- Click at 'Enable'
3.3 - Enable Email/Password sign-in:
- At the Firebase console, open the Auth section.
- On the Sign in method tab, enable the Email/password sign-in method and click Save.
3.4 - Add the Firebase project id to the '<project-folder>/.firebaserc'.
3.5 - Configure the client side account's credentials:
- Go to the Firebase Project.
- Open 'Add Firebase to your web app'.
- Copy only the content of the var 'config'.
- Paste the content at the variable 'firebaseConfig' of both files '<project-folder>/frontend/environments/environment.ts' and '<project-folder>/frontend/environments/environment.prod.ts'.
3.6 - Configure the server side account credentials:
- Go to the Firebase Project.
- Click at the configuration icon, placed near 'Overview' at the left corner.
- Click at 'Project settings'.
- Open the tab 'Service accounts'.
- Open 'Firebase Admin SDK'.
- Click at 'GENERATE NEW PRIVATE KEY'.
- Save the file as <project-folder>/backend/service-account.json
3.7 - Configure email sender (Optional): In order to be able to send user invitation emails you need the SMTP credentials configured. It's optional, if you don't have it configured the app just won't send the emails.
- Open '<project-folder>/backend/package.json'.
- Locate the 'setup-config' and 'setup-config:production' scripts.
- Add the Client URL
- Add the SMTP credentials. See https://nodemailer.com for config options.
- Run the script: 'npm run setup-config' and 'npm run setup-config:production'.
4 - Setup project dependencies
4.1 - Download and install NodeJS
Go to https://nodejs.org/en/blog/release/v8.11.4/, download and install 8.11.4v of NodeJS.
4.2 - Open the console at the project folder
4.3 - Update de NPM
npm install -g npm
4.3 - Install firebase-tools globally
npm install -g firebase-tools
4.4 - Login at firebase-cli and add the project
firebase login
4.5 - Open the 'frontend' folder and run:
npm run deploy
4.6 - Open the 'backend' folder and run:
npm run deploy
5 - Open the application at the URL informed after first deploy
Contact: felipe@scaffoldhub.io