# Documentation Regarding Neurotask_Web repo

### Introduction

The project is aimed at being a portal healthcare providers and patients of different backgrounds (with the primary aim being patients suffering from neurological disorders) to have a central place for contact with providers.

The project is spearheaded by [Chris Poellabauer](https://www.cis.fiu.edu/faculty-staff/christian-poellabauer/), a professor & graduate program director at Florida International University.

Long term goals involve implementing 1-to-1 video calls with appointment setups, where patients and providers are allowed to speak to eachother. The provider can then assign certain tasks or evaluations for the patient to complete whether on call or on their own time. This helps the provider evaluate the patient further in real-time.

The video calls can then use machine learning and facial recognition to pick up on certain "ticks" or gestures that a patient suffering from a neurological disorder is facing.

### Technology

#### Front End

The front end of the project uses Angular as the framework and it's written with TypeScript. The front end code mostly resides in the [src](./src/) folder.

The testing for the front end uses Jasmine as the test suite and Karma as the test coverage reporter and the UI.

#### Back End

The back end is verbose, it uses Firebase as the BaaS (Backend as a Service) that takes care of both Authentication, the database (Firestore), and the back end logic (useing Cloud Functions found in the [functions](./functions/) folder).

AngularFire is used as the SDK and abstraction layer for the firebase-sdk, it allows for Angular-Friendly technology such as Observables and tree-shakeability/modularity.

Most of the interactions regarding Firebase logic are done server-side with Cloud Functions (usually callable functions so that headers and authorization are taken care of by Firebase).

For more information, Firebase has a very detailed and well formatted documentation regarding their SDK. AngularFire also has documentation, however, not as up-to-date and formatted as Firebase.

### Current State

As of the end of the Fall 2023 semester, the project is in a MVP state that allows users to log in, register as patients or providers (providers pending approval of admins from the facility they registered for), view their portal (in an unfinished and raw state), and log out.

The back end is where most of the work is being done, utilizing Cloud Functions from Firebase to directly access the different suites available to us through their admin-sdk. Logic for logging in, user creation and registration, permissions and accessibility, and complex or specific Firestore queries that need to bypass the Firestore rules are done here.

### Long Term Desirables

We'd like future teams to build upon what we've built and continue to utilize Firebase as it is a very strong and evergrowing tool that takes care of many things for us, we just have to tailor our app to allow for its integration. We've laid the ground work for future teams to build upon and hope that the documentation helps.

### More Info

For specific information regarding each folder and what resides in there, use the `dev` folders that are sprinkled around in each module/folder for  more information. The code itself also has comments and documentational notes that follows TsDoc format.

With regards to actually coding in Angular or utilizing the different libraries found in the [package.json](./package.json), please visit their respective documentations found on their websites.

### Starting the App in Local

Please `cd` into the root of the app from the command line and `npm install` to grab all dependencies for the libraries found in the [package.json](./package.json).

To start the app in your local environment, please refer to the [package.json](./package.json) file under the `scripts` field.

There you will see a command called `npm start`, which runs a script that boots the Firebase Emulator environment, loads in the data found in [seed](./seed/) folder, and allows emulated calls and manipulation to a localized Firebase environment found on http://localhost:4000. 

You can alter the script to export data that's created in the emulator to the seed file, please refer to Firebase documentation to learn how to do so.

There are other scripts that are used, such as the testing script.

> For all other information regarding the project, refer to the `dev` folders within the other folders, or the [dev](./dev/) folder found in root regarding the project.