Skip to content

Angular 12/Firebase - Electronic Visitor register App for storing Host & Guest Records, Picture Attendance with GPS Locations, Contacts tracing using user's mobile phone

License

Notifications You must be signed in to change notification settings

AmitXShukla/Pandemic-Contact-Tracing-App

Repository files navigation

Pandemic Contact Tracing, Visitor Management, Mobile Assets/Employee Attendance App

- If you like this project, please consider giving it a star (*) and follow me at GitHub & YouTube.

Objective

An Electronic Visitor register App for storing Host & Guest Records, Picture Attendance with GPS Locations using user's mobile phone

Privacy is key

The idea of contact tracing prompts some concerns regarding medical privacy, and public health officials take those concerns seriously. They are ethically and, in most states, legally bound to protect the information and use it only for public health purposes.

This repository is updated to Angular 12, please download latest Angular and Typescript version. Also, please use NODEJS 14 version.

please don't forget to copy/update tsconfig.json as well.

Tools:

front-end: Angular 12
back-end: Google Firestore / Firebase
Pro Version: AI, Machine Learning Algorithm supported Advance features

send an email to [email protected] for Pro version enquiries.

Features

  1. Admin Panel Access
  2. Paperless Records for Visitors, Contact Tree and Host
  3. Save Visits with Pictures and GPS Locations
  4. Online and/or Offline App
  5. One App for multiple platforms (iOS, Android, Desktop, Cloud etc.)
  6. Instant access to ALL guest/host historical records at guest check-in.
  7. No Thumb expressions or card punching to verify identify.
  8. Auto Face Recognition (Pro version only).
  9. Live Contact instant Notifications (Pro version)
  10. Social Authentication
  11. Online and/or Offline (delayed capture) App
  12. One App for multiple platforms (iOS, Android, Desktop, Cloud etc.)
  13. Store and Access millions of records instantly
  14. Paperless and Mobile on-premise/private cloud App deployement
  15. Instant access to millions of current & historical records at anytime
  16. iOS/Android app (notification enabled) / Advance Custom features (Pro version only)
  17. Unlimited Storage (only limited to server/database hosting)

Let's get started :-

// Before we start, Please make sure you have latest version of node js installed.
// head out to https://nodejs.org/en/ and grab latest nodejs.
// Once you have nodejs installed, open command prompt/terminal window.

$ node -v // make sure, this command comes back with a node version
$ npm -v // make sure, this command comes back with a npm version

// How to Install NodeJS on Windows, Mac, Linux & ChromeOS
// First run
$ sudo apt-get update
// and then if needed
$ sudo apt-get install curl gnupg -y
// for nodejs version 14
$ curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
$ sudo apt-get install -y nodejs

// Install Angular CLI
$ npm install -g @angular/cli
$ ng -v // make sure, this command comes back with a npm version
$ mkdir app
$ cd app
$ ng new CTAPP
$ cd CTAPP
$ ng serve

Setup Google Firestore / Firebase Social Authentication

>> login to https://console.firebase.google.com
create a new project
choose Firestore as your database
Click on Authentication
>> Sign in Methods
>> enable Email/Password
>> enable Google
>> enable FaceBook Auth
  For Facebook authentication, you will need to create a new FaceBook App
  and create APPID and App Secret from Facebook Graph API

Setup Google Firestore / Firebase Database & Role / Rules

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if false;
    }
  match /VMS_LICENSE/{document} {
  // FIX READ later, it should only allow if user knows doc id
  	allow read: if true;
   allow read: if false;
   }
  match /VMS_USERS/{document} {
   allow read, write: if isDocOwner() || isAdmin();
   }
   match /VMS_DATA/{document} {
   allow read, write: if isSignedIn();
   }
   match /VMS_EMPLOYEE/{document} {
   allow read, write: if isSignedIn();
   }
   match /VMS_REGISTER/{document} {
   allow read, write: if isSignedIn();
   }
   match /VMS_CONFIG/{document} {
   // allow read, write, update: if isSignedIn();
   allow read, write, update: if true;
   // change this to isAdmin() later
   }
      // helper functions
    function isDocOwner() {
    // assuming document has a field author which is uid
    // Only the authenticated user who authored the document can read or write
    	return request.auth.uid == resource.data.author;
      // This above read query will fail
    // The query fails even if the current user actually is the author of every story document.
    //  The reason for this behavior is that when Cloud Firestore applies your security rules, 
    //  it evaluates the query against its potential result set,
    //   not against the actual properties of documents in your database. 
    //   If a query could potentially include documents that violate your security rules, 
    //   the query will fail.
    //   on your client app, make sure to include following
    //   .where("author", "==", this.afAuth.auth.currentUser.uid)
    }
    function isSignedIn() {
    // check if user is signed in
          return request.auth.uid != null;
    }
    function isAdmin() {
    return get(/databases/$(database)/documents/VMS_USERS/$(request.auth.uid)).data.isAdmin == true;
    }
}
}

Firebase/Forestore Storage Rules

rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      // fix these rules later to allow only authorized admin to read images
      allow read, write: if request.auth != null;
    }
  }
}

About

Angular 12/Firebase - Electronic Visitor register App for storing Host & Guest Records, Picture Attendance with GPS Locations, Contacts tracing using user's mobile phone

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published