aboutsummaryrefslogtreecommitdiff
path: root/Report
diff options
context:
space:
mode:
authorTom Harley2018-04-10 09:31:58 +0100
committerTom Harley2018-04-10 09:31:58 +0100
commit44a943dcefac313011c57d125b78bebf36d11d49 (patch)
treee4b4f981ad96ec99d0bad17a87ec991c3ed2bda5 /Report
parentChange minor report things (diff)
downloadmedicine-44a943dcefac313011c57d125b78bebf36d11d49.tar.gz
medicine-44a943dcefac313011c57d125b78bebf36d11d49.zip

Rename folder ‘Report’ to ‘report’

Diffstat (limited to 'Report')
-rw-r--r--Report/Burn down Chart.xlsxbin10244 -> 0 bytes
-rw-r--r--Report/Makefile9
-rw-r--r--Report/appendix/minutes.tex68
-rw-r--r--Report/appendix/scrumboard.tex8
-rw-r--r--Report/biblio.bib189
-rw-r--r--Report/graphics/1.pngbin23078 -> 0 bytes
-rw-r--r--Report/graphics/2.pngbin76186 -> 0 bytes
-rw-r--r--Report/graphics/3.pngbin37309 -> 0 bytes
-rw-r--r--Report/graphics/4.pngbin17337 -> 0 bytes
-rw-r--r--Report/graphics/5.pngbin21343 -> 0 bytes
-rw-r--r--Report/graphics/6.pngbin28793 -> 0 bytes
-rw-r--r--Report/graphics/7.pngbin30848 -> 0 bytes
-rw-r--r--Report/graphics/burndown.pngbin21982 -> 0 bytes
-rw-r--r--Report/graphics/km-dash.pngbin97345 -> 0 bytes
-rw-r--r--Report/graphics/scrum.jpgbin1829499 -> 0 bytes
-rw-r--r--Report/graphics/scrum2.jpgbin1746169 -> 0 bytes
-rw-r--r--Report/graphics/scrum3.jpgbin1830134 -> 0 bytes
-rw-r--r--Report/graphics/scrum4.jpgbin164302 -> 0 bytes
-rw-r--r--Report/graphics/scrum5.jpgbin152855 -> 0 bytes
-rw-r--r--Report/graphics/title-logo.pngbin220102 -> 0 bytes
-rw-r--r--Report/main.tex38
-rw-r--r--Report/main.toc34
-rw-r--r--Report/preamble.tex13
-rw-r--r--Report/report.md303
-rw-r--r--Report/report.tex438
-rw-r--r--Report/texts/aims.tex7
-rw-r--r--Report/texts/conclusion.tex5
-rw-r--r--Report/texts/conversion.tex135
-rw-r--r--Report/texts/logging.tex38
-rw-r--r--Report/texts/minutes.tex72
-rw-r--r--Report/texts/process-management.tex56
-rw-r--r--Report/texts/scrum.tex17
-rw-r--r--Report/texts/testing.tex15
-rw-r--r--Report/texts/typings.tex27
-rw-r--r--Report/title.tex15
35 files changed, 0 insertions, 1487 deletions
diff --git a/Report/Burn down Chart.xlsx b/Report/Burn down Chart.xlsx
deleted file mode 100644
index 9fa607e..0000000
--- a/Report/Burn down Chart.xlsx
+++ /dev/null
Binary files differ
diff --git a/Report/Makefile b/Report/Makefile
deleted file mode 100644
index 135009b..0000000
--- a/Report/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-.PHONY: default clean FORCE
-
-default : main.pdf
-
-%.pdf : %.tex FORCE
- latexmk -pdf $<
-
-clean :
- latexmk -C
diff --git a/Report/appendix/minutes.tex b/Report/appendix/minutes.tex
deleted file mode 100644
index 44aa702..0000000
--- a/Report/appendix/minutes.tex
+++ /dev/null
@@ -1,68 +0,0 @@
-\section{Meeting Minutes}\label{app:meet}
-\begin{lstlisting}
-
-Group Project Meeting 1 post submission
-Date: 12/02/18
-Topics:
-Reassigning scrum roles
-Creating next set of tasks
-Task allocation
-
-Outcomes:
-* Scrum:
- * scrum master - Hafeez
- * project owner - Calum
-
-*Tasks:
- * Implementing endpoints
- * Implementing file conversions
- * Improving test coverage
- * Writing tests for untested sections
- * Connecting all middleware
- * Decide on how to deal with errors
- * Organising file-system
- * Creating a Linter to maintain a consistent file structure
-
-Group Project Meeting 2 Pre-sprint
-Date 19/02/18
-Topics:
-Define user stories
-Task allocation
-
-Outcomes:
-* Sprint
- * 2 Week long sprint
- * Mid sprint meeting set for 26/02/18
-* Images
- * Dealing with leica and zeiss files
-* Testing
- * Implementing unit and integration tests
-* Logger
- * Standard and SQL logger
-
-
-Group Project Meeting 3 mid-Sprint
-Date 26/02/18
-Topics:
-updating progress
-
-Outcomes:
-* Images
- * Continued work on image files
- * File extraction and testing
- * Stitching
-* Logger
- * Needed a better one to log problems
-
-Group Project Meeting 4 post-sprint
-Date 05/03/18
-Topics
-Final tasks required before deadline
-
-Outcomes:
- * Finishing off of the report
- * Finish testing
- * Process manager
- * Hosting on heroku
-
-\end{lstlisting}
diff --git a/Report/appendix/scrumboard.tex b/Report/appendix/scrumboard.tex
deleted file mode 100644
index e868278..0000000
--- a/Report/appendix/scrumboard.tex
+++ /dev/null
@@ -1,8 +0,0 @@
-\section{Scrum Board Images} \label{app:board}
-
-{
-\centering
-\includegraphics[width=\textwidth]{graphics/scrum.jpg}
-\includegraphics[width=\textwidth]{graphics/scrum3.jpg}
-\includegraphics[width=\textwidth]{graphics/scrum4.jpg}
-}
diff --git a/Report/biblio.bib b/Report/biblio.bib
deleted file mode 100644
index fdfc56b..0000000
--- a/Report/biblio.bib
+++ /dev/null
@@ -1,189 +0,0 @@
-@misc {tslint,
- howpublished = {https://palantir.github.io/tslint/},
- title = {TSLint},
- publisher = {Palantir Technologies},
- year = {2016},
- note = {Accessed: 2018-03-01}
-}
-
-@misc {protocol,
- howpublished = {https://github.com/CS3099JH2017/cs3099jh/tree/master/protocols},
- title = {CS3099JH2017 Protocol},
- publisher = {CS3099 Year Group of 2017/18},
- year = {2018},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {yarn,
- howpublished = {https://yarnpkg.com/en/docs},
- title = {Yarn},
- publisher = {Yarn Organization},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {typescript,
- howpublished = {https://www.typescriptlang.org/docs/home.html},
- title = {TypeScript},
- publisher = {Microsoft},
- year = {2017},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {sequelize,
- howpublished = {http://docs.sequelizejs.com/},
- title = {Sequelize},
- publisher = {Sequelize},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {sequelize-typescript,
- howpublished = {https://github.com/RobinBuschmann/sequelize-typescript},
- title = {sequelize-typescript},
- publisher = {Robin Buschmann},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {postgres,
- howpublished = {https://www.postgresql.org/docs/},
- title = {PostreSQL},
- publisher = {The PostgreSQL Global Development Group},
- year = {2018},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {mocha,
- howpublished = {https://mochajs.org/},
- title = {Mocha},
- publisher = {mochajs},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {mocha-each,
- howpublished = {https://github.com/ryym/mocha-each},
- title = {mocha-each},
- publisher = {ryym},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {chai,
- howpublished = {http://chaijs.com/api/bdd/},
- title = {Chai Assertion Library},
- publisher = {chaijs},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {chai-http,
- howpublished = {http://chaijs.com/plugins/chai-http/},
- title = {Chai HTTP},
- publisher = {chaijs},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {express,
- howpublished = {https://expressjs.com/en/4x/api.html},
- title = {Express 4.x},
- publisher = {expressjs},
- year = {2017},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {passport,
- howpublished = {http://www.passportjs.org/docs/},
- title = {Passport},
- publisher = {Jared Hanson},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {passport-local,
- howpublished = {https://github.com/jaredhanson/passport-local},
- title = {passport-local},
- publisher = {Jared Hanson},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {morgan,
- howpublished = {https://github.com/expressjs/morgan},
- title = {morgan},
- publisher = {expressjs},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {typedoc,
- howpublished = {http://typedoc.org/guides/usage/},
- title = {TypeDoc},
- publisher = {TypeStrong},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {xlsx,
- howpublished = {https://github.com/sheetjs/js-xlsx},
- title = {js-xlsx},
- publisher = {SheetJS},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {docker,
- howpublished = {https://hub.docker.com/},
- title = {Docker Hub},
- publisher = {Docker Inc.},
- year = {2016},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {@types,
- howpublished = {http://definitelytyped.org/},
- title = {DefinitelyTyped},
- publisher = {DefinitelyTyped},
- year = {2017},
- note = {Accessed: 2018-03-02}
-}
-
-@misc {strongloop,
- howpublished = {https://strongloop.com/},
- title = {StrongLoop},
- publisher = {IBM},
- year = {2018},
- note = {Accessed: 2018-03-07}
-}
-
-@misc {pm2,
- howpublished = {http://pm2.keymetrics.io/},
- title = {pm2},
- publisher = {KeyMetrics},
- note = {Accessed: 2018-03-07}
-}
-
-@misc {forever,
- howpublished = {https://github.com/foreverjs/forever},
- title = {foreverjs},
- publisher = {foreverjs},
- note = {Accessed: 2018-03-07}
-}
-
-@misc {sharp,
- howpublished = {https://github.com/lovell/sharp},
- title = {sharp},
- publisher = {Lovell Fuller},
- note = {Accessed: 2018-03-06}
-}
-
-@misc {sharpPerformance,
- howpublished = {http://sharp.pixelplumbing.com/en/stable/performance/},
- title = {Sharp Performance},
- publisher = {Lovell Fuller},
- note = {Accessed: 2018-03-06}
-}
-
-@misc {zeissLicence,
- howpublished = {https://www.zeiss.com/microscopy/int/products/microscope-software/czi/czi-download.html},
- title = {Apply for Zeiss Licence},
- publisher = {Carl Zeiss Microscopy GmbH},
- note = {Accessed: 2018-03-06}
-}
-
-@misc {openseadragon,
- howpublished = {https://openseadragon.github.io/docs/},
- title = {OpenSeadDragon},
- publisher = {openseadragon},
- note = {Accessed: 2019-03-07}
-}
diff --git a/Report/graphics/1.png b/Report/graphics/1.png
deleted file mode 100644
index 089b8ef..0000000
--- a/Report/graphics/1.png
+++ /dev/null
Binary files differ
diff --git a/Report/graphics/2.png b/Report/graphics/2.png
deleted file mode 100644
index 1714110..0000000
--- a/Report/graphics/2.png
+++ /dev/null
Binary files differ
diff --git a/Report/graphics/3.png b/Report/graphics/3.png
deleted file mode 100644
index 7eef8dc..0000000
--- a/Report/graphics/3.png
+++ /dev/null
Binary files differ
diff --git a/Report/graphics/4.png b/Report/graphics/4.png
deleted file mode 100644
index 8379ef7..0000000
--- a/Report/graphics/4.png
+++ /dev/null
Binary files differ
diff --git a/Report/graphics/5.png b/Report/graphics/5.png
deleted file mode 100644
index aeea913..0000000
--- a/Report/graphics/5.png
+++ /dev/null
Binary files differ
diff --git a/Report/graphics/6.png b/Report/graphics/6.png
deleted file mode 100644
index e3fb624..0000000
--- a/Report/graphics/6.png
+++ /dev/null
Binary files differ
diff --git a/Report/graphics/7.png b/Report/graphics/7.png
deleted file mode 100644
index a917d83..0000000
--- a/Report/graphics/7.png
+++ /dev/null
Binary files differ
diff --git a/Report/graphics/burndown.png b/Report/graphics/burndown.png
deleted file mode 100644
index f3ae71d..0000000
--- a/Report/graphics/burndown.png
+++ /dev/null
Binary files differ
diff --git a/Report/graphics/km-dash.png b/Report/graphics/km-dash.png
deleted file mode 100644
index 840395d..0000000
--- a/Report/graphics/km-dash.png
+++ /dev/null
Binary files differ
diff --git a/Report/graphics/scrum.jpg b/Report/graphics/scrum.jpg
deleted file mode 100644
index 4b5c911..0000000
--- a/Report/graphics/scrum.jpg
+++ /dev/null
Binary files differ
diff --git a/Report/graphics/scrum2.jpg b/Report/graphics/scrum2.jpg
deleted file mode 100644
index 231cf1f..0000000
--- a/Report/graphics/scrum2.jpg
+++ /dev/null
Binary files differ
diff --git a/Report/graphics/scrum3.jpg b/Report/graphics/scrum3.jpg
deleted file mode 100644
index 012e9b3..0000000
--- a/Report/graphics/scrum3.jpg
+++ /dev/null
Binary files differ
diff --git a/Report/graphics/scrum4.jpg b/Report/graphics/scrum4.jpg
deleted file mode 100644
index ab1f7a5..0000000
--- a/Report/graphics/scrum4.jpg
+++ /dev/null
Binary files differ
diff --git a/Report/graphics/scrum5.jpg b/Report/graphics/scrum5.jpg
deleted file mode 100644
index e79e828..0000000
--- a/Report/graphics/scrum5.jpg
+++ /dev/null
Binary files differ
diff --git a/Report/graphics/title-logo.png b/Report/graphics/title-logo.png
deleted file mode 100644
index 8a72423..0000000
--- a/Report/graphics/title-logo.png
+++ /dev/null
Binary files differ
diff --git a/Report/main.tex b/Report/main.tex
deleted file mode 100644
index dce9106..0000000
--- a/Report/main.tex
+++ /dev/null
@@ -1,38 +0,0 @@
-\input{preamble}
-
-\input{title}
-
-\begin{document}
-
- \maketitle
- \thispagestyle{empty}
- \newpage
- \setcounter{page}{1}
-
- \tableofcontents
- \newpage
-
- \input{texts/aims}
- \input{texts/scrum}
- \input{texts/conversion}
- % \input{texts/protocol}
- % \input{texts/auth}
- \input{texts/logging}
- \input{texts/process-management}
- \input{texts/testing}
- \input{texts/typings}
- \input{texts/conclusion}
-
- \appendix
- \newpage
- \input{appendix/scrumboard}
- \newpage
- \input{appendix/minutes}
-
- \clearpage
-
- \nocite{*}
- \bibliography{biblio}{}
- \bibliographystyle{plain}
-
-\end{document}
diff --git a/Report/main.toc b/Report/main.toc
deleted file mode 100644
index c9dcd7b..0000000
--- a/Report/main.toc
+++ /dev/null
@@ -1,34 +0,0 @@
-\contentsline {section}{\numberline {1}Aims for submission 2}{2}
-\contentsline {section}{\numberline {2}Continued use of Scrum}{2}
-\contentsline {subsection}{\numberline {2.1}Sprints}{2}
-\contentsline {subsection}{\numberline {2.2}Scrum board}{2}
-\contentsline {subsection}{\numberline {2.3}Meetings}{3}
-\contentsline {section}{\numberline {3}File Conversion}{3}
-\contentsline {subsection}{\numberline {3.1}Dealing with Images}{3}
-\contentsline {subsubsection}{\numberline {3.1.1}Extraction of Zeiss Within `C'}{4}
-\contentsline {subsubsection}{\numberline {3.1.2}Converting Extracted Files}{4}
-\contentsline {subsubsection}{\numberline {3.1.3}Stitching Base Tiles}{4}
-\contentsline {subsubsection}{\numberline {3.1.4}Building Up Hierarchy of Zoom Levels}{5}
-\contentsline {subsection}{\numberline {3.2}Leica \& Other Formats}{5}
-\contentsline {subsection}{\numberline {3.3}Non image formats (\texttt {.csv} etc.)}{5}
-\contentsline {section}{\numberline {4}Logging}{6}
-\contentsline {subsection}{\numberline {4.1}Standard Logging}{6}
-\contentsline {subsection}{\numberline {4.2}SQL Query Logging}{6}
-\contentsline {subsection}{\numberline {4.3}Motivation}{6}
-\contentsline {section}{\numberline {5}Process Management and Deployment}{6}
-\contentsline {subsection}{\numberline {5.1}Process Manager Selection}{6}
-\contentsline {subsection}{\numberline {5.2}pm2 and KeyMetrics}{6}
-\contentsline {subsection}{\numberline {5.3}Process Limitations}{7}
-\contentsline {subsection}{\numberline {5.4}Heroku Hosting}{7}
-\contentsline {subsection}{\numberline {5.5}External System Hosting}{7}
-\contentsline {section}{\numberline {6}Testing}{7}
-\contentsline {subsection}{\numberline {6.1}Structure}{7}
-\contentsline {subsection}{\numberline {6.2}Integration Testing}{8}
-\contentsline {subsection}{\numberline {6.3}Unit Testing}{8}
-\contentsline {section}{\numberline {7}Type Enforcement}{8}
-\contentsline {subsection}{\numberline {7.1}mocha-each}{8}
-\contentsline {subsection}{\numberline {7.2}pmx}{8}
-\contentsline {section}{\numberline {8}Conclusion}{9}
-\contentsline {subsection}{\numberline {8.1}Next Tasks}{9}
-\contentsline {section}{\numberline {A}Scrum Board Images}{10}
-\contentsline {section}{\numberline {B}Meeting Minutes}{12}
diff --git a/Report/preamble.tex b/Report/preamble.tex
deleted file mode 100644
index 14787a9..0000000
--- a/Report/preamble.tex
+++ /dev/null
@@ -1,13 +0,0 @@
-\documentclass{article}
-
-\usepackage[margin=1in]{geometry}
-\usepackage{a4wide}
-
-\usepackage{graphicx}
-\graphicspath{{./graphics/}}
-
-\usepackage{float}
-\usepackage{listings}
-\usepackage{cite}
-
-\def\file{\texttt}
diff --git a/Report/report.md b/Report/report.md
deleted file mode 100644
index 323c98e..0000000
--- a/Report/report.md
+++ /dev/null
@@ -1,303 +0,0 @@
-# Junior Honours Project 2017 - 2018
-## BACKEND GROUP 4.
-|User ID | Name | Matrticulation Number |
-|:------:|:--------:|:----------------------:|
-|cjd24 | Calum | 150011830 |
-|trh | Tom | 150001937 |
-|har4 | Hafeez | 160006551 |
-|jl247 | Josh | 150010415 |
-|jw255 | Johannes | 140013112 |
-
-
-
-
-
-
-### Requirements Overview:
-For every version you submit, you are required to submit the following to MMS as a team:
-
-1) A working version of your software, which includes a test suite. By version we
-mean a version of the finished product. It is up to you to decide how you have divided
-the entire finished product into versions.
-
-2) A report which details how you have followed the SCRUM process.
-
- It should include:
-
- a) A list of all user stories contained in your Product Backlog and Release Backlog;
- this is expected to evolve from version to version.
-
- b) Documented evidence that you have followed SCRUM, e.g., timestamped photographs of
- your Product Backlog, Release Backlog, Sprint Backlogs, and task boards (if you
- are using a physical whiteboard), or timestamped screen grabs of any tools you
- are using instead.
-
- c) The process you used to estimate how long user stories would take to implement.
- A burndown chart should also be included to track progress.
-
- d) Team structure and role assignment
-
- e) Meeting outcomes: sprint planning, sprint retrospective, and an overview of
- stand-up meetings (i.e. meetings don’t need to be documented individually)
-
-3) You should then demo the working version of your software to your supervisor at
- one of your regular meetings.
-
-
-
-
-
-
-### Design Choices:
-- Scrum
-Using the scrum approach as advised by the project specifications facilitated the planning and running of group meetings. As the year wide protocol continued to change throughout the development process, an agile working process addressed the complex problem of changing requirements through its iterative and incremental system.
-One of the essential parts of this process was distribution of responsibility, planning of time and ordering of tasks for the next release. Oftentimes we had to spend some time researching a topic before we could decide on the task allocation and if it should be included in the next release. For example, we decided early on that the file-conversion was less important... **To be continued**
-**MORE SHOULD BE SAID HERE PLZ?**
-
-- Database
-We chose to use Postgres for our database system, after considering the benefits and drawbacks of different databases compatible with NodeJS. Its greatest advantage is its object-relational data model, JSON support and scalability. We also decided that it would be significantly less efficient to store our raw files inside the database as Blobs etc. This is because the nature of the files that we will be dealing with are likely to be huge. So storing masses of binary data in the database which is likely to never actually be "edited" in the same way as some other binary data might, then it would be a significant overhead for no return. As such we opted for designing our infrastructure in such a way that we will have a (nearly) '*flat*' filesystem, where all files are stored under a UUID. All notion of "directory hierarchy" and "filenames" would be stored internally with relations in the database. As possible extensions, we could then store direct references to files (or perhaps even offsets within files) to act as a very high performing cache server for frequent data, or data that we could predict is going to be accessed in short time proximity.
-
-- File management
-
--- Folders
-A part of the specification required the use of folders to group together files in a project. The issue I first came across were how folders not just contained other files but would quite often have other folders inside them as well. My second issue was navigating through the folders to get to the files, this meant that given a folder you could return the contents of that folder as well as being able to find all other files at the same level in the system.
-
-To manage my first issue I included a table called dirent with an inheritance relation so that a dirent could either be a folder, image or text. Having this table made it easy to query on data as well as better representing how files could be stored within folders. This meant that a folder would be related to a dirent which could then be linked to the specific type on creation.
-
-There were two ways to manage the navigability, either store the file path with each dirent or store the ID of the superfolder it was contained in, I decided on storing the ID. This created a link system and to therefore view files within a folder you would search all files which had the same ID as the super folder.
-
-E.g 1) To locate an image called image1 at folder1/folder2/folder3/image1 to find it you would use the queries
-
-SELECT * FROM dirent NATURAL JOIN folder WHERE folder_name = 'folder1' AND super_folder is null AND project_name = 'project 1';
-SELECT * FROM dirent WHERE super_folder = '77dea3b7-523e-463a-aff1-3d8b92259fbb';
-SELECT * FROM dirent WHERE super_folder = '12596fe5-2838-4cc0-8d2f-4745e91738f5';
-SELECT * FROM dirent NATURAL JOIN image WHERE super_folder = '22b94214-6942-40dd-b8af-deb1371fa298';
-![Alt text](1.png?raw=true "eg1")
-
-From this directory if you wanted to find dirents contained within folder 2 you could use the queries
-
-SELECT * FROM dirent WHERE id = '22b94214-6942-40dd-b8af-deb1371fa298';
-SELECT * FROM dirent WHERE super_folder = '12596fe5-2838-4cc0-8d2f-4745e91738f5';
-![Alt text](2.png?raw=true "eg1_cont")
-Showing all three dirents in this folder.
-
--- File identification
-In choosing the ID for the files I originally had an auto increment ID. The issue with this would be that a hazardous user could guess the ID of a specific file, accessing files without the required permission. To get around this I used a randomly generated UUID. This made it almost impossible to guess the ID and is universally unique.
-
--- File storage
-Originally I thought of storing files within the database in blob format although this seemed to work well I felt that the scalability of this method would be not be effective. I also felt that it would be a lot harder to backup the database as the number of files grew. Instead the database contained the structure of the file system with info for each file including the UUID for each file. This made it easy to return files from our own file storage system with matching UUID each time a request was made.
-
--- Projects
-Another requirement of the database was the need for projects which also helped group together files. A user could also have per project privileges such as adding files into that project. To manage this, on creation of a project it was given an owner matching the current logged in user. I created a trigger which also granted all permissions (admin) to the owner giving them control over the permissions for their project.
-
-E.g 2) using
-INSERT INTO project ("project_name", "owner") VALUES ('project 1', 'josh')
-Would give all permissions to josh in project 1.
-
-
-
-- User management
-
-Once the file system had been set up I wanted to have a robust user permission system that would consistently allow the API to check permissions.
-
-Permissions were split into 2 types
-User based permissions.
-The user based permissions were create project, create user, remove user , edit user, view projects and view users.
-
-Project based permissions.
-The project based permissions were add files, edit files, remove files and view files (remove project could also be included here but I decided to make that only accessible to the owner and an admin user) This was more difficult because each user would have different privileges on different projects.
-
--- Set up
-My initial thought was to have columns for each permission in the user table. I soon realised this was hard to manage once revoking privileges is implemented. I decided on creating a tree system for user permissions similar to how the database manages its own privileges. This meant that if one user granted many permissions and then had their own permission removed, all user permissions granted by the revoked user would also be removed. I decided to represent this by having a table for each permission. There were two main reasons for this
-
-1) This made it easy to check permissions e.g to check whether a user had add file permissions you would just go into the add_files table and check whether it contained a row corresponding to that user.
-
-2) On each grant the permission ID is stored as a foreign key of its own table representing how a specific user was given that permission . This meant that if a user was deleted or a privilege was revoked it would also remove privileges of sub grants by using ‘on delete cascade’
-
-E.g 3) the image below shows the table add_files
-![Alt text](3.png?raw=true "add_files")
-Josh granted permission to user 2 who then granted permission to both user 3 and back to user2. When user 2 has his permission revoked both permissions that were granted by user 2 are also revoked.
-![Alt text](4.png?raw=true "granted permissions")
-
-
--- Returning all permissions for each user
-On looking at the specification it seemed clear that there were a lot of API requests to get all permissions that a user had been granted. By storing the permissions in their own table required searching every single table every time you wanted to do this which would be ineffective. Combining this with my original idea I created a summary table, if a user was then granted a permission it was added into the summary table with the permission ID by means of a trigger. This meant a slower insert but was highly beneficial in being easy to search. The combination of these two methods kept the system robust whilst making it easy to query on.
-
-Ex 4) Following on from example 2 it is now easy to see how all the permissions are given to a user when a project is created.
-![Alt text](5.png?raw=true "eg4")
-Also if josh grants permission to user2 to add files you can see below the permission is added.
-![Alt text](6.png?raw=true "eg4_cont")
-When the permission is revoked that column for user2 is set null.
-![Alt text](7.png?raw=true "eg4_cont2")
-
--- User information
-In order to login the user the user table contains a password to each user. This password was stored md5 hashed. (I also want to add salting for a later hand in for additional security).
-Also in the user data is metadata both private and public that could be seen/ managed based on your own permissions or whether you are viewing yourself. I used views to represent the different accesses on the user table to prevent things such as password being included in the query result. I also stored this metadata as Json type instead of individual columns for each attribute. This made it easier to match the expected request format and also helped group together the metadata.
-
-
-
-- Server
-For the implementation of the server, we chose a typescript-nodejs approach. NodeJS seemed a common and sensible choice, as all members of the team had previous experience and it is a scalable, and well-supported development framework that runs on both Unix and Windows infrastructures. It is easy to deploy and furthermore offers more speed and a nonblocking I/O API in comparison to Java or .Net servers. We then chose the TypeScript superset of JS as it provides typing, classes, interfaces and IDE support for developers which makes the language easier to use and more robust. In particular we chose to specialise our node app with express, and a comprehensive middleware stack. This middleware stack would carry out tasks such as logging, body parsing, type checking, with potential to be expanded as the project matures. We also decided on Sequelize as our ORM. This was due to wide support in the deployment community with favourable reviews of its functionality - as well as having a specialisation called sequelize-typescript, which massively simplifies syntax, and appeared to integrate to our design model very nicely.
-
-- Project Approach and Expansion
-Once most of the core decisions had been made in isolation of the incorporation into the submission as a whole, we had a **meeting** to decide how these should best operate together.
-The approximate approach that was decided on is as follows:
- - The Node Server would catch all valid API endpoint requests and pass them to handler functions.
- - Since almost all requests that are made to the server, some way or another need to talk to the database, then during initialisation of the server, a connection would be made to the postgres database, which would persist throughout the life of the server. This connection would then be utilised by our ORM solution to carry out queries.
- - The request would be formulated through the ORM (or by direct file access for things like server config.) and then passed to the DB serer.
- - The response would hopefully be ready as we require it, however at this stage there can be logical checks done of the data if necessary.
- - We would then run it through some typechecking middleware to ensure that the content that we are serving back to a client is valid JSON.
- - The Response would be served back to the client and the request would be considered *successful*.
-
- Expansion:
- - Once the basic implementation according to the protocol was complete, it was discussed on multiple occasions, and in detail of possible ways to make this core service better.
- - Building on the ATOMIC nature of a database transaction, and given the Users deployment scenario - multiple research facilities potentially across multiple geographically diverse locations, we thought it would be critical to allow the database to have multiple instances operating concurrently.
- - Approximately how this would look, is that clients talk to the backend server they are physically closest to on the network for the best possible latency.
- - Since there can be multiple nodes however to serve clients in different locations, then the servers would then need to make best attempt to synchronise in an Atomic manner.
- - This would make our system far more scalable in the future, and may have potential applications for things such as a "live" backup server - since medical data is all fairly critical.
- - On top of the transactions to the Database being atomic and synchronised across all instances of the server, we would additionally need to consider the physical distribution of file storage.
- - Since we made the design decision to store all of the actual files, outside of the database, then keeping ATOMIC communication to each instance server, does not necessarily solve the issue of file replication.
- - For example, if a memeber of a group is working on a node other than the "root" node where that project was created and all of the data happens to be stored for it, then we will need to include some kind of notion of a "server reference" for each file known about by the database.
- - Then, if a client made a request for data not locally stored, it could either be re-directed by the server to the other node, or the server forwards the request then pipes it back to the client.
- - Alternatively as a further specialisation of this functionality, the server could intelligently detect related data to the "foreign" request being made, and pre-emptively load in the data from the alt server, so it is ready to serve future data locally. This data could be cached locally and used, then re-synchronised if changes were made back to the original, or dropped if it was just for reading. It is likely however that most of these interactions will be reads, so things like carrying out a machine learning session on some data, would only require the (probably) smaller file containing the results to be synchronised back which is a much easier task as it would likely just be new file upload to the remote server.
-
-
-
-
-
-
-
-### Year Wide Protocol Compilation:
-As part of this practical, a final solution to the over-arching problem is that the end-user
-should be able to "*pick-n-mix*" one submission from each [Backend, HCI, Machine Learning].
-In order to successfully achieve this, all of the participating groups throughout the year
-are required to formulate between themselves and agree upon a single protocol for each
-component to talk over.
-Various meetings were organised on a variety of topics between members who were interested
-in affecting the outcome. Minutes of these meetings can be seen at:
-[Maybe Here?](https://github.com/CS3099JH2017/cs3099jh)
-**We should also probably detail roughly what was said at each of these meetings/summaries etc? GET THE RECORDED DATES**
-
-
-
-
-
-
-
-
-
-### Scrum:
-After groups were eventually allocated for this group project, the team met up quickly to
-discuss the **Scrum** method of doing work, and figure out how roles should be shared amongst
-the team members.
- Team Structure and Role assignment
- -Supervisor -> Adam
- -Scrum Master -> Tom
- -Product Owner -> Calum
- -Developer -> Hafeez
- -Developer -> Josh
- -Developer -> Johannes
-
-It was initially decided that Tom would be the "Scrum Master", and Calum would be the
-"Product Owner", and that the roles would be rotated around other group members,
-approximately bi-weekly.
-A quick brainstorming session was then had to interpret our specification and quickly fill
-in the User Epic stories, along with some more decomposed stories and requirements.
-As the specification requires, the following is a list of the stories the group came up with.
-
-
-(Time Est | Time taken)
-- User Epic stories ------- (Continuous)
- - Create a "plug and play" module, providing backend functionality to the clients requirements. ------- (Continuous)
- - Conform to a year-wide protocol specification to ensure inter-operability. ------- (Continuous)
- - Support the notion of 'Projects', 'Users' with specialisations such as Admin, 'Conversion to Standard File Formats'. ------- (Continuous)
- - Be Complete by 23rd April 2018.
- - First Release 9th February 2018
-- Design ------- (2-3 Weeks | 3 Weeks)
- - Design Test Interface ------- (3 Days | 1 Week)
- - Separation of Machine Learning tests & HCI tests. ------- (1 Day | 3 days)
- - Plan what mocks of other groups are required to ensure usability. ------- (2 Days | 4 days)
- - Design Server ------- (1 week | 1.5 Weeks)
- - Stubs for conforming to protocol ------- (1 Day | 3 Days)
- - Structure and Core Packages ------- (5 Days | 1 week)
- - Language(s)? we will use & why. ------- (1 Day | 1 Day)
- - Design Database ------- (1 week | 1.5 Weeks)
- - Which database will we use? ------- (1 Day | 1 Day)
- - Schema ------- (2 Days | 2 Days)
- - ER Diagram ------- (5 Days | 1 Week)
-- Implementation ------- (Continuous)
- - Database Implementation ------- (~3 Weeks)
- - Interface/Linking with the root to the file system. ------- (3 Days)
- - Notion of Secure Access for the database. ------- (1 Week)
- - Dealing with various filetypes - Conversion / Standardisation for storage. ------- (2 Days)
- - Standard procedures for fetching. ------- (2 Days)
- - Deal with Storing Image Data (+ other binary formats?) / JSON. ------- (5 Days)
- - Deal with storing plain text + tabular data. ------- (5 Days)
- - Create Database from schema ------- (3 Days)
- - Server Implementation ------- (~1.5 Months | 2 Months)
- - Setup initial HelloWorld Sever to ensure correct installation & dependencies. ------- (1 Day| 1 Day)
- - Create Strong/Reliable link between server functions and underlying filesystem for database. ------- (1 Weeks | 2 Weeks)
- - Create Strong/Reliable link between server functions and the database. ------- (5 Days 1 Week)
- - Create pre-processing functions to standardise Data passed in. (images->png & plaintext->csv/json) ------- (1 Week | in proc.)
- - Deal with responses to a client ------- (4 Weeks | in proc.)
- - Involving continuous file transfer (For example, whilst panning Large Pathology photos.) ------- (1 Week)
- - Involving 'simple' file transfer (getting whole file at once for csv etc.) ------- (1 Week)
- - Involving file uploads All at once. ------- (1 Week)
- - Involving file uploads in chunks for files above 8Mb. ------- (1 Week)
- - Create Node "router" to capture all required URLs and forward to functions to handle based on protocol. ------- (1 Day)
- - Create Basic error response functions which can be called from anywhere to deal with any potential problems and safely respond to client. ------- (2 Days)
-- Testing ------- (9 Weeks | in proc)
- - Server Testing ------- (3 Weeks | in proc)
- - Create methods to test logic of JS/TS which can be re-run on each commit ------- (2 Weeks | in proc)
- - From Backend's perspective ------- (1 Week | 2 Weeks)
- - From HCI's perspective ------- (1 Weeks | in proc)
- - Create unit tests for individual files can be re-run on each commit ------- (1 Weeks | 1 Weeks)
- - Database Testing ------- (2 Weeks | in proc.)
- - Carrying out Optimisations/Streamlining ------- (5 Days)
- - Profiling of performance of UnCommon Actions (delete) ------- (4 Days)
- - Profiling of performance of common actions (file creation/file reads) ------- (4 Days)
- - Accuracy of file retrieval ------- (1 Day)
- - TestInterface Implementation ------- (2 Weeks | 2 Weeks)
- - Create HTML5/JS to retrieve NON image data and display ------- (1 Day | 2 Days)
- - Create HTML5/JS to retrieve image (or section of) data and display ------- (1 Day | 4 Days)
- - Create HTML5/JS to begin an ML session on some data and retrieve results. ------- (1 Day | 1 Day)
- - Create HTML5/JS to check a user/group information ------- (1 Day | 1 Day)
- - Create HTML5/JS to upload various filetypes and ensure they convert to universal format. ------- (1 Day | 2 days)
- - Create HTML5/JS to action a login ------- (1 Day | 2 days)
-- Extension Implementation ------- (~3 Weeks | outstanding)
- - Develop a Caching function for frequently accessed files, or anticipate UUIDs next to be accessed for increased performance. ------- (1 Week)
- - Extend our basic server implementation, to support multiple instances and ensure ATOMICity of DB and sensible file distribution. ------- (2 Weeks)
- - Upgrade all HTTP interactions to HTTPS ------- (2 Days)
- - Add support for Lecia file conversion (heavily licenced) ------- (2 Weeks)
-
-
-Additionally as part of following the scrum methodology of development, the group carried out a selection of meetings to:
-1) Evaluate the current sprint (Work complete, standard, sprint time etc.
-2) Retrospectively plan anything with crept up throughout the past sprint, and evaluate how we dealt with it.
-3) Catch up with each others' progress and decide on work distribution
-The Following is a quick summary of these meetings:
-
-> Meeting 1:
-> > Date:
-> Time:
-> Attendance:
-> Content :
-
-> Meeting 2:
-> > Date:
-> Time:
-> Attendance:
-> Content :
-
-# Need to upload the pictures of our scrum board to the repository/report!
-# ALSO need to upload our burn-down charts to this report.
-
-
-
-
-
-### Sources:
-[Help regarding creating a restful api with both node and typescript as a combo](http://mherman.org/blog/2016/11/05/developing-a-restful-api-with-node-and-typescript/#.WlW1fhdpw8o)
-[Typescript for Node](https://basarat.gitbooks.io/typescript/docs/quick/nodejs.html)
-[Sequelize (ORM library for connecting to the Postgres Database)](https://sequelize.readthedocs.io/en/v3/)
-[Sequelize-Typescript specialisation (For making sequelize more adapted for postgres over mysql)](https://github.com/RobinBuschmann/sequelize-typescript)
diff --git a/Report/report.tex b/Report/report.tex
deleted file mode 100644
index dae5b11..0000000
--- a/Report/report.tex
+++ /dev/null
@@ -1,438 +0,0 @@
-\documentclass{article}
-\usepackage[margin=1in]{geometry}
-\usepackage{graphicx}
-\usepackage{a4wide}
-\usepackage{float}
-\usepackage{listings}
-
-\graphicspath{graphics}
-
-\begin{document}
-\title{Report --- Juniour Honours Project Submission 1}
-\author{Hafeez Abdul-Rehaman, Johannes Weck, Josh Lee, Calum Duff, Tom Harley}
-\date{\today}
-
-\maketitle
-
-\tableofcontents
-
-\section{Requirements Overview}
-For our Junior Honours project, we are to design and create a database
-for a system which will be used primarily for the sharing and viewing
-of various medical and pathological media.
-
-Our database is to be:
-\begin{description}
- \item[User-aware] The system should act as a platform for managing
- users and their permissions, with respect to viewing and affecting
- projects and media.
- \item[Filetype-agnostic] The system should accept files in a
- variety of filetypes and be able to translate between them, in order to
- provide a user with a desirable output filetype.
- \item[Substitutable] The system should follow standardised
- communication protocols, to participate in a framework of modularised
- systems created in conjunction with other Junior Honours groups.
-\end{description}
-
-\section{Using Scrum}
-The Scrum approach facilitated the
-planning and running of group meetings. As the year-wide protocol changed
-over time, an AGILE working process provided the granular iteration
-required to address the frequent design changes.
-
-\subsection{Scrum Board}
-Throughout the project a Scrum board has been used to keep track of current tasks
-and further items to implement. A whiteboard in the John Honey main computer lab
-was used throughout this process. Examples of the board in use can be found in
-Appendix \ref{app:board}.
-
-The Scrum board made visualizing tasks and progression straightforward.
-Using it in meetings helped with determining how much was still to be done.
-
-At times the \emph{In Progress} section of the Scrum board seemed unbalanced;
-at these times several people were working on the same large task, and so fewer
-notes were placed in this column.
-
-\subsection{Time Management}
-Based on how tasks were split, and the difficulty of various tasks, we estimated
-durations for each task. Due to the widely-varying estimated completion times,
-we decided to distribute our Sprint durations accordingly.
-Initially, we divided our total available time with the number of available tasks,
-but over time experience from previous work and from previous meetings was helpful in
-refining the expected duration of the future tasks.
-This, combined with
-the late reveal of the specification meant that work was done over holidays, greatly
-warping the duration of several Sprints to be longer than anticipated.
-
-\begin{figure}[H]
-\centering
- \includegraphics[width=\linewidth]{graphics/chart.png}
- \caption{A Burn Down chart graphically representing average completion time of tasks}
- \label{fig:burndown}
-\end{figure}
-
-\subsection{Meetings}
-Meetings were held every 1-3 weeks with the entire team.
-They were carried out in person or, during the holidays, using
-voice chat clients.
-
-Meetings helped members of the team understand what was being done by
-other members of the team, particularly in areas were only one person
-was working. They also helped the team decide on what was important to
-attempt in the next Sprint.
-
-The minutes for formal meetings are available in Appendix \ref{app:meet}.
-
-\subsection{Paired Programming/Teamwork}
-Paired Programming was used extensively throughout implementation of basic server
-functions, such as writing logic for the public protocol endpoints.
-
-Multiple people working on a single task reduces the total actual time it takes to
-complete. This allowed larger tasks that would not normally fit into a regular Sprint
-to still be tackled within a single Sprint.
-
-At times the entire team was in labs, working concurrently on separate tasks.
-
-Having everyone in the same place focussed everyone on the task at hand and greatly
-improved communication, keeping everyone working on what was important and not dallying.
-
-\subsection{Evaluation of Work Done/To Do}
-The Scrum board and regular meetings greatly aided in our evaluation of how much work
-had been completed, and how much there was left to do, at the time. Now that we're
-used to Scrum, evaluation of further tasks (such as extensions) should be more
-realistic, and tasks are more likely to be assigned to Sprints with enough time to
-accommodate them, instead of persisting to the next Sprint.
-
-\section{Design Decisions}
-\subsection{Database}
-\subsubsection{Security}
-Passwords in the database are currently stored totally unencrypted. Initially,
-the focus of work was on routing traffic, and for this purpose salting
-passwords is unnecessary. Once the server is past development phase, passwords
-will be encrypted in some secure fashion.
-
-\subsubsection{File Representation}
-File paths are stored in the database, represented as one-to-many parent-folder-to-file
-mappings. This decision was made since all files will already have entries in the
-database (such as metadata and their UUID), and adding the remainder of necessary
-information for a file would be simple.
-
-While file paths are stored in the database, the file content itself will not be.
-It has been specified that the system should be capable of storing large files,
-and databases may struggle with the difficulties of storing variable-size Binary
-Large Objects when said objects are of this scale. In addition, the breakdown and
-caching of large images into image pyramids both increases the quantity of binary
-data that will need to be stored, and greatly increases the number of reads and
-writes carried out by the server on binary data. File systems, on the other hand,
-are optimised for jobs of this kind.
-
-The resulting setup is a virtual filesystem that resembles a regular filesystem,
-and a very flat physical filesystem: a root folder containing a folder for each
-project, which in turn contain all non-folder files belonging to that particular project.
-Keeping the files separated by folders named after their projects allows for simple
-deletion of an entire project.
-
-All files in the database are given a UUID, which serves a number of functions:
-\begin{enumerate}
- \item It is the name of the file in the physical file system on disk,
- \item It can be used to uniquely identify a file irrespective of its position
- in the virtual file system,
- \item It can be used to keep a reference to a file even if it is moved
- (or even if it is deleted).
-\end{enumerate}
-
-Examples of SQL queries using the structure described can be found in Appendix
-\ref{app:sql}.
-
-\subsection{Server Framework}
-This practical requires a variety of utilities, and should be easy to document and
-to understand from an outside perspective. Additionally, it was decided that for a
-large project a language and platform that all members of the team were comfortable
-with was a high priority. Finally, the system would need to be scalable, in the sense
-that additional features should be easy to implement and plug in to the
-already-functioning system.
-
-For these reasons, NodeJS and Typescript were chosen as the framework and language
-for the project.
-
-\subsubsection{NodeJS}
-NodeJS has a huge library (or \emph{package}) repository, providing teams with a wide variety of options on how to implement projects. Its ease of deployment on both *nix and Windows systems,
-and its common IDE support make it ideal for team development.
-
-\subsubsection{Typescript}
-While not every team member had previously used Typescript, all had used and are comfortable
-with Javascript, and were willing to take on the slight increase in complexity for static
-type checking. Typescript's compile-time checks and IDE integration remove the ambiguity of
-Javascript from large projects, improving their scalability and maintainability as the project
-increases in size.
-
-\subsubsection{ExpressJS}
-A core package used by the project for client-server communication is the middleware handler
-ExpressJS. This package allows for easy insertion and use of any number of middlewares, both created in-house
-and imported from other packages. Uses for this multi-layer structure include authentication, user
-permission checking, and wrapping responses with statuses.
-
-ExpressJS also handles client-server communication through a RESTful API.
-
-\begin{figure}[H]
- \centering
- \includegraphics[width=1.5in]{graphics/be-layer-structure.pdf}
- \caption{Structure of Layers in a Server Instance}
- \label{fig:layer}
-\end{figure}
-
-\subsubsection{Sequelize (and Sequelize-Typescript)}
-Sequelize was chosen as the ORM package to use to connect to the database server. It was chosen over other
-similar packages for its variety of powerful features (such as eager loading) and its large user-base.
-It can connect to a variety of SQL-dialect databases, and hides the low-level table interactions to create
-a simple abstraction to Javascript objects.
-Furthermore, it also has comprehensive and clear documentation, providing better access to these features.
-
-In addition to Sequelize is the add-on package Sequelize-Typescript: this improves Sequelize syntax to
-accept ES6 classes with Typescript types as ORM model definitions, amongst other smaller improvements
-made possible by Typescript's experimental annotation support.
-
-\subsubsection{Token-Based Authentication (Passport/JWT)}
-The protocol designed by the entire year uses a token-based authentication service
-similar to and inspired by OAuth2. Using token-based authentication removes the need
-for sessions or for cookies while still providing a smooth and secure user experience,
-and simplifying client design.
-It was decided that implementing OAuth2 in its entirety would be superfluous. OAuth2
-relies on the acquisition of tokens from third parties, which would be unsuitable for
-a simple system such as this.
-
-The Javascript package Passport was used for handling authentication through this protocol.
-Passport's support for custom authentication services in addition to its synergy with ExpressJS middleware
-support made it an obvious choice.
-
-For generating authentication "bearer" tokens, JWT was used.
-
-\subsection{Testing Framework}
-Testing was extensive and concurrent to the implementation in each Sprint. This was to ensure minimal time was spent debugging which then prevented the team from missing the Sprint deadlines. Unit testing was one of the primary methods of testing individual functionality. This was very useful for a modularised task as each module could be debugged without affecting other modules which were functioning as expected. Producing unit tests concurrently with the implementation of certain functionality gave the advantage of designing the functionality around the possible input or validation errors that may occur. MochaJS and ChaiJS were the JavaScript frameworks used for unit testing. These were chosen due to their simplicity of use and strong compatibility with TypeScript and Express.js. They both also allowed automation which increased efficiency and productivity. An example of tests that were performed include matching the response object for all routes to what is expected as defined by the protocols.
-
-Unit test were convenient for implementation, however, to be thorough further tests were applied whilst the server was actually running in order to ensure that different components work as expected as a larger unit. These particular tests were applied during the end of each implementation iteration as all components are needed. The process began by starting the server on a host machine and specific port. Then tools such as cURL and Postman helped act as the client, in order to send appropriate requests to the server. A set of requests were sent and the responses given were compared to the responses that were actually expected. Some stages resulted in server errors which described bugs in the system where previously we would not have foreseen.
-
-As well as testing the individual functionality of components, testing was also carried out on data types to ensure certain programming errors will be detected and reported. This was also completed using MochaJS and ChaiJS.
-
-Further testing is still in progress however this requires additional components to be added to the system in upcoming Sprints. One portion of testing includes producing a mock user interface in order to test integration further on with other sections of the system which are completed by other teams. A client-side SDK for each request is generated by SwaggerHub, which prevents any focus being applied to user interaction and keeps the back-end server as the main task.
-
-\section{Looking Ahead}
-\subsection{File Agnosticity}
-It is the goal of a backend server to be able to support any file type possible as part of a project. These may be miscellaneous files that a user would like to store in the project, or it may also be a temporary file created by an HCI or ML service which is proprietary to the work they are carrying out. In the average case where a file is one of the Users’ complex image formats, or an excel spreadsheet perhaps - the server should be capable of converting this into a standardised file format that anything should be able to read. In particular, if a ‘Leica’ file is uploaded in ‘.scn’, our server should be capable of converting this into whatever resolution of sub pictures in PNG format so that we can ensure interoperability between components and clients. The server may still hold on to the original file and, in-fact would be expected to do so, but should only ever hand out standard formats from endpoints. In the case of Excel files (.xlsx), the server should be capable of transforming these sheets into ‘.csv’, to be read from another service, whilst maintaining the ability for clients to still download the original proprietary format. For example, if an ‘HCI’ client is connecting through a mobile phone, the client shouldn’t care which format an image was uploaded to a project in, as it should always send out a standard (PNG for images) format to remain type-agnostic.
-
-\subsection{Advanced Telemetry}
-As part of professional development, an end goal was set to enable the server to be particularly self-aware through advanced telemetry monitoring. There are many benefits to this, mainly improved system performance to reduce bottlenecks, as well as being resilient to errors that may crop up with user interaction.
-Some forms of telemetry considered were continually monitoring the kinds of requests that are coming in and check to see if they access similar locations. Then UUIDs could be cached with meta information such as hit count, and related files so that the sever could learn about the kinds of operations being carried out on it, and report back to some kind of systems admin. We could also start to preemptively carry out certain tasks such as unpacking and converting spatially adjacent images for files that are currently being browsed to reduce latency on further “panning” of the file for example. Statistics about this kind of operation could be gathered, such as time taken to complete and the time difference that was saved by doing so. These kinds of results would then be used to make an internal decision if some of the files should be “permanently” stored in some converted format.
-
-With regards to the scalability potential of running multiple instances, there is a plethora of further telemetry that can be gathered about connections made between instances, both with reference to the content in the database and the ACID/atomic properties which would need to be upheld, as well as with regards to the physical file distribution across multiple geographical nodes.
-There could then be all kinds of algorithms to determine if files should be “invisibly” shuffled around behind the scenes to provide a more seamless experience for the end-user.
-
-\subsection{ACID Distribution}
-
-\begin{figure}
- \centering
- \includegraphics[width=3in]{graphics/acid-echo.pdf}
- \caption{A Server Instance Connected to an Echo Server as Part of a Distributed Network}
- \label{fig:acid}
-\end{figure}
-
-Building on the atomic nature of a database transaction, and given the Users deployment scenario (multiple research facilities potentially across multiple geographically diverse locations), we thought it would be critical to allow the database to have multiple instances operating concurrently. Approximately how this would look, is that clients talk to the backend server they are physically closest to on the network for the lowest possible latency. However, since there can be multiple nodes to serve clients in different locations, the servers would need to make a "best attempt" to synchronise in an atomic manner. This would make the system far more scalable in the future, and may have potential applications for things such as a "live" backup server - since medical data is all fairly critical.
-On top of the transactions to the Database being atomic and synchronised across all instances of the server, the physical distribution of file storage would additionally need to be considered.
-
-Since we made the design decision to store all of the actual files, outside of the database, then keeping atomic communication to each instance server does not necessarily solve the issue of file replication.For example, if a member of a group is working on a node other than the "root" node where that project was created and all of the data happens to be stored for it, then we will need to include some kind of notion of a "server reference" for each file known about by the database.
-Then, if a client made a request for data not locally stored, it could either be re-directed by the server to the other node, or the server forwards the request then pipes it back to the client.
-
-Alternatively, as a further specialisation of this functionality, the server could intelligently detect related data to the "foreign" request being made, and pre-emptively load in the data from the alternate server, so it is ready to serve future data locally. This data could be cached locally and used, then re-synchronised if changes were made back to the original, or dropped if it was just for reading. It is likely however that most of these interactions will be reads, so activities such as carrying out a machine learning session on some data would only require the (potentially) smaller file containing the results to be synchronised back, which is a much easier task as it would likely just be new file upload to the remote server.
-As part of professional development, an end goal was set to enable the server to be incredibly self aware through advanced telemetry monitoring. There are many benefits to this, mainly improved system performance to reduce bottlenecks, as well as being resilient to errors that may crop up with user interaction.
-Some forms of telemetry considered were continually monitoring the kinds of requests that are coming in and check to see if they access similar locations. Then UUIDs could be cached with meta information such as hit count, and related files so that the sever could learn about the kinds of operations being carried out on it, and report back to some kind of systems admin. We could also start to preemptively carry out certain tasks such as unpacking and converting spatially adjacent images for files that are currently being browsed to reduce latency on further “panning” of the file for example. Statistics about this kind of operation could be gathered, such as time taken to complete and the time difference that was saved by doing so. These kinds of results would then be used to make an internal decision if some of the files should be “permanently” stored in some converted format.
-
-With regards the scalability potential of running multiple instances, there is a plethora of further telemetry that can be gathered about connections made between instances, both with reference to the content in the database and the acid/atomic properties which would need to be upheld, as well as with regards the physical file distribution across multiple geographical nodes.
-There could then be all kinds of algorithms to determine if files should be “invisibly” shuffled around behind the scenes to provide a more seamless experience for the end-user
-\appendix
-\section{Scrum Board Images} \label{app:board}
-
-{
-\centering
-\includegraphics[width=\textwidth]{graphics/4-12-17.jpg}
-\includegraphics[width=\textwidth]{graphics/4-12-17-2.jpg}
-\includegraphics[width=\textwidth]{graphics/8-1-18.jpg}
-\includegraphics[width=\textwidth]{graphics/29-1-18.jpg}
-\includegraphics[width=\textwidth]{graphics/5-2-18.jpg}
-}
-
-\section{Scrum Meeting Minutes} \label{app:meet}
-\begin{lstlisting}
-Project Meeting minutes
-
-Group project meeting 1
-Date: 10/11/17
-Topics:
-Code type
-User initial tasks and roles
-
-
-Outcomes:
-
-
-* Scrum
-* Scrum master: Tom
-* Product owner: Calum
-* Code:
- * Language: typescript
- * Framework: NodeJS
-* File conversion:
- * On-the-fly - only keep original and convert when necessary
-* OpenCdragon lib
-* Networking:
- * Express.js
-* Storage:
- * Database
- * Storing json format for metadata
- * Filepath for files
-* Users, groups:
- * Tokens - libraries?
- * oauth -> which version?
- * stored in tables - encryption
-* Security:
- * Per-file encryption
- * Hash passwords
- * not needed?
-* Other:
- * ask IT services for more user space
- * Use teamspeak over christmas
-* Deadline 5 days after we come back
-* Next_Tasks:
- * Tom: setup basic Node Server
- * Get data from user on friday
- * Design API
- * Johannes: test file conversion libraries
- * Calum: think about database format
- * Make ER diagram and Schema
-
-
-Group project meeting 2 pre sprint
-Date: 4/12/17
-Topics:
-Database type and design
-Authorisation
-Protocol
-Set up first set of user stories
-Setting up server
-
-
-Outcomes:
-* Database
-* Postgres
-* Talk about design
-* Set up ER diagram
-* Authentication and security
-* Passport
-* oauth tokens
-* User stories-
-* Setting up stubs for conforming to database
-* Setting up database from ER diagram
-
-
-Group project meeting 3 post sprint
-Date: 8/12/17
-Topics:
-Burnout chart
-Evaluation of sprint
-Setting next time for sprint
-Change of scrum master and project
-
-
-Outcomes:
-* Change of roles
-* Scrum master: Johannes
-* Project Owner: Hafeez
-
-
-Group project meeting 4
-Date: 8/1/18
-Topics
-Storing files
-Setting up mock HCI
-Dealing with file types
-Thinking About File type conversions
-
-Change of roles
-
-Outcomes
-* Change of roles
-* Scrum master: Calum
-* Project Owner: Josh
-
-
-Group project meeting 5
-Date: 28/1/18
-Topics:
-Discuss previous sprint
-Catching up on research Over Holidays
-Planning How to Acheive First Deliverable
-
-Outcomes:
-* Continuing on the Scrum board with realistic
-goals of tasks that can be completed by the deadline
-* Redistribution of work between members so that
-everyone has an even share of the work
-
-Group project meeting 6
-Date: 3/2/18
-Topics:
-User stories for sprint before first hand in.
-What tasks we are leaving until next hand in
-
-
-Outcomes:
-* File conversions saving for future hand in
-* Have a working demo for following hand in
-* User stories
-* Is the Epic User Story achievable by the end of the year?
-
-Discuss previous sprint
-Discuss how to present hand in
-
-
-Outcomes:
-* Responsibilities
-\end{lstlisting}
-
-\section{Example SQL Queries on File System} \label{app:sql}
-\subsection{Example 1}
-To locate an image called image1 at folder1/folder2/folder3/image1 to find it you would use the queries:
-\begin{lstlisting}[language=SQL]
-SELECT * FROM dirent
- NATURAL JOIN folder WHERE
- folder_name = 'folder1' AND
- super_folder is null AND
- project_name = 'project 1';
-SELECT * FROM dirent WHERE
- super_folder = '77dea3b7-523e-463a-aff1-3d8b92259fbb';
-SELECT * FROM dirent WHERE
- super_folder = '12596fe5-2838-4cc0-8d2f-4745e91738f5';
-SELECT * FROM dirent
- NATURAL JOIN image WHERE
- super_folder = '22b94214-6942-40dd-b8af-deb1371fa298';
-\end{lstlisting}
-
-From this directory, if you wanted to find dirents contained within folder 2 you could use the
-queries:
-\begin{lstlisting}[language=SQL]
-SELECT * FROM dirent WHERE
- id = '22b94214-6942-40dd-b8af-deb1371fa298';
-SELECT * FROM dirent
- WHERE super_folder = '12596fe5-2838-4cc0-8d2f-4745e91738f5';
-\end{lstlisting}
-
-\subsection{Example 2}
-Using:
-\begin{lstlisting}[language=SQL]
-INSERT INTO
- project ("project_name", "owner")
- VALUES ('project 1', 'josh')
-\end{lstlisting}
-
-Would give all permissions to josh in project 1.
-
-\end{document}
diff --git a/Report/texts/aims.tex b/Report/texts/aims.tex
deleted file mode 100644
index e1da3ee..0000000
--- a/Report/texts/aims.tex
+++ /dev/null
@@ -1,7 +0,0 @@
-\section{Aims for submission 2}
-From our first submission, we now had a working server that allowed a user to access our own mock user interface to log in and access data based on their level of authorisation. Following this we set up a meeting to lay out goals for ourselves that would act as requirements for the second submission.
-\begin{description}
- \item[Define Specific Protocol] Now that we had a working server, we next wanted to define specific protocol in order to demo our progress using work from another Junior Honours HCI groups.
- \item[Manage Filetype Conversions] A main part of this submission was creating a file converter for all the required file types that would be needed.
- \item[Testing] As our code was getting more complicated we wanted to make sure that extensive testing was implemented to create a more secure and consistent system.
-\end{description}
diff --git a/Report/texts/conclusion.tex b/Report/texts/conclusion.tex
deleted file mode 100644
index 0e40979..0000000
--- a/Report/texts/conclusion.tex
+++ /dev/null
@@ -1,5 +0,0 @@
-\section{Conclusion}
-As a group a lot of progress was made for this submission, we were proactive in setting out goals for ourselves and feel we are now well on track to produce an outstanding final hand in. Our continued use of scrum has helped keep workload consistent and effective right through to this submission and we hope to continue in this way. Scrum is essential in our progress as it helps to manage time and organise the team work and so this process will be used for the duration of the project. Having now combined our work with the HCI group we are looking forward to working with teams focused on machine learning to tie together all 3 sections of the application to create the desired system set out by the project owner.
-
-\subsection{Next Tasks}
-Viewing the system as a whole, substantial progress has been made in completing each required task whilst also managing time for each task appropriately. Looking further ahead, our next objectives will surround performance enhancing, further testing and finally completing the integration process with the rest of the system. The process for these will include a large amount of analysis on the working server, which include finding delays between certain requests and responses, measuring time taken for converting files and testing for bugs after integration. Another important aspect is the security of the application, and preventing bugs from leading to exploits which can be used for malicious use. This is particularly important within the medical industry as data confidentiality and integrity are apart of practitioners' policy. One method of testing for this task would be penetration testing, using a suite of tools to attack the application, which would determine any vulnerabilities that exist. \ No newline at end of file
diff --git a/Report/texts/conversion.tex b/Report/texts/conversion.tex
deleted file mode 100644
index 87db332..0000000
--- a/Report/texts/conversion.tex
+++ /dev/null
@@ -1,135 +0,0 @@
-\section{File Conversion}
-One of the most key pieces of functionality for the backend groups is the facilitation of the agnosticity of
-original file formats to the end user. No matter the original upload format, backend groups should all be
-capable of returning files in standard file formats.
-These specific ``standards'' were not hard-defined by the specification, however as part of our whole year
-protocol, it was decided that \emph{JSON} would be used for file meta-information, as well as the
-main structure of all responses from a backend server. \emph{PNG} was decided upon as the standard file format
-for all images, since it is very widely supported and has other favourable properties we would like to
-take advantage of.
-
-\subsection{Dealing with Images}
-The nature of the file formats that we were expected to abstract over however turned out to be significantly
-more challenging than was initially perceived. The file formats of `Leica' and `Zeiss' are widely used in the
-medical field (the department we are providing this service for), however almost nowhere else. Upon looking
-into this more closely, it was found that the Zeiss file format is very proprietary and licensed.
-
-This means that in order to even gain access to simply read the documentation you must fill in your details
-and make an application for the documentation~\cite{zeissLicence}. Part of the agreement for this documentation is that you are
-not allowed to share it with anyone else; you are allowed to write software to \emph{deconstruct} them; you
-are strictly \emph{not} allowed to write any software to construct them.
-
-The documentation gives a description of the various ``segments'' of binary that can appear in the file, and
-attempts to assist you in the method to read them. Given the large nature of the file size of a Zeiss, it makes
-sense for them to be designed to be `streamable', which they are --- allowing you to read smaller chunks at a
-time rather than loading the whole object into memory simultaneously.
-
-After reading the specification in great detail, it was clear that it was extremely specialised and has
-the potential to nest a variety of other file types within itself, as well as have many fields missing
---- as they are optional --- making it quite complex to interpret. In addition to this, the major difficulty
-came from the fact that the base file is a proprietary binary file, which also contains things such as 128bit
-unsigned integers. This fact, coupled with the substantial file sizes made the choice for languages to deal
-with them limited to a systems programming language. Since I had most experience in `C99', then this seemed
-the only realistic possibility.
-
-\subsubsection{Extraction of Zeiss Within `C'}
-One major consideration was that --- due to the sheer file size of many of these images --- we would need
-to store them on the local \file{/cs/scratch} drive of the lab machines: they are simply too
-large to store either on our host servers statically, let alone when working on extracting and expanding the
-thousands of smaller files within them.
-
-With this in mind, and closely comparing the
-`C' code against the rough documentation licensed to me, the structures possible within a Zeiss file were
-slowly built up.
-
-Methods were written to print out the contents of various structures as progress was made, in
-order to ensure that the offsets for file streaming were continually at the correct locations and the data we
-were parsing out of the file was as expected. To this effect, testing of the extraction was run continually
-in the standard `C' approach of a couple lines at a time before re-compilation, along with using flags such as
-`\verb|--pedantic|' in order to try to catch as many errors as possible. Occasionally \verb|valgrind| was also
-run on this extraction code, since significant chunks of memory are allocated and freed during the
-extraction process. \verb|valgrind| reports that there are no memory leaks at all --- even
-on the larger 12Gb \file{.czi} files.
-
-\subsubsection{Converting Extracted Files}
-Once the files/metadata/attachments had been successfully extracted from the target file, multiple issues were
-discovered.
-\begin{itemize}
- \item The container format for the image segments was in \emph{JPEG-XR}. This is another proprietary
- file format, which does not appear to be supported by anything at all, other than Microsoft's own software.
- There is also extremely limited library support, especially for non-Windows platforms.
- Fortunately, a C++-written \file{.jxr} decoder was found, and could
- be compiled on the destination machine. Enough of the executable is able to be compiled before any problems
- occur, and this decoder can be copied into the relative path for our own C source.
- \item The library for decoding JXR's is only
- capable of conversion to \emph{BMP} or \emph{TIFF}, which is not our desired format. Therefore an additional step of
- converting the `JXR' to `TIFF', and then to `PNG' using the `imagemagick' command line tools like \verb|convert|
- became necessary.
- This is an annoying overhead, which is unfortunately unavoidable.
- \item By simply extracting every image tile found within the JXR tile, we found that
- there were also tiles found at non 1:1 zoom levels, which was wasteful to deal with, since we will be building
- a custom image pyramid anyway. This issue was mitigated by adding some logic to only extract the tile to disk if
- it was determined to have a 1:1 scaling and thus be on the base layer.
- \item In a similar fashion to the previous issue, it also became apparent that there were many tiles in the
- base layer which were of non-standard sizes, with some having tiny slivers as they came to edges etc.
- The only solution to make these tiles appear on a nice grid of $n^2$ sizes, was to iterate over the fragmented
- canvas and stitch together the portions we want.
-\end{itemize}
-
-In order to complete the conversion side of things, it seemed appropriate to move away from C programming, and
-even away from the scripts that were being using to control the C, to something like \emph{Python}.
-The thought process behind this decision is the fact that Python supports multithreading --- which for something
-as parallel as multiple image conversions seemed extremely advantageous. The code to do this section is fairly
-small, but absolutely crucial to the overall pipeline of Zeiss format support.
-
-\subsubsection{Stitching Base Tiles}
-Once we finally had all of the base tiles in a 1:1 scale and a format that was easier to deal with, the first task
-was to figure out how to build up our own grid across the mismatch of sizes of existing base tiles.\\
-The tile dimensions decided on were 1024:1024. The reason for this, is that it is large enough to contain a
-reasonable amount of information, without being so large that our server could provide or clients could load in
-a timely manner.
-
-In order to do this stitching process, a decision was required as to the package to manage the image operations.
-After a vast amount of searching and comparisons, the selection was made for \emph{Sharp}~\cite{sharp}. The reason for
-this, was that it appeared to be the single library which was capable of all of the different kinds of image
-processing jobs we expected to be doing. Another key reason is the fact that it is known in advance that a very
-large number of images will need to be processed here, so performance is critical. Sharp appears to perform
-very significantly better than its competitors~\cite{sharpPerformance}. Finally, it has typing
-support to work with our environment.
-
-With this set, high level logic was written to check various image bounds for related base tiles to a specific
-region request. Regions were then selected out, sorted by x and y offsets, then relevant chunks chopped out of
-them and stitched together into a coherent region of our selected size.
-
-\subsubsection{Building Up Hierarchy of Zoom Levels}
-These finalised base layer tiles are written to disk in an output directory and details about their creation
-are recorded in a new data structure which will map out the pyramid style hierarchy of the tiles.
-A small example of these final titles are shown on the cover page of our Report for interest as they are
-legitimate generations in a format we would like.
-
-Now that the base layer exists, gaining the rest of the tile zoom levels, should be fairly simple --- by moving
-up to the next power of two (2048) and collecting 4 images together then scaling this back down to 1024 pixels.
-This process can be repeated for each level of zoom we would like to raise to. This will massively speed up
-the process of searching through base tiles and stitching many together if we pre-process all of the intermediate
-layers. Since most HCI groups are using OpenSeaDragon (which requests things in scales of powers
-of two~\cite{openseadragon}), our approach should be a very fast performer with the trade off of larger up-front processing time.\\
-Indexing into this pyramid will be fast with each request too, as they will be separated by `C' value, which is
-one of the image's layering options, then by zoom level.
-
-\subsection{Leica \& Other Formats}
-As Zeiss is such a difficult and mammoth file format almost all of my time was spent dealing with purely this,
-and it is still not even complete yet. However having looked quickly into Leica, there appears to be
-library support, which may make life easier, along with the fact the internal structure appears to be similar to
-a BigTiff. More progress on this format will take place for the next deliverable.
-
-As for other image formats such as JPEG, TIFF etc. These are standard formats and so will be trivial to
-convert to our required standard of PNG so is not a significant point of progress currently.
-
-\subsection{Non image formats (\file{.csv} etc.)}
-As for non image formats such as \file{.csv}, it has been decided that the backend should only be responsible of hosting these
-files, since there is no way that a backend server could possibly predict what the file should be processed into.
-Additionally, there are also many cases where an end-user may wish to deliberately store something in a format
-which a backend server checking legitimacy of the file would complain about incorrectly.
-
-The team hasn't really looked into things such as Excel (\file{.xlsx}) files, however again, pre-emptively looking, there seems to
-be fairly wide library support for things like this, so it was not a major concern for this deliverable.
diff --git a/Report/texts/logging.tex b/Report/texts/logging.tex
deleted file mode 100644
index d0a7255..0000000
--- a/Report/texts/logging.tex
+++ /dev/null
@@ -1,38 +0,0 @@
-\section{Logging}
-Server logging has now been formalised: the functionality is imported into
-a file and can then be used to log messages at the selection of urgencies
-specified in Protocol BE01~\cite{protocol}.
-
-These outputs have many configuration options, which ideally will be
-incorporated into a global configuration handler in future development.
-
-\subsection{Standard Logging}
-By default, the standard logger logs to three places:
-\begin{enumerate}
- \item Colourised, human-readable messages are printed to the console.
- Any error- or critical-level messages are printed through stderr.
- \item More verbose JSON editions of messages are written to a basic
- logfile.
- \item Critical-level messages are additionally written to an extra
- logfile.
-\end{enumerate}
-
-\subsection{SQL Query Logging}
-A separate logger has been designed for logging the output of
-Sequelize~\cite{sequelize}. Since Protocol BE01 does not specify that they
-should be retreivable, the output queries can be stored with less associated
-metadata. In addition, Sequelize can output the total required time to
-process the query, which is stored in the log for future use as profiling
-data.
-
-\subsection{Motivation}
-Since basic server functionality has been implemented, the errors produced
-will likely be caused by difficult-to-debug problems, such as edge-cases or
-data races. With a verbose and thorough logging system, these problems
-should be much easier to detect and rectify.
-
-In addition, Protocol BE01~\cite{protocol} requires of the backend support
-for receiving and storing logs from other services. The introduction of a
-well-implemented logging system abstracts this from the common use-case of
-logging while keeping powerful functionality of forwarding and fetching logs
-available for when it is needed.
diff --git a/Report/texts/minutes.tex b/Report/texts/minutes.tex
deleted file mode 100644
index 55aab2a..0000000
--- a/Report/texts/minutes.tex
+++ /dev/null
@@ -1,72 +0,0 @@
-\begin{lstlisting}
-
-Group Project Meeting 1 post submission
-Date: 12/02/18
-Topics:
-Reassigning scrum roles
-Creating next set of tasks
-Task allocation
-
-Outcomes:
-* Scrum:
- * scrum master - Hafeez
- * project owner - Calum
-
-*Tasks:
- * Implementing endpoints
- * Implementing file conversions
- * Improving test coverage
- * Writing tests for untested sections
- * Connecting all middleware
- * Decide on how to deal with errors
- * Organising file-system
- * Creating a Linter to maintain a consistent file structure
-
-Group Project Meeting 2 Pre-sprint
-Date 15/02/18
-Topics:
-Define user stories
-Task allocation
-
-Outcomes:
-* Sprint
- * Week long sprint
- * Meeting set for 22/02/18
-
-Group Project Meeting 3 Post-Sprint
-Date 22/02/18
-Topics:
-Analysis of work
-Next task assignment
-
-Outcomes:
-
-Group Project Meeting 4
-Date 24/02/18
-Topics:
-Sprint aims
-Sprint deadline
-
-Outcomes:
- *Decided to hold a sprint now to leave time
- before next submission to finish off all leftover work
-
-Group Project Meeting 5
-Date 03/03/18
-Topics
-Analysis of work todo after sprint
-Work needed to complete before deadline
-
-
-Outcomes:
- * Finishing off of the report
- *Connecting work with another HCI group
- *Finish testing
-
-
-
-
-
-
-
-\end{lstlisting}
diff --git a/Report/texts/process-management.tex b/Report/texts/process-management.tex
deleted file mode 100644
index d99a73c..0000000
--- a/Report/texts/process-management.tex
+++ /dev/null
@@ -1,56 +0,0 @@
-\section{Process Management and Deployment}\label{sec:pm}
-In a production environment, many instances of a NodeJS server are run on
-one machine; this way NodeJS applications can make use of multiple
-processors. For this purpose, research into \emph{process managers} ---
-applications used for running and managing production-level systems ---
-was carried out.
-
-\subsection{Process Manager Selection}\label{sec:pms}
-A number of process managers were investigated with the hope of
-incorporating them into the production
-system~\cite{strongloop}\cite{pm2}\cite{forever}. The application pm2 was
-chosen, primarily for its highly-configurable \emph{ecosystem}-config files,
-and \emph{pmx}\footnote{https://github.com/keymetrics/pmx},
-its profiling extension.
-
-\subsection{pm2 and KeyMetrics}\label{sec:pm2}
-
-\begin{figure}
- \centering
- \includegraphics[width=0.95\linewidth]{km-dash}
- \caption{The KeyMetrics dashboard web client in use.}\label{fig:dash}
-\end{figure}
-
-A feature available in \emph{pm2} is the ability to transmit profiling
-statistics to a web client, as a dashboard. The dashboard also allows the
-user to remotely issue commands to the running instances. Further,
-custom profiling information, and custom remote commands, can be created
-through the introduction of simple logic into the codebase.
-
-\subsection{Process Limitations}\label{sec:plim}
-Running multiple NodeJS instances can quickly accumulate counts towards a
-user process limit: each instance hosts several threads, and each connection
-to the PostgreSQL database can pool several threads also, resulting in many
-threads per instance. Compounded with the fact that pm2 itself also runs
-as a NodeJS instance, this means that a user can reach their process limit
-on the host labs very quickly. Using \texttt{nolimit} on process
-instantiation is one solution, however this means having to run
-\texttt{nolimit} when starting the databse, deamonising the process manager,
-starting the server instances, and doing any miscellaneous tasks. This
-limitation has stunted hindered attempts to connect to other teams'
-products.
-
-\subsection{Heroku Hosting}\label{sec:her}
-In response to the issues addressed in \S\ref{sec:plim}, an attempt to host
-an instance of the server on hosting service
-\emph{Heroku}\footnote{https://heroku.com/} has been started. This would
-alloow the team to interact with other teams, without using a member's
-process limit and hindering their productivity. Additionally, it would show
-the deployability of the system --- an important factor for a backend
-server.
-
-\subsection{External System Hosting}\label{sec:ext}
-Another option is to host instances of the system on devices personally
-owned by members of the team. This would give the team absolute control over
-configuration of the sytem, and would have the potential to outperform an
-instance running on a complementary Heroku service.
diff --git a/Report/texts/scrum.tex b/Report/texts/scrum.tex
deleted file mode 100644
index ca724c8..0000000
--- a/Report/texts/scrum.tex
+++ /dev/null
@@ -1,17 +0,0 @@
-\section{Continued use of Scrum}
-The scrum process was continued as we found this very useful in terms of clearly setting out tasks for each member and managing the progress of the implementation. One of the changes that was made for this sprint was the change in roles between team members. The change in responsibility allows team members to complete new and different jobs. In general the size and the time taken of each individual task was a lot more varied when comparing to the last submission, however, there were certain tasks which were larger in terms of hours put in. These large tasks included creating a logger system and a file converter.
-\subsection{Sprints}
-
-\begin{figure}[h]
- \centering
- \includegraphics[width=0.6\textwidth]{burndown}
- \caption{A Burndown Chart for the past 14 days.}\label{fig:burn}
-\end{figure}
-
-As a team, it was decided that there would only be a single sprint, up until the next point of submission. This was because of the short time period, enough for only a two week sprint. In addition to this, the sprint assessment process was completed more often to ensure that as a team time was managed well and sufficient progress was being made. All the tasks that was set for this sprint were completed within the required time frame.
-\subsection{Scrum board}
-Again, the scrum board was used to outline and track the completion of each task. The same whiteboard in the John Honey main computer lab was used in order to maintain consistency. This gave a clear visual representation of the objectives. During the sprint, the main jobs required for completion were to further enhance the testing unit to increase its coverage across the implemented systems, implement a simple file converter and introduce a logging system for the server. Much experience was gained from completing previous sprints and so using this experience we were better equipped to handle larger tasks. Examples of the board in use can be found in Appendix \ref{app:board}.
-
-\subsection{Meetings}
-Regular meetings were also held to discuss and evaluate progress. This was crucial in the scrum process and as working in a team to allow a point of communication between each member at the same point in time. An example of a major decision being made during the discussion was the change of language of the file converter implementation. It was decided that the more appropriate language to use would be C as there would more extensive libraries for this particular operation and would also have the advantage of greater efficiency. Multiple meetings were held during the most recent sprint to determine the tasks required for completion, to evaluate whether each task was completed and track progress in between.
-The minutes for formal meetings are available in Appendix \ref{app:meet}.
diff --git a/Report/texts/testing.tex b/Report/texts/testing.tex
deleted file mode 100644
index e3f709b..0000000
--- a/Report/texts/testing.tex
+++ /dev/null
@@ -1,15 +0,0 @@
-\section{Testing}
-Tests do not currently run on the gitlab server, as the postgres integration with the docker gitlab-ci is still missing. This means any tests run automatically when pushing will fail. \par
-When running integration tests locally, please make sure the postgres server is up and running on localhost.
-\subsection{Structure}
-Testing files were restructured for a more organised and professional approach. All test files end in ``*.\(<\)context\(>\).test.ts'' and were moved to the ``test'' directory. At this moment, ``\(<\)context\(>\)'' includes ``unit'' and ``routes''. Further, they were categorised into \textit{integration} and \textit{unit} tests and moved into corresponding sub-directories. \par
-Apart from making test files easier to find, this new structure also allowed us to run specific tests independently to isolate failures and quickly rerun individual tests. For example \texttt{yarn test:routes:auth} runs all authentication tests.
-\subsection{Integration Testing}
-\texttt{yarn test:routes}
-This category of tests targeted the interplay of different server components as it tested server endpoints (routes) rather than internal functions. We aimed to test all routes for responses of success, and various degrees of failure. \par
-E.g. \textbf{``auth.routes.test.ts''} tested the authentication middle-ware, checking existing users could log in only with correct usernames, passwords and reauthentication tokens. During our later meetings, we realised that security is a key-component of medical systems, and requires further much more in-depth testing to guarantee safety of patient data. \par
-\textbf{``protocol.routes.test.ts''} aims to cover all endpoints specified in the agreed protocol by using the \textit{mocha-each} npm module. This allowed us to write few mocha testing functions iterating over the long list of endpoints, checking HTTP responses to fit the JSON response templates to conform to the protocol. This form of testing is still incomplete.
-\subsection{Unit Testing}
-\texttt{yarn test:unit}
-The main motivation for this category of tests was to find bugs early on without having to run the whole server. This saves time and uncovers new code breaking old functionality. We also found that unit tests improved the design process by forcing implementation of code that is testable. Furthermore, unit tests were often used as a form of documentation, as it aided in understanding how code of other team members worked and could be used. \par
-We decided that each team-member was responsible for creating the unit tests for their code. Unfortunately the number and coverage of unit tests is still quite low. This may be the result of prioritising functionality over bug-resilience and test-driven development.
diff --git a/Report/texts/typings.tex b/Report/texts/typings.tex
deleted file mode 100644
index 36297b7..0000000
--- a/Report/texts/typings.tex
+++ /dev/null
@@ -1,27 +0,0 @@
-\section{Type Enforcement}
-In order to run JavaScript code as TypeScript code, typings (usually
-supplied in a \file{.d.ts}-extended file) are applied at compile-time to
-make sense of the original source's variable types. For a couple of
-packages that have been used in the submission, these typings are not
-available, due to a lack of desirablilty --- the packages in question are
-niche and as such see little use.
-
-\subsection{mocha-each}
-One such package is \emph{mocha-each}, a utility package for compacting
-Mocha tests for readability and classification~\cite{mocha-each}. Without
-typings, this package cannot be used in TypeScript projects. Due to its
-single-facet use, however, it was simple to design a custom
-\file{.d.ts} file. With small edits to conform to
-guidelines~\cite{@types}, typings for
-mocha-test were contributed to the DefinitelyTyped types repository\footnote{%
-https://github.com/DefinitelyTyped/DefinitelyTyped/%
-tree/master/types/mocha-each}.
-
-\subsection{pmx}
-The package pmx (as previously described in \S\ref{sec:pms}) is useful for
-profiling. Similarly to mocha-each, however, it does not have supported typing.
-Since this package covers a far wider range of functionality, and since said
-functionality is very involved with sensitive run-time engine manipulation,
-typings were written only for the functions being used by the team, and have
-been kept in-house for their incompleteness. The files in question can be found
-in \file{src/profiler}.
diff --git a/Report/title.tex b/Report/title.tex
deleted file mode 100644
index 4406ef6..0000000
--- a/Report/title.tex
+++ /dev/null
@@ -1,15 +0,0 @@
-\title{Report \\ Juniour Honours Project \\[0.5ex] Submission 2}
-\author{Hafeez Abdul-Rehaman \\[1ex] Johannes Weck \\[1ex] Josh Lee \\[1ex] Calum Duff \\[2ex] Tom Harley}
-\date{\today}
-
-\makeatletter
- \def\@maketitle{
- \begin{center}
- \includegraphics[width=0.7\linewidth]{title-logo}\\[10ex]
- {\huge \bfseries \@title{ }}\\[1ex]
- \rule{0.5\textwidth}{.4pt}\\[1ex]
- {\LARGE \@author}\\[15ex]
- {\large \@date}
- \end{center}
- }
-\makeatother