Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle committed Aug 21, 2019
0 parents commit 243d311
Show file tree
Hide file tree
Showing 10,224 changed files with 1,657,734 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
34 changes: 34 additions & 0 deletions .firebase/hosting.ZnVuY3Rpb25zXHB1YmxpYw.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
css/main.css,1552644881505,448d8abedf2859dd6f7e5e5dae75c303060478d14b45b7a9576aa1e221ffcf56
img/favicon_io/android-chrome-192x192.png,1552471562194,97b4579aff18f38f4e8932b4454028018469afd5d83ef921083a21d073485c5e
img/favicon_io/apple-touch-icon.png,1552471562098,d299970f2ddf2e3f7fc46caa2887da3a67de77ecfe9cc91cdea37f88288a98e0
img/favicon_io/favicon-16x16.png,1552471562132,ecf844000f0d923693ce095a4707848a9ea824efe54a7481469283d074a9418e
img/favicon_io/favicon-32x32.png,1552471562116,84bc0e800a9ed750977c27a51f1806dda9ec3c82916a3f49137c65f5394b1235
img/favicon_io/site.webmanifest,1552471562172,378695d4af8bdaf357a5e2404faa02cc43fde62b92e2cb35f19e143dea1a1816
js/constants.js,1552648581097,1ee503d5eff578e7161d9a50e0e615f11ccbe161866b74c578d05b56175a356d
js/common.js,1552648534858,fd57e259c4095deb30f6c6e0eb8d1b58bc7859d7b19b743bea283bc442f07c78
models/face_expression_model-weights_manifest.json,1550820029806,4cf374933f43f7d84b5799e1aa8503eb7324ecd667ca13c17eab7622c0a3cf4c
models/face_landmark_68_model-weights_manifest.json,1550820029809,eae47daa8bc666b61a0ea9e537282dae0faa4e774cc25ce60026fb83e261806b
models/face_landmark_68_tiny_model-weights_manifest.json,1550820029811,674f70768cbadd4990e7ecd3334fb881d4bda686799f709c4dd31bd0d892191a
img/favicon_io/favicon.ico,1552471562153,51fd16d4692943e378da6306030452c1c8fc99b1585f4275da3d273066128a77
models/face_recognition_model-weights_manifest.json,1550820029885,d09b31c6dd5fa90d48866fbb99f4571199b07536d6871e2ba1dc62944957dd29
models/mtcnn_model-weights_manifest.json,1550820029906,d6b120e105f3dbe97f23ad5dde977dcd4735e629d3597ee6174fce1e3248683f
models/tiny_face_detector_model-weights_manifest.json,1550820029957,ababb0797914bc91df47a04cae71f0b836243431a454c5a311465bd9c878fd58
models/ssd_mobilenetv1_model-weights_manifest.json,1550820029955,ea0219fd0e56a845585c2d0162b0429a470487e91c5db85c05456fc4fa3d96f4
views/index.html,1552670537850,a0c358038ba661a49e05f7e282dd8bc737cae609e0699eb753d8c236f08eed39
views/registration.html,1552670551941,4fd49f5eaca5255f4d907243be4155f0aed910f13dae52b428fa25e5c98ca887
views/take_attendance.html,1552649465717,abe74e9b876fabea5dc4718f7897292e71185cc68367c24497bb752901dad067
img/favicon_io/android-chrome-512x512.png,1552471562210,99405dda5364006b16614f725ff059e4b8e9861fd1a0ab55bb667ed9e8e07cc0
img/scantron.png,1552631303762,e096fc698336e8285afdbb4cb3f3501397db51ae0c372656b9320d6b702ae151
models/face_landmark_68_tiny_model-shard1,1550820029810,148f9148606b3126e44d56d0f027a1bf62a88010e82d7d70d55c6021ec3c2e64
views/404.html,1552650121464,ffa968e81e2ebfc1ba7ff443d933bdcd21daf771fc68a245a2f81dfad9f60c6b
models/tiny_face_detector_model-shard1,1550820029956,b0cfd40fa9d028e1d65d61b9a502b075e5b56c6edfaebcc82ed2e653d048b26d
dist/face-api.min.js,499162500000,96bbc60c900a34df4bc407aca067a3ba0c10a5956814d7ce4d10811746fe81e8
models/face_expression_model-shard1,1550820029806,6fe2e487b72dea9c166caa6e7c71436ab9a444699b1ab7d14970c11674d3d624
models/face_landmark_68_model-shard1,1550820029809,78034fbdce70ab6fc9cbcd2eddd5c48ca0d7073f2726c9a02b6884dbf30b815b
dist/face-api.js,499162500000,b93b6862bc1addab6baf517fc69bb7ec076044e53f9d15d10add7d0a49e4bfe1
models/ssd_mobilenetv1_model-shard2,1550820029954,8475624e39552231433b2928bcaf5da31669ff8c048ff1ccedc1d7ee064d7971
models/mtcnn_model-shard1,1550820029906,7e406b1d39d385a7f59a7cdbb6c7b6d7dc72bbe3dfc963e0adb82e6fd30200bf
dist/face-api.js.map,499162500000,dd6b948770781b9b2dcdcf15f390afc731408f5666e4a4d0a8f9cf0b40df012a
models/ssd_mobilenetv1_model-shard1,1550820029942,e6dcb8d9bd838fdefa21aa2ec956cec570aa1e685388d9f02c710e78ac636677
models/face_recognition_model-shard1,1550820029857,739b864f2ac242206ef93012bf6b7b2e187a977a6618775015238775b236c0f5
models/face_recognition_model-shard2,1550820029884,1fc625f865243f146bc7d08620c124156efdff09d5cc494ca93db13550cba2dd
35 changes: 35 additions & 0 deletions .firebase/hosting.cHVibGlj.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
css/main.css,1552644881505,448d8abedf2859dd6f7e5e5dae75c303060478d14b45b7a9576aa1e221ffcf56
img/favicon_io/android-chrome-192x192.png,1552471562194,97b4579aff18f38f4e8932b4454028018469afd5d83ef921083a21d073485c5e
img/favicon_io/apple-touch-icon.png,1552471562098,d299970f2ddf2e3f7fc46caa2887da3a67de77ecfe9cc91cdea37f88288a98e0
img/favicon_io/favicon-16x16.png,1552471562132,ecf844000f0d923693ce095a4707848a9ea824efe54a7481469283d074a9418e
img/favicon_io/favicon-32x32.png,1552471562116,84bc0e800a9ed750977c27a51f1806dda9ec3c82916a3f49137c65f5394b1235
img/favicon_io/site.webmanifest,1552471562172,378695d4af8bdaf357a5e2404faa02cc43fde62b92e2cb35f19e143dea1a1816
img/favicon_io/favicon.ico,1552471562153,51fd16d4692943e378da6306030452c1c8fc99b1585f4275da3d273066128a77
js/constants.js,1552648581097,1ee503d5eff578e7161d9a50e0e615f11ccbe161866b74c578d05b56175a356d
js/common.js,1552648534858,fd57e259c4095deb30f6c6e0eb8d1b58bc7859d7b19b743bea283bc442f07c78
models/face_expression_model-weights_manifest.json,1550820029806,4cf374933f43f7d84b5799e1aa8503eb7324ecd667ca13c17eab7622c0a3cf4c
models/face_landmark_68_model-weights_manifest.json,1550820029809,eae47daa8bc666b61a0ea9e537282dae0faa4e774cc25ce60026fb83e261806b
models/face_landmark_68_tiny_model-weights_manifest.json,1550820029811,674f70768cbadd4990e7ecd3334fb881d4bda686799f709c4dd31bd0d892191a
models/face_recognition_model-weights_manifest.json,1550820029885,d09b31c6dd5fa90d48866fbb99f4571199b07536d6871e2ba1dc62944957dd29
models/mtcnn_model-weights_manifest.json,1550820029906,d6b120e105f3dbe97f23ad5dde977dcd4735e629d3597ee6174fce1e3248683f
models/tiny_face_detector_model-weights_manifest.json,1550820029957,ababb0797914bc91df47a04cae71f0b836243431a454c5a311465bd9c878fd58
views/index.html,1552662102661,eded8174445cd9111eb6220de4d90baba7efffba6545b13b7bd825cda7644c30
models/ssd_mobilenetv1_model-weights_manifest.json,1550820029955,ea0219fd0e56a845585c2d0162b0429a470487e91c5db85c05456fc4fa3d96f4
views/registration.html,1552649262021,1bf306c50204453f07b5b1f77424e1cea73f0e0dad2161229381d3bd9dd75b9d
views/test.html,1552291720851,c9c8a723493a1cad4a07d27f70890c976166d17e990658ee9b621a2348a5add7
views/take_attendance.html,1552649465717,abe74e9b876fabea5dc4718f7897292e71185cc68367c24497bb752901dad067
img/favicon_io/android-chrome-512x512.png,1552471562210,99405dda5364006b16614f725ff059e4b8e9861fd1a0ab55bb667ed9e8e07cc0
img/scantron.png,1552631303762,e096fc698336e8285afdbb4cb3f3501397db51ae0c372656b9320d6b702ae151
models/face_landmark_68_tiny_model-shard1,1550820029810,148f9148606b3126e44d56d0f027a1bf62a88010e82d7d70d55c6021ec3c2e64
views/404.html,1552650121464,ffa968e81e2ebfc1ba7ff443d933bdcd21daf771fc68a245a2f81dfad9f60c6b
models/tiny_face_detector_model-shard1,1550820029956,b0cfd40fa9d028e1d65d61b9a502b075e5b56c6edfaebcc82ed2e653d048b26d
dist/face-api.min.js,499162500000,96bbc60c900a34df4bc407aca067a3ba0c10a5956814d7ce4d10811746fe81e8
models/face_expression_model-shard1,1550820029806,6fe2e487b72dea9c166caa6e7c71436ab9a444699b1ab7d14970c11674d3d624
models/face_landmark_68_model-shard1,1550820029809,78034fbdce70ab6fc9cbcd2eddd5c48ca0d7073f2726c9a02b6884dbf30b815b
dist/face-api.js,499162500000,b93b6862bc1addab6baf517fc69bb7ec076044e53f9d15d10add7d0a49e4bfe1
models/ssd_mobilenetv1_model-shard2,1550820029954,8475624e39552231433b2928bcaf5da31669ff8c048ff1ccedc1d7ee064d7971
models/mtcnn_model-shard1,1550820029906,7e406b1d39d385a7f59a7cdbb6c7b6d7dc72bbe3dfc963e0adb82e6fd30200bf
dist/face-api.js.map,499162500000,dd6b948770781b9b2dcdcf15f390afc731408f5666e4a4d0a8f9cf0b40df012a
models/ssd_mobilenetv1_model-shard1,1550820029942,e6dcb8d9bd838fdefa21aa2ec956cec570aa1e685388d9f02c710e78ac636677
models/face_recognition_model-shard1,1550820029857,739b864f2ac242206ef93012bf6b7b2e187a977a6618775015238775b236c0f5
models/face_recognition_model-shard2,1550820029884,1fc625f865243f146bc7d08620c124156efdff09d5cc494ca93db13550cba2dd
5 changes: 5 additions & 0 deletions .firebase/hosting.cHVibGljXHZpZXdz.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
index.html,1552638227148,00f06195b1c56ff3fd58338fe207ad18cd0b89af9975dc34eff6c49ef742c20f
test.html,1552291720851,c9c8a723493a1cad4a07d27f70890c976166d17e990658ee9b621a2348a5add7
take_attendance.html,1552649465717,abe74e9b876fabea5dc4718f7897292e71185cc68367c24497bb752901dad067
registration.html,1552649262021,1bf306c50204453f07b5b1f77424e1cea73f0e0dad2161229381d3bd9dd75b9d
404.html,1552650121464,ffa968e81e2ebfc1ba7ff443d933bdcd21daf771fc68a245a2f81dfad9f60c6b
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "divvy-eb390"
}
}
12 changes: 12 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"hosting": {
"public": "functions/public",
"rewrites": [
{
"source": "**",
"function": "app"
}
],
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
}
}
95 changes: 95 additions & 0 deletions functions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/* Dependencies */
const functions = require("firebase-functions");
const admin = require("firebase-admin");
const path = require("path");
const express = require("express");
const bodyParser = require("body-parser");

/* Initialisation */
const app = express();

/* Middleware */
app.use(bodyParser.urlencoded({ extended: false }));

/* Firebase Initialisation */
admin.initializeApp({
credential: admin.credential.applicationDefault(),
databaseURL: "https://meddic-57a28.firebaseio.com"
});
const database = admin.database();

/* Define directories */
const publicDir = path.join(__dirname, "public");
const viewsDir = path.join(publicDir, "views");

/* ================= GET Requests ================= */
// Home Page
app.get("/", (req, res) => res.sendFile(path.join(viewsDir, "index.html")));

// Registration Page
app.get("/registration", (req, res) => res.sendFile(path.join(viewsDir, "registration.html")));

/* ================= API: POST Requests ================= */
// New Student Registration
app.post("/api/newregistration", (req, res) => {
/* Sanitize */
const person = req.body;
const fullName = person.fullName.toString();
const nric = person.nric.toString().toUpperCase();
const gender = person.gender.toString();
const dateOfBirth = person.dateOfBirth.toString();
const drugAllergies = person.drugAllergies.toString();
const preExisting = person.preExisting.toString();
const comments = person.comments.toString();
const descriptors = person.descriptors;
const imageURL = person.imageURL;

regPatient(fullName, nric, gender, dateOfBirth, drugAllergies, preExisting, comments, descriptors, imageURL);

res.setHeader("Content-Type", "application/json");
res.end(JSON.stringify({ msg: "Successfully registered!" }));
return;
});

// Get students from Mod -> Group
app.post("/api/getpatients", (req, res) => {
let databaseRef = database.ref("patients");

databaseRef.once("value", function(snapshot) {
var array = [];
snapshot.forEach(function(childSnapshot) {
array.push(childSnapshot);
});
res.setHeader("Content-Type", "application/json");
res.end(JSON.stringify(array));
return;
});
});

/* Handle 404 */
app.use(function(req, res, next) {
res
.status(404)
.sendFile(path.join(viewsDir, "404.html"))
.end();
});

/* ================= Functions ================= */
function regPatient(fullName, nric, gender, dateOfBirth, drugAllergies, preExisting, comments, descriptors, imageURL) {
let databaseRef = database.ref("patients");
databaseRef = databaseRef.child(nric);

databaseRef.set({
fullName: fullName,
nric: nric,
gender: gender,
dateOfBirth: dateOfBirth,
drugAllergies: drugAllergies,
preExisting: preExisting,
comments: comments,
descriptors: descriptors,
imageURL: imageURL
});
}

exports.app = functions.https.onRequest(app);
15 changes: 15 additions & 0 deletions functions/node_modules/.bin/gcs-upload

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions functions/node_modules/.bin/gcs-upload.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions functions/node_modules/.bin/gp12-pem

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions functions/node_modules/.bin/gp12-pem.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions functions/node_modules/.bin/mime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions functions/node_modules/.bin/mime.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions functions/node_modules/.bin/pbjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions functions/node_modules/.bin/pbjs.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions functions/node_modules/.bin/pbts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions functions/node_modules/.bin/pbts.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions functions/node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions functions/node_modules/.bin/semver.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions functions/node_modules/.bin/sshpk-conv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions functions/node_modules/.bin/sshpk-conv.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions functions/node_modules/.bin/sshpk-sign

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions functions/node_modules/.bin/sshpk-sign.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 243d311

Please sign in to comment.