A site locator application built using angular 7 (2+) and firebase.
Install Angular CLI tools
npm install -g @angular/cli
Create a new Angular application named angular-locus
ng new angular-locus
Add PWA (Progressive Web Application) support
ng add @angular/pwa --project=angular-locus
This will add necessary configurations to your angular application to enable PWA functionalities and features
Add/Replace necessary configurations on generated manifest.json
Add Angular Material module
ng add @angular/material
Add Bootstrap, Popper.JS and Jquery
npm install bootstrap popper.js jquery --save
Install Angular Google Maps
npm install @agm/core --save
Refer Angular Google Maps
Get your Google Maps API
from developer console and replace it in both environment
and environment.prod
scripts
export const environment = {
production: false,
googleMapsApiKey: 'YOUR_API_KEY'
};
Install Firebase CLI tools
npm install -g firebase-tools
Login to your Firebase account
firebase login
And enter your credentials. and after that initialize firebase configuration inside your project
firebase init
Install firebase dependencies for angular
npm install --save @angular/fire firebase
Create a project in Firebase and replace the api keys in both environment
and environment.prod
scripts
export const environment = {
production: false,
googleMapsApiKey: 'YOUR_API_KEY',
firebaseConfig: {
apiKey: 'YOUR_API_KEY',
authDomain: 'YOUR_AUTH_DOMAIN',
databaseURL: 'YOUR_DATABASE_URL',
projectId: 'YOUR_PROJECT_ID',
storageBucket: 'YOUR_STORAGE_BUCKET',
messagingSenderId: 'YOUR_MESSAGING_SENDER_ID'
}
};
Use the following command to serve your angular application locally
ng serve
Use the following command to build your angular application for production ready environment
ng build
Deploy to Firebase hosting service using the following command (Use this command after initializing all necessary firebase configurations in your repo)
firebase deploy