Angular / Firebase / Node.js

This guide will walk you through the setup, configuration, and usage of Angular / Firebase / Node.js, a robust SaaS boilerplate designed to accelerate your SAAS

Download repositories

Once you've purchased Nzoni, your github email account will be added to the related projects. Make sure you're already connected to github on your cli terminal or use Github Personal access token.

Download Angular repository

git clone https://github.com/nzoni-app/nz-angular-firebase.git

Download Node.js repository

git clone https://github.com/nzoni-app/nz-nodejs-firebase.git

Firebase Configuration

Create a Firebase account if you don't have one already, by visiting firebase.google.com.

  • Create a new project

  • Download the service key JSON file and place it at the root of your Node.js project with the name serviceAccountKey.json.

  • Enable Email/Password, Google, and passwordless email authentication.

  • Enable Firebase and create two indexes:

    • Collection ID: users

      • createdAt = Ascending

      • id = Ascending

    • Collection ID: plans

      • active = Ascending

      • position = Ascending

  • Activate Firebase storage

    • Set rules:

  • Set FIREBASE_PROJECT_ID in the .env file.

Installation

Install Node.js (if you haven't already)

If you haven't installed Node.js yet, you can follow the instructions here.

Install Node Modules for Angular project

Navigate to the downloaded Angular project repostiory:

Install Node Modules for Node.js project

Navigate to the downloaded Node.js project repostiory:

Configure Environment Variables

Node.js environnement

Node.js supports environment variables out of the box. You can set defaults in .env (for all environments), .env.development (for development), and .env.production (for production).

By default, there is the .env.example file. Rename it to .env modify variables

Angular Environnement

Edit src/environments/environnement.ts

Run

Angular

To start Angular project, simply run:

Angular instance is now running at http://localhost:4200/.

Node.js

Run the following command to start the server:

Node.js instance is now running at http://localhost:3000/.

Congratulations! Your Nzoni project is now running!

Last updated