aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjw2552018-04-23 11:24:39 +0100
committerjw2552018-04-23 11:24:39 +0100
commitbcfbbb2d9e2fba9df67a1e29cc06bff395d2fbe2 (patch)
tree65a90447dcd079248a9f3d6ebd23d0103dbc253e
parentBIG FILTHY COMMIT OF SCARY STUFF (diff)
parentMerge branch 'report' of https://gitlab.cs.st-andrews.ac.uk/cs3099group-be-4/... (diff)
downloadmedicine-bcfbbb2d9e2fba9df67a1e29cc06bff395d2fbe2.tar.gz
medicine-bcfbbb2d9e2fba9df67a1e29cc06bff395d2fbe2.zip

Merge branch ‘report’ into trh/gets

-rw-r--r--.editorconfig3
-rw-r--r--.gitignore6
-rw-r--r--README.md24
-rw-r--r--report/deliverable-1/Burn down Chart.xlsxbin0 -> 10244 bytes
-rw-r--r--report/deliverable-1/report.md (renamed from Report/report.md)0
-rw-r--r--report/deliverable-1/report.tex (renamed from Report/report.tex)0
-rw-r--r--report/deliverable-2/Makefile9
-rw-r--r--report/deliverable-2/appendix/minutes.tex68
-rw-r--r--report/deliverable-2/appendix/scrumboard.tex8
-rw-r--r--report/deliverable-2/biblio.bib189
-rw-r--r--report/deliverable-2/graphics/1.png (renamed from Report/1.png)bin23078 -> 23078 bytes
-rw-r--r--report/deliverable-2/graphics/2.png (renamed from Report/2.png)bin76186 -> 76186 bytes
-rw-r--r--report/deliverable-2/graphics/3.png (renamed from Report/3.png)bin37309 -> 37309 bytes
-rw-r--r--report/deliverable-2/graphics/4.png (renamed from Report/4.png)bin17337 -> 17337 bytes
-rw-r--r--report/deliverable-2/graphics/5.png (renamed from Report/5.png)bin21343 -> 21343 bytes
-rw-r--r--report/deliverable-2/graphics/6.png (renamed from Report/6.png)bin28793 -> 28793 bytes
-rw-r--r--report/deliverable-2/graphics/7.png (renamed from Report/7.png)bin30848 -> 30848 bytes
-rw-r--r--report/deliverable-2/graphics/burndown.pngbin0 -> 21982 bytes
-rw-r--r--report/deliverable-2/graphics/km-dash.pngbin0 -> 97345 bytes
-rw-r--r--report/deliverable-2/graphics/scrum.jpgbin0 -> 1829499 bytes
-rw-r--r--report/deliverable-2/graphics/scrum2.jpgbin0 -> 1746169 bytes
-rw-r--r--report/deliverable-2/graphics/scrum3.jpgbin0 -> 1830134 bytes
-rw-r--r--report/deliverable-2/graphics/scrum4.jpg (renamed from report/deliverable-3/graphics/scrum4.jpg)bin164302 -> 164302 bytes
-rw-r--r--report/deliverable-2/graphics/scrum5.jpg (renamed from report/deliverable-3/graphics/scrum5.jpg)bin152855 -> 152855 bytes
-rw-r--r--report/deliverable-2/graphics/title-logo.pngbin0 -> 220102 bytes
-rw-r--r--report/deliverable-2/main.tex38
-rw-r--r--report/deliverable-2/preamble.tex13
-rw-r--r--report/deliverable-2/texts/aims.tex7
-rw-r--r--report/deliverable-2/texts/conclusion.tex5
-rw-r--r--report/deliverable-2/texts/conversion.tex135
-rw-r--r--report/deliverable-2/texts/logging.tex (renamed from report/deliverable-3/texts/logging.tex)0
-rw-r--r--report/deliverable-2/texts/minutes.tex (renamed from report/deliverable-3/texts/minutes.tex)0
-rw-r--r--report/deliverable-2/texts/process-management.tex56
-rw-r--r--report/deliverable-2/texts/scrum.tex17
-rw-r--r--report/deliverable-2/texts/testing.tex15
-rw-r--r--report/deliverable-2/texts/typings.tex (renamed from report/deliverable-3/texts/typings.tex)0
-rw-r--r--report/deliverable-2/title.tex15
-rw-r--r--report/deliverable-3/appendix/scrumboard.tex2
-rw-r--r--report/deliverable-3/graphics/burndown.pngbin21982 -> 22000 bytes
-rw-r--r--report/deliverable-3/graphics/scrum.jpgbin1829499 -> 663766 bytes
-rw-r--r--report/deliverable-3/graphics/scrum2.jpgbin1746169 -> 512649 bytes
-rw-r--r--report/deliverable-3/graphics/scrum3.jpgbin1830134 -> 754649 bytes
-rw-r--r--report/deliverable-3/main.dvibin0 -> 45696 bytes
-rw-r--r--report/deliverable-3/main.out39
-rw-r--r--report/deliverable-3/main.synctex.gzbin0 -> 105666 bytes
-rw-r--r--report/deliverable-3/main.tex35
-rw-r--r--report/deliverable-3/preamble.tex10
-rw-r--r--report/deliverable-3/texts/aims.tex10
-rw-r--r--report/deliverable-3/texts/code.tex6
-rw-r--r--report/deliverable-3/texts/conclusion.tex15
-rw-r--r--report/deliverable-3/texts/contributions.tex12
-rw-r--r--report/deliverable-3/texts/files.tex18
-rw-r--r--report/deliverable-3/texts/scrum.tex11
-rw-r--r--report/deliverable-3/texts/testing.tex20
-rw-r--r--report/deliverable-3/texts/work.tex45
-rw-r--r--report/deliverable-3/title.tex2
-rw-r--r--test/JH.postman_environment.json52
-rw-r--r--test/postman.json365
-rw-r--r--test/postman.json.json245
59 files changed, 1068 insertions, 427 deletions
diff --git a/.editorconfig b/.editorconfig
index 9b6ac5c..83340e7 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -10,3 +10,6 @@ trim_trailing_whitespace = true
[*.y*ml]
indent_style = space
+
+[*{Makefile,.mak}]
+indent_size = 8
diff --git a/.gitignore b/.gitignore
index 1be1136..d67b619 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,10 @@ dist/
*.aux
*.log*
*.pdf
+*.fdb_latexmk
+*.fls
+*.bbl
+*.blg
# PostreSQL log files
POSTGRES_logfile
@@ -24,3 +28,5 @@ docs/
# project files
files/*
+
+report/deliverable-3/main.synctex.gz
diff --git a/README.md b/README.md
index e3925ea..a3603e3 100644
--- a/README.md
+++ b/README.md
@@ -2,27 +2,17 @@
## Instructions to install:
-$ ./getmenode.sh
-$ npm install all
+$ ./getmeall.sh
+$ yarn
-## Instructions to install postgres locally (on lab machines):
+## Instructions to run postgres:
-$ ./getmepostgres.sh
+$ ./runmepostgres.sh
-## Instructions to execute:
+## Instructions to run server:
-$ ./runmenode.sh
-
-// alternative for home pc:
-$ npm start
+$ yarn start
## To test:
-$ npm test
--- these tests should always pass (when the server is up and running ofc)
-
-## Sources:
-http://mherman.org/blog/2016/11/05/developing-a-restful-api-with-node-and-typescript/#.WlW1fhdpw8o
-https://basarat.gitbooks.io/typescript/docs/quick/nodejs.html
-https://github.com/RobinBuschmann/sequelize-typescript
-https://sequelize.readthedocs.io/en/v3/
+$ yarn test
diff --git a/report/deliverable-1/Burn down Chart.xlsx b/report/deliverable-1/Burn down Chart.xlsx
new file mode 100644
index 0000000..9fa607e
--- /dev/null
+++ b/report/deliverable-1/Burn down Chart.xlsx
Binary files differ
diff --git a/Report/report.md b/report/deliverable-1/report.md
index 323c98e..323c98e 100644
--- a/Report/report.md
+++ b/report/deliverable-1/report.md
diff --git a/Report/report.tex b/report/deliverable-1/report.tex
index dae5b11..dae5b11 100644
--- a/Report/report.tex
+++ b/report/deliverable-1/report.tex
diff --git a/report/deliverable-2/Makefile b/report/deliverable-2/Makefile
new file mode 100644
index 0000000..135009b
--- /dev/null
+++ b/report/deliverable-2/Makefile
@@ -0,0 +1,9 @@
+.PHONY: default clean FORCE
+
+default : main.pdf
+
+%.pdf : %.tex FORCE
+ latexmk -pdf $<
+
+clean :
+ latexmk -C
diff --git a/report/deliverable-2/appendix/minutes.tex b/report/deliverable-2/appendix/minutes.tex
new file mode 100644
index 0000000..44aa702
--- /dev/null
+++ b/report/deliverable-2/appendix/minutes.tex
@@ -0,0 +1,68 @@
+\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/deliverable-2/appendix/scrumboard.tex b/report/deliverable-2/appendix/scrumboard.tex
new file mode 100644
index 0000000..e868278
--- /dev/null
+++ b/report/deliverable-2/appendix/scrumboard.tex
@@ -0,0 +1,8 @@
+\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/deliverable-2/biblio.bib b/report/deliverable-2/biblio.bib
new file mode 100644
index 0000000..fdfc56b
--- /dev/null
+++ b/report/deliverable-2/biblio.bib
@@ -0,0 +1,189 @@
+@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/1.png b/report/deliverable-2/graphics/1.png
index 089b8ef..089b8ef 100644
--- a/Report/1.png
+++ b/report/deliverable-2/graphics/1.png
Binary files differ
diff --git a/Report/2.png b/report/deliverable-2/graphics/2.png
index 1714110..1714110 100644
--- a/Report/2.png
+++ b/report/deliverable-2/graphics/2.png
Binary files differ
diff --git a/Report/3.png b/report/deliverable-2/graphics/3.png
index 7eef8dc..7eef8dc 100644
--- a/Report/3.png
+++ b/report/deliverable-2/graphics/3.png
Binary files differ
diff --git a/Report/4.png b/report/deliverable-2/graphics/4.png
index 8379ef7..8379ef7 100644
--- a/Report/4.png
+++ b/report/deliverable-2/graphics/4.png
Binary files differ
diff --git a/Report/5.png b/report/deliverable-2/graphics/5.png
index aeea913..aeea913 100644
--- a/Report/5.png
+++ b/report/deliverable-2/graphics/5.png
Binary files differ
diff --git a/Report/6.png b/report/deliverable-2/graphics/6.png
index e3fb624..e3fb624 100644
--- a/Report/6.png
+++ b/report/deliverable-2/graphics/6.png
Binary files differ
diff --git a/Report/7.png b/report/deliverable-2/graphics/7.png
index a917d83..a917d83 100644
--- a/Report/7.png
+++ b/report/deliverable-2/graphics/7.png
Binary files differ
diff --git a/report/deliverable-2/graphics/burndown.png b/report/deliverable-2/graphics/burndown.png
new file mode 100644
index 0000000..f3ae71d
--- /dev/null
+++ b/report/deliverable-2/graphics/burndown.png
Binary files differ
diff --git a/report/deliverable-2/graphics/km-dash.png b/report/deliverable-2/graphics/km-dash.png
new file mode 100644
index 0000000..840395d
--- /dev/null
+++ b/report/deliverable-2/graphics/km-dash.png
Binary files differ
diff --git a/report/deliverable-2/graphics/scrum.jpg b/report/deliverable-2/graphics/scrum.jpg
new file mode 100644
index 0000000..4b5c911
--- /dev/null
+++ b/report/deliverable-2/graphics/scrum.jpg
Binary files differ
diff --git a/report/deliverable-2/graphics/scrum2.jpg b/report/deliverable-2/graphics/scrum2.jpg
new file mode 100644
index 0000000..231cf1f
--- /dev/null
+++ b/report/deliverable-2/graphics/scrum2.jpg
Binary files differ
diff --git a/report/deliverable-2/graphics/scrum3.jpg b/report/deliverable-2/graphics/scrum3.jpg
new file mode 100644
index 0000000..012e9b3
--- /dev/null
+++ b/report/deliverable-2/graphics/scrum3.jpg
Binary files differ
diff --git a/report/deliverable-3/graphics/scrum4.jpg b/report/deliverable-2/graphics/scrum4.jpg
index ab1f7a5..ab1f7a5 100644
--- a/report/deliverable-3/graphics/scrum4.jpg
+++ b/report/deliverable-2/graphics/scrum4.jpg
Binary files differ
diff --git a/report/deliverable-3/graphics/scrum5.jpg b/report/deliverable-2/graphics/scrum5.jpg
index e79e828..e79e828 100644
--- a/report/deliverable-3/graphics/scrum5.jpg
+++ b/report/deliverable-2/graphics/scrum5.jpg
Binary files differ
diff --git a/report/deliverable-2/graphics/title-logo.png b/report/deliverable-2/graphics/title-logo.png
new file mode 100644
index 0000000..8a72423
--- /dev/null
+++ b/report/deliverable-2/graphics/title-logo.png
Binary files differ
diff --git a/report/deliverable-2/main.tex b/report/deliverable-2/main.tex
new file mode 100644
index 0000000..dce9106
--- /dev/null
+++ b/report/deliverable-2/main.tex
@@ -0,0 +1,38 @@
+\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/deliverable-2/preamble.tex b/report/deliverable-2/preamble.tex
new file mode 100644
index 0000000..14787a9
--- /dev/null
+++ b/report/deliverable-2/preamble.tex
@@ -0,0 +1,13 @@
+\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/deliverable-2/texts/aims.tex b/report/deliverable-2/texts/aims.tex
new file mode 100644
index 0000000..e1da3ee
--- /dev/null
+++ b/report/deliverable-2/texts/aims.tex
@@ -0,0 +1,7 @@
+\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/deliverable-2/texts/conclusion.tex b/report/deliverable-2/texts/conclusion.tex
new file mode 100644
index 0000000..0e40979
--- /dev/null
+++ b/report/deliverable-2/texts/conclusion.tex
@@ -0,0 +1,5 @@
+\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/deliverable-2/texts/conversion.tex b/report/deliverable-2/texts/conversion.tex
new file mode 100644
index 0000000..87db332
--- /dev/null
+++ b/report/deliverable-2/texts/conversion.tex
@@ -0,0 +1,135 @@
+\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/deliverable-3/texts/logging.tex b/report/deliverable-2/texts/logging.tex
index d0a7255..d0a7255 100644
--- a/report/deliverable-3/texts/logging.tex
+++ b/report/deliverable-2/texts/logging.tex
diff --git a/report/deliverable-3/texts/minutes.tex b/report/deliverable-2/texts/minutes.tex
index 55aab2a..55aab2a 100644
--- a/report/deliverable-3/texts/minutes.tex
+++ b/report/deliverable-2/texts/minutes.tex
diff --git a/report/deliverable-2/texts/process-management.tex b/report/deliverable-2/texts/process-management.tex
new file mode 100644
index 0000000..d99a73c
--- /dev/null
+++ b/report/deliverable-2/texts/process-management.tex
@@ -0,0 +1,56 @@
+\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/deliverable-2/texts/scrum.tex b/report/deliverable-2/texts/scrum.tex
new file mode 100644
index 0000000..ca724c8
--- /dev/null
+++ b/report/deliverable-2/texts/scrum.tex
@@ -0,0 +1,17 @@
+\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/deliverable-2/texts/testing.tex b/report/deliverable-2/texts/testing.tex
new file mode 100644
index 0000000..e3f709b
--- /dev/null
+++ b/report/deliverable-2/texts/testing.tex
@@ -0,0 +1,15 @@
+\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/deliverable-3/texts/typings.tex b/report/deliverable-2/texts/typings.tex
index 36297b7..36297b7 100644
--- a/report/deliverable-3/texts/typings.tex
+++ b/report/deliverable-2/texts/typings.tex
diff --git a/report/deliverable-2/title.tex b/report/deliverable-2/title.tex
new file mode 100644
index 0000000..4406ef6
--- /dev/null
+++ b/report/deliverable-2/title.tex
@@ -0,0 +1,15 @@
+\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
diff --git a/report/deliverable-3/appendix/scrumboard.tex b/report/deliverable-3/appendix/scrumboard.tex
index e868278..acb531c 100644
--- a/report/deliverable-3/appendix/scrumboard.tex
+++ b/report/deliverable-3/appendix/scrumboard.tex
@@ -3,6 +3,6 @@
{
\centering
\includegraphics[width=\textwidth]{graphics/scrum.jpg}
+\includegraphics[width=\textwidth]{graphics/scrum2.jpg}
\includegraphics[width=\textwidth]{graphics/scrum3.jpg}
-\includegraphics[width=\textwidth]{graphics/scrum4.jpg}
}
diff --git a/report/deliverable-3/graphics/burndown.png b/report/deliverable-3/graphics/burndown.png
index f3ae71d..162691d 100644
--- a/report/deliverable-3/graphics/burndown.png
+++ b/report/deliverable-3/graphics/burndown.png
Binary files differ
diff --git a/report/deliverable-3/graphics/scrum.jpg b/report/deliverable-3/graphics/scrum.jpg
index 4b5c911..aa3b058 100644
--- a/report/deliverable-3/graphics/scrum.jpg
+++ b/report/deliverable-3/graphics/scrum.jpg
Binary files differ
diff --git a/report/deliverable-3/graphics/scrum2.jpg b/report/deliverable-3/graphics/scrum2.jpg
index 231cf1f..7cd31ae 100644
--- a/report/deliverable-3/graphics/scrum2.jpg
+++ b/report/deliverable-3/graphics/scrum2.jpg
Binary files differ
diff --git a/report/deliverable-3/graphics/scrum3.jpg b/report/deliverable-3/graphics/scrum3.jpg
index 012e9b3..d8b622f 100644
--- a/report/deliverable-3/graphics/scrum3.jpg
+++ b/report/deliverable-3/graphics/scrum3.jpg
Binary files differ
diff --git a/report/deliverable-3/main.dvi b/report/deliverable-3/main.dvi
new file mode 100644
index 0000000..c1ed465
--- /dev/null
+++ b/report/deliverable-3/main.dvi
Binary files differ
diff --git a/report/deliverable-3/main.out b/report/deliverable-3/main.out
new file mode 100644
index 0000000..738ad91
--- /dev/null
+++ b/report/deliverable-3/main.out
@@ -0,0 +1,39 @@
+\BOOKMARK [1][-]{section.1}{Aims for Final Submission}{}% 1
+\BOOKMARK [1][-]{section.2}{Completed Work}{}% 2
+\BOOKMARK [2][-]{subsection.2.1}{Endpoints}{section.2}% 3
+\BOOKMARK [1][-]{section.3}{Continued use of Scrum}{}% 4
+\BOOKMARK [2][-]{subsection.3.1}{Sprints}{section.3}% 5
+\BOOKMARK [2][-]{subsection.3.2}{Scrum board}{section.3}% 6
+\BOOKMARK [1][-]{section.4}{Code Quality}{}% 7
+\BOOKMARK [2][-]{subsection.4.1}{Linter}{section.4}% 8
+\BOOKMARK [2][-]{subsection.4.2}{Scripts}{section.4}% 9
+\BOOKMARK [1][-]{section.5}{File Conversion}{}% 10
+\BOOKMARK [2][-]{subsection.5.1}{Dealing with Images}{section.5}% 11
+\BOOKMARK [3][-]{subsubsection.5.1.1}{Extraction of Zeiss Within `C'}{subsection.5.1}% 12
+\BOOKMARK [3][-]{subsubsection.5.1.2}{Converting Extracted Files}{subsection.5.1}% 13
+\BOOKMARK [3][-]{subsubsection.5.1.3}{Stitching Base Tiles}{subsection.5.1}% 14
+\BOOKMARK [3][-]{subsubsection.5.1.4}{Building Up Hierarchy of Zoom Levels}{subsection.5.1}% 15
+\BOOKMARK [2][-]{subsection.5.2}{Leica \046 Other Formats}{section.5}% 16
+\BOOKMARK [2][-]{subsection.5.3}{Non image formats \(.csv etc.\)}{section.5}% 17
+\BOOKMARK [1][-]{section.6}{File Management}{}% 18
+\BOOKMARK [2][-]{subsection.6.1}{Directory Structure}{section.6}% 19
+\BOOKMARK [2][-]{subsection.6.2}{File Upload and Download}{section.6}% 20
+\BOOKMARK [1][-]{section.7}{Testing}{}% 21
+\BOOKMARK [2][-]{subsection.7.1}{Using Mocha and Postman}{section.7}% 22
+\BOOKMARK [2][-]{subsection.7.2}{Integration Testing}{section.7}% 23
+\BOOKMARK [3][-]{subsubsection.7.2.1}{CORS}{subsection.7.2}% 24
+\BOOKMARK [1][-]{section.8}{Process Management and Deployment}{}% 25
+\BOOKMARK [2][-]{subsection.8.1}{Process Manager Selection}{section.8}% 26
+\BOOKMARK [2][-]{subsection.8.2}{pm2 and KeyMetrics}{section.8}% 27
+\BOOKMARK [2][-]{subsection.8.3}{Process Limitations}{section.8}% 28
+\BOOKMARK [2][-]{subsection.8.4}{Heroku Hosting}{section.8}% 29
+\BOOKMARK [2][-]{subsection.8.5}{External System Hosting}{section.8}% 30
+\BOOKMARK [1][-]{section.9}{Conclusion}{}% 31
+\BOOKMARK [2][-]{subsection.9.1}{Future Development}{section.9}% 32
+\BOOKMARK [1][-]{section.10}{Individual Contributions}{}% 33
+\BOOKMARK [2][-]{subsection.10.1}{Tom Harley}{section.10}% 34
+\BOOKMARK [2][-]{subsection.10.2}{Josh Lee}{section.10}% 35
+\BOOKMARK [2][-]{subsection.10.3}{Calum Duff}{section.10}% 36
+\BOOKMARK [2][-]{subsection.10.4}{Johannes Weck}{section.10}% 37
+\BOOKMARK [2][-]{subsection.10.5}{Hafeez Abdul-Rehaman}{section.10}% 38
+\BOOKMARK [1][-]{appendix.A}{Scrum Board Images}{}% 39
diff --git a/report/deliverable-3/main.synctex.gz b/report/deliverable-3/main.synctex.gz
new file mode 100644
index 0000000..a89fc1a
--- /dev/null
+++ b/report/deliverable-3/main.synctex.gz
Binary files differ
diff --git a/report/deliverable-3/main.tex b/report/deliverable-3/main.tex
index dce9106..ee3a4b0 100644
--- a/report/deliverable-3/main.tex
+++ b/report/deliverable-3/main.tex
@@ -1,4 +1,25 @@
-\input{preamble}
+\documentclass{article}
+
+\usepackage[margin=1in]{geometry}
+\usepackage{a4wide}
+
+\usepackage{graphicx}
+\graphicspath{{./graphics/}}
+
+\usepackage{float}
+\usepackage{listings}
+\usepackage{cite}
+\usepackage{hyperref}
+\hypersetup{
+ colorlinks=true,
+ linkcolor=blue,
+ filecolor=magenta,
+ urlcolor=cyan,
+}
+
+\urlstyle{same}
+
+\def\file{\texttt}
\input{title}
@@ -13,21 +34,19 @@
\newpage
\input{texts/aims}
+ \input{texts/work}
\input{texts/scrum}
+ \input{texts/code}
\input{texts/conversion}
- % \input{texts/protocol}
- % \input{texts/auth}
- \input{texts/logging}
- \input{texts/process-management}
+ \input{texts/files}
\input{texts/testing}
- \input{texts/typings}
+ \input{texts/process-management}
\input{texts/conclusion}
+ \input{texts/contributions}
\appendix
\newpage
\input{appendix/scrumboard}
- \newpage
- \input{appendix/minutes}
\clearpage
diff --git a/report/deliverable-3/preamble.tex b/report/deliverable-3/preamble.tex
index 14787a9..b28b04f 100644
--- a/report/deliverable-3/preamble.tex
+++ b/report/deliverable-3/preamble.tex
@@ -1,13 +1,3 @@
-\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/deliverable-3/texts/aims.tex b/report/deliverable-3/texts/aims.tex
index e1da3ee..3543313 100644
--- a/report/deliverable-3/texts/aims.tex
+++ b/report/deliverable-3/texts/aims.tex
@@ -1,7 +1,7 @@
-\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.
+\section{Aims for Final Submission}
+As we already had most of the basic implementation working since our second submission, our main task for the final deadline was resolving numerous issues, extending the test coverage and completing file conversion. Several meetings were organised between groups to check the compatibility between our back-end system and HCI and machine-learning groups.
\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.
+ \item[Extend Test Coverage] Verification and validation of our server's functionality became the focus of our last submission.
+ \item[File Upload, Download and Conversion] One of the last remaining tasks for this submission was implementing the serving of files through our server.
+ \item[Intra-group Collaboration] The key to ensuring the success of our system was testing the compatibility of our server with the work of other groups.
\end{description}
diff --git a/report/deliverable-3/texts/code.tex b/report/deliverable-3/texts/code.tex
new file mode 100644
index 0000000..6fe316b
--- /dev/null
+++ b/report/deliverable-3/texts/code.tex
@@ -0,0 +1,6 @@
+\section{Code Quality}
+\subsection{Linter}
+To ensure code clarity and quality, we decided to use the linter `ts-lint'. This did not only help us create professional-style code but also aided in avoiding bugs early by catching out common errors. The linter was integrated with our editors as well as yarn as to automate its work-flow.
+
+\subsection{Scripts}
+Several scripts were created to automate the installation and execution process. \ No newline at end of file
diff --git a/report/deliverable-3/texts/conclusion.tex b/report/deliverable-3/texts/conclusion.tex
index 0e40979..45e2f85 100644
--- a/report/deliverable-3/texts/conclusion.tex
+++ b/report/deliverable-3/texts/conclusion.tex
@@ -1,5 +1,14 @@
\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.
+As a group, we are very pleased with the process and outcome of this group project. Our final product consists of substantial contributions from all our team members. It was tested and integrated with the systems produced by ML and HCI groups, completes all of the tasks initially identified and the development relied heavily on our use of scrum.
+
+For the final deadline we successfully combined all parts of the system into one final server, completing any remaining tasks which included file management, file conversion and testing. Our system was integrated both with our assigned ML and HCI groups, as well as with other groups, thus ensuring the compatibility of our contribution to the whole pathology system.
+
+\subsection{Future Development}
+The submitted project has potential for future improvements, especially regarding system security and file-conversion.
+
+One substantial flaw of our system is that we rely on the security of all the node-modules including postgres as well as their inter-compatibility. Comprehensive vulnerability scanning as well as penetration testing of our system would be required to ensure security of patients' confidential data. Research into security standards required by law would be necessary.
+
+Similarly, it might prove useful to encrypt data on the server-side as well as combine the ML server and the BE server into one software package, thus reducing the number of components involved.
+
+Also, image file conversion could be explored further, as conversion of *TODO* into png is not yet supported
-\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/deliverable-3/texts/contributions.tex b/report/deliverable-3/texts/contributions.tex
new file mode 100644
index 0000000..dcf7591
--- /dev/null
+++ b/report/deliverable-3/texts/contributions.tex
@@ -0,0 +1,12 @@
+\section{Individual Contributions}
+\subsection{Tom Harley}
+\subsection{Josh Lee}
+\subsection{Calum Duff}
+\subsection{Johannes Weck}
+Throughout the development of our back-end server, I was responsible for thorough testing, which involved writing unit tests with mocha and chai, running integration tests through Postman as well as identifying and fixing bugs. One of the main challenges in this respect was understanding code written by other team-members. Clear and frequent communication between all members proved essential to this process.
+
+During the last sprint I worked closely with Hafeez using pair-programming to resolve a range of issues flagged by the tests. Furthermore, I worked with Tom and Callum, finalizing server-side file-management. I was mostly involved with the file-system part of file storage, integrating the node-module `multer' with our server. `multer' was later swapped out for the package `body-parser' to allow compatibility with our assigned ML and HCI groups.
+\subsection{Hafeez Abdul-Rehaman}
+My role in the development of the server, involved producing the authentication system and providing security to each of the routes in the RESTful API. This was done through node.js libraries including \textit{passportjs} and \textit{jsonwebtokens}. I also tested the functionality of this after implementation to ensure it was working using tools such as Postman and curl. Whilst also conducting tests for authentication, I assisted Johannes in running and resolving test issues found in other parts of the implementation. By using more than one team member on larger tasks, it took less time to solve these problems. This took a considerable amount of time during the last sprint, as testing was required to be much larger and thorough for the fully implemented system. During the later sprints, I was also designated as scrum master. This meant I was responsible for organising tasks and managing time, and removing obstacles the team may face.
+
+As a team member, I did not feel that there were any major obstacles which impeded the development of the system. However, there were some issues regarding time and managing work set out by other modules within the Computer Science course. Some sprints clashed with other pieces of coursework that also needed to be completed. Therefore, additional care was needed when organising tasks related to the project and planning was required for an extended period of time which would overlap other upcoming coursework deadlines. This way as a team we could plan around other unrelated submissions. \ No newline at end of file
diff --git a/report/deliverable-3/texts/files.tex b/report/deliverable-3/texts/files.tex
new file mode 100644
index 0000000..e1aa40a
--- /dev/null
+++ b/report/deliverable-3/texts/files.tex
@@ -0,0 +1,18 @@
+\section{File Management}
+File handling was one of the last unimplemented parts of our server. Integration testing proved essential for ensuring full functionality according to the agreed protocol. File upload and download involved overcoming a range of challenges which arose as additional features were implemented.
+
+\subsection{Directory Structure}
+File storage on the server-side consists of two parts - storage of physical data on the file-system and storage of meta-data in the database.
+
+The directory structure inside projects consists on a purely conceptual level in the database, as directories are stored entirely as entities in postgres. On the file-system, files are stored in the folder ``files'' which contains a folder named after the project which contains folders named after the file-uuid. This last folder contains all the `views of that file as well as the original upload. The ``raw'' view contains the original data. If tabular data is uploaded, for example, the server recognises this and will start conversion into the ``tabular '' view.
+
+The conceptual directory structure, although not obvious to system admins viewing files through a file-viewer on the server, is always enforced to clients connecting to the server endpoint.
+
+\subsection{File Upload and Download}
+When uploading files to the server, a POST request may be issued to the endpoint mentioned in the protocol. Once this request arrives at the server the node library `*TODO*' automatically saves the data to a temporary directory called ``files-temp''.
+
+Next a function is called which parses the path from the request and attempts to find the file given the directory structure. Any part of the path that does not yet exist is created. At this stage the desired action is determined, as we allow for the copying, deleting, moving, truncating, overwriting and writing from an offset. Furthermore large files may be chunked, thus data is added incrementally to the file. The final chunk has the `final' parameter set to true, thus indicating that file-upload is complete.
+
+Once the file status is set to `pre-processing', which is done when the corresponding parameter is set on file-upload, file conversion is initiated. File conversion runs asynchronously separate from the node server. Once file conversion is done, the file status in the database will change to `ready'. The file status may be reviewed by retrieving file meta-data.
+
+Files may be retrieved from the server either by supplying the file uuid or the path.
diff --git a/report/deliverable-3/texts/scrum.tex b/report/deliverable-3/texts/scrum.tex
index ca724c8..8e2006c 100644
--- a/report/deliverable-3/texts/scrum.tex
+++ b/report/deliverable-3/texts/scrum.tex
@@ -1,5 +1,5 @@
\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.
+Group work, especially pair-programming was very important to bring the individual code contributions together. However, the hours of work time spent on the last submission were not distributed as evenly as was the case for the previous submissions as the number of hours increased exponentially during the last 2 weeks before the deadline.
\subsection{Sprints}
\begin{figure}[h]
@@ -7,11 +7,6 @@ The scrum process was continued as we found this very useful in terms of clearly
\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.
+The short time period of 3 weeks meant that we decided to have only 1 sprint and no more role-rotations until the final deadline. During these 3 weeks we met up often to discuss individual task assignments, asses our sprint progress and work on tasks jointly. Although the tasks identified from the initial specifications were not completed to their entirety as discussed earlier, all feasible work was completed in time and progress was made throughout the time period of the sprint.
\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}.
+Unfortunately our previous scrum board was demolished during the srping break, which meant that all user stories had to be redrawn. Appendix \ref{app:board} contains the state of the scrum board at 3 different times - the start of the sprint, the middle and near the deadline. A whiteboard in the John Honey main computer lab was used in order to maintain consistency. \ No newline at end of file
diff --git a/report/deliverable-3/texts/testing.tex b/report/deliverable-3/texts/testing.tex
index 2717b9b..7842f9f 100644
--- a/report/deliverable-3/texts/testing.tex
+++ b/report/deliverable-3/texts/testing.tex
@@ -1,16 +1,10 @@
\section{Testing}
-Testing was a key process in the development of the final product just as it was in previous submissions. Testing was particular important to determine whether the final system meets the requirements initially set. As well as testing each module individually, further tests were done upon completing the system through integration with the front-end and machine learning systems.
+Testing was a key process in the development of the final product just as it was in previous submission. Testing was particular important to determine whether the final system meets the requirements initially set. As well as testing each module individually, further tests were done upon completing the system through integration with the front-end and machine learning systems.
-
-\subsection{Using Mocha}
-The JavaScript framework Mocha was still used in the testing process for modules and
-%tbc...
+\subsection{Using Mocha and Postman}
+The JavaScript framework Mocha was still used in the testing process for modules. The test-suite for our project had some major work done since the last submission, allowing tests to run on the Gitlab server as well as addressing bugs in the test-suite and implementation. Whilst also using Mocha for Unit tests, it was used to test the individual routes and their response whilst comparing them to a template. The same method was applied to test requests. This automation increased the efficiency of production, however, the small amount of routes to test allowed us to be more thorough by manually sending requests to the server using Postman. Postman is a API development tool which allows requests to be sent through an easily manageable user interface. By doing this, expected values were easy to match with actual values, and further bugs could be caught even when the templates had matched previously.
+>>>>>>> report
\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.
+Once the system had been fully implemented and tested, it was necessary to integrate with the rest of the system such as user interface and the machine learning servers. This allowed us to determine whether specific protocols were implemented correctly and to ensure that all the requirements set by the client were met. To begin the integration process, the server was hosted through the St Andrews web service which allows content to be hosted through the web. This was done by configuring an \textit{nginx} proxy that would allow binding of the loopback address and port number. Using \texttt{tmux}, the session was hosted persistently as it allows terminal sessions to be detached and run in the background. The server runs on the domain \textit{har4.host.cs.st-andrews.ac.uk}. From here, it was possible for other teams to send requests to the running server.
+\subsubsection{CORS}
+Integration testing also gave the opportunity to find additional errors specifically caused by the linking of servers. An example of this is the realisation of the lack of Cross-Origin support. The running server could not function properly as content requests were being sent to different origins and for security reasons this is not permitted. To fix this additional features were required to be implemented to support CORS. Specifically certain headers were added to permit different origin access.
diff --git a/report/deliverable-3/texts/work.tex b/report/deliverable-3/texts/work.tex
new file mode 100644
index 0000000..92b9058
--- /dev/null
+++ b/report/deliverable-3/texts/work.tex
@@ -0,0 +1,45 @@
+\section{Completed Work}
+Looking back on the tasks set out from the initial specifications we are very satisfied with the amount of work completed and the percentage of the user stories covered in our final submission. The following points are summaries from the specifications supplied by the school and the specifications decided by the student body.
+
+\begin{description}
+\item[Web-based application] We used NodeJS and typescript to deploy our server to the school host servers, where it is accessible both from within and outside the university network.
+\item[Conceptual structures for file, project and user management] The data models for these items developed into very sophisticated objects - containing hierarchies, permission groups, project contributors and much more. A mode of user authentication is provided using oauth tokens.
+\item[Files may be uploaded to specific projects] Files can only be associated to a specific project. Folder hierarchies are stored on the database, while data is stored in the file-system.
+\item[Files upload should be agnostic of file type] The server does not discriminate files based on type. All files have associated meta-data stored in a database, which contains information like file-type. On the server, files and directories are identified by their uuid and filestypes are divided into the categories `tabular', `image' and `generic'.
+\item[Allow conversion of images and tabular data] Our current system allows fluent transition between czi input files and tiled png output *todo*. Tabular data is handled in csv format, giving the server a good understanding of the data.
+\item[Robustness to user input] A reasonable attempt was made to catch out invalid input and close collaboration with the HCI groups ensured a distribution of responsibility for the preservation of dependencies and cleaning of user input.
+\item[Ensure compatibility between groups] A common api was decided by the student body to ensure seamless communication between systems. As part of our testing we integrated with several other HCI and ML groups.
+\item[Follow an agreed protocol for intergroup communication] We implemented the entire protocol \url{https://github.com/CS3099JH2017/cs3099jh/blob/master/protocols/BE01.md}
+\end{description}
+
+\subsection{Endpoints}
+as specified by the agreed protocol
+\begin{description}
+\item[post /oauth/token] Allows authentication, issuing a token.
+\item[get /\_supported\_protocols\_] Returns the supported protocols
+\item[get /log] Allows retreiving of logs (requires admin privileges)\\
+optional url parameters: \texttt{before=<datetime>\&after=<datetime>\&level=<level>}
+\item[post /log] Allows viewing of logs (requires logging permission)
+\item[get /properties] Returns the server configuration
+\item[post /properties] Allows changing of the server configuration
+\item[get /user\_privileges] Returns all available privileges
+\item[get /users] Returns all users
+\item[get /users/:username] Returns information on a specific user
+\item[post /users/:username] Allows adding, deleting and changing of user (information)\\
+url parameters: \texttt{action=create} or \texttt{action=update} or \texttt{action=delete}
+\item[get /users/:username/properties] Returns additional configuration options on a specific user
+\item[get /current\_user] Returns information of the authenticated user
+\item[post /current\_user] Allows changing of information for the authenticated user
+\item[get /project\_roles] Returns all project roles
+\item[get /projects] Returns all projects
+\item[get /projects/:project\_name] Returns information of a specific project
+\item[post /projects/:project\_name] Allows changing of information of a specific project\\
+url parameters: \texttt{action=create} or \texttt{action=update} or \texttt{action=delete}
+\item[get /projects/:project\_name/properties] Returns additional configuration options of a specific project
+\item[get /projects/:project\_name/files/] Returns all files and folders at the base level of the project (non-recursive)
+\item[get /projects/:project\_name/files/:path] Returns a file\\
+optional url parameters: (default) \texttt{view=meta} or \texttt{raw} or other views depending on the file type
+\item[post /projects/:project\_name/files/:path] Uploads a file\\
+optional url parameters: \texttt{action=set\_metadata, mkdir, delete, move, copy}, \texttt{overwrite=true, false}, \texttt{offset=int}, \texttt{truncate= true, false} and \texttt{final=true, false}
+\item[get /projects/:project\_name/files\_by\_id/:id] Returns a file
+\end{description} \ No newline at end of file
diff --git a/report/deliverable-3/title.tex b/report/deliverable-3/title.tex
index 4406ef6..2303625 100644
--- a/report/deliverable-3/title.tex
+++ b/report/deliverable-3/title.tex
@@ -1,4 +1,4 @@
-\title{Report \\ Juniour Honours Project \\[0.5ex] Submission 2}
+\title{Report \\ Juniour Honours Project \\[0.5ex] Final Submission}
\author{Hafeez Abdul-Rehaman \\[1ex] Johannes Weck \\[1ex] Josh Lee \\[1ex] Calum Duff \\[2ex] Tom Harley}
\date{\today}
diff --git a/test/JH.postman_environment.json b/test/JH.postman_environment.json
new file mode 100644
index 0000000..86ea0a4
--- /dev/null
+++ b/test/JH.postman_environment.json
@@ -0,0 +1,52 @@
+{
+ "id": "ddad923b-9750-c337-ff49-6ee328a72e20",
+ "name": "JH",
+ "values": [
+ {
+ "enabled": true,
+ "key": "host",
+ "value": "http://localhost:3000",
+ "type": "text"
+ },
+ {
+ "enabled": true,
+ "key": "endpoint",
+ "value": "cs3099group-be-4",
+ "type": "text"
+ },
+ {
+ "enabled": true,
+ "key": "dummy_admin_username",
+ "value": "hafeez",
+ "type": "text"
+ },
+ {
+ "enabled": true,
+ "key": "dummy_admin_pass",
+ "value": "pass",
+ "type": "text"
+ },
+ {
+ "enabled": true,
+ "key": "dummy_project",
+ "value": "abc",
+ "type": "text"
+ },
+ {
+ "enabled": true,
+ "key": "access_token",
+ "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvYmplY3QiOnsidXNlcm5hbWUiOiJoYWZlZXoiLCJwYXNzd29yZEludGVybmFsIjpudWxsLCJjcmVhdGlvbkRhdGUiOiIyMDE4LTA0LTIxVDIyOjAwOjAxLjY3MloiLCJ1cGRhdGVkQXQiOiIyMDE4LTA0LTIxVDIyOjAwOjAxLjY3MloiLCJ1c2VyR3JvdXBzIjpbeyJpZCI6MSwibmFtZSI6ImxvZ2dpbmciLCJjYW5DcmVhdGVVc2VycyI6bnVsbCwiY2FuRGVsZXRlVXNlcnMiOm51bGwsImNhbkVkaXRVc2VycyI6bnVsbCwiY2FuQ3JlYXRlUHJvamVjdHMiOm51bGwsImNhbkRlbGV0ZVByb2plY3RzIjpudWxsLCJjYW5FZGl0UHJvamVjdHMiOm51bGwsImNhbkFjY2Vzc0xvZ3MiOnRydWUsImlzSW50ZXJuYWwiOmZhbHNlLCJkZXNjcmlwdGlvbiI6IkFsbG93cyBQb3N0IHRvIExvZyIsIlVzZXJIYXNQcml2aWxlZ2UiOnsidXNlcm5hbWUiOiJoYWZlZXoiLCJwcml2aWxlZ2VJZCI6MX19LHsiaWQiOjIsIm5hbWUiOiJhZG1pbiIsImNhbkNyZWF0ZVVzZXJzIjp0cnVlLCJjYW5EZWxldGVVc2VycyI6dHJ1ZSwiY2FuRWRpdFVzZXJzIjp0cnVlLCJjYW5DcmVhdGVQcm9qZWN0cyI6dHJ1ZSwiY2FuRGVsZXRlUHJvamVjdHMiOnRydWUsImNhbkVkaXRQcm9qZWN0cyI6dHJ1ZSwiY2FuQWNjZXNzTG9ncyI6bnVsbCwiaXNJbnRlcm5hbCI6ZmFsc2UsImRlc2NyaXB0aW9uIjoiU3lzdGVtcyBhZG1pbiIsIlVzZXJIYXNQcml2aWxlZ2UiOnsidXNlcm5hbWUiOiJoYWZlZXoiLCJwcml2aWxlZ2VJZCI6Mn19XSwicHJvamVjdHMiOltdfSwiaWF0IjoxNTI0NDEzMzE1LCJleHAiOjE1MjQ0MzQ5MTV9.s7R5EEeUJSmukA58fMQmAcCDH0GttXFf54e5syWxeR0",
+ "type": "text"
+ },
+ {
+ "enabled": true,
+ "key": "refresh_token",
+ "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvYmplY3QiOnsidXNlcm5hbWUiOiJoYWZlZXoiLCJwYXNzd29yZEludGVybmFsIjpudWxsLCJjcmVhdGlvbkRhdGUiOiIyMDE4LTA0LTIxVDIyOjAwOjAxLjY3MloiLCJ1cGRhdGVkQXQiOiIyMDE4LTA0LTIxVDIyOjAwOjAxLjY3MloiLCJ1c2VyR3JvdXBzIjpbeyJpZCI6MSwibmFtZSI6ImxvZ2dpbmciLCJjYW5DcmVhdGVVc2VycyI6bnVsbCwiY2FuRGVsZXRlVXNlcnMiOm51bGwsImNhbkVkaXRVc2VycyI6bnVsbCwiY2FuQ3JlYXRlUHJvamVjdHMiOm51bGwsImNhbkRlbGV0ZVByb2plY3RzIjpudWxsLCJjYW5FZGl0UHJvamVjdHMiOm51bGwsImNhbkFjY2Vzc0xvZ3MiOnRydWUsImlzSW50ZXJuYWwiOmZhbHNlLCJkZXNjcmlwdGlvbiI6IkFsbG93cyBQb3N0IHRvIExvZyIsIlVzZXJIYXNQcml2aWxlZ2UiOnsidXNlcm5hbWUiOiJoYWZlZXoiLCJwcml2aWxlZ2VJZCI6MX19LHsiaWQiOjIsIm5hbWUiOiJhZG1pbiIsImNhbkNyZWF0ZVVzZXJzIjp0cnVlLCJjYW5EZWxldGVVc2VycyI6dHJ1ZSwiY2FuRWRpdFVzZXJzIjp0cnVlLCJjYW5DcmVhdGVQcm9qZWN0cyI6dHJ1ZSwiY2FuRGVsZXRlUHJvamVjdHMiOnRydWUsImNhbkVkaXRQcm9qZWN0cyI6dHJ1ZSwiY2FuQWNjZXNzTG9ncyI6bnVsbCwiaXNJbnRlcm5hbCI6ZmFsc2UsImRlc2NyaXB0aW9uIjoiU3lzdGVtcyBhZG1pbiIsIlVzZXJIYXNQcml2aWxlZ2UiOnsidXNlcm5hbWUiOiJoYWZlZXoiLCJwcml2aWxlZ2VJZCI6Mn19XSwicHJvamVjdHMiOltdfSwiaWF0IjoxNTI0NDEzMzE1LCJleHAiOjE1MjQ0MzQ5MTV9.s7R5EEeUJSmukA58fMQmAcCDH0GttXFf54e5syWxeR0",
+ "type": "text"
+ }
+ ],
+ "timestamp": 1524413315075,
+ "_postman_variable_scope": "environment",
+ "_postman_exported_at": "2018-04-22T19:36:41.321Z",
+ "_postman_exported_using": "Postman/5.5.2"
+} \ No newline at end of file
diff --git a/test/postman.json b/test/postman.json
index 164bdc1..6d8541b 100644
--- a/test/postman.json
+++ b/test/postman.json
@@ -1,64 +1,193 @@
{
+ "variables": [],
"info": {
"name": "JH",
- "_postman_id": "323a3189-bd95-4f51-b985-d2ca626300ec",
+ "_postman_id": "d9fad1ce-92af-fc2c-ff74-074fc681c7ee",
"description": "",
- "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
+ "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
"name": "authorised",
- "description": null,
+ "description": "",
"item": [
{
- "name": "/projects",
+ "name": "/projects/",
"request": {
- "auth": {
- "type": "bearer",
- "bearer": [
+ "url": {
+ "raw": "{{host}}/{{endpoint}}/projects/other?action=create",
+ "host": [
+ "{{host}}"
+ ],
+ "path": [
+ "{{endpoint}}",
+ "projects",
+ "other"
+ ],
+ "query": [
{
- "key": "token",
- "value": "{{access_token}}",
- "type": "string"
+ "key": "action",
+ "value": "create",
+ "equals": true,
+ "description": ""
}
- ]
+ ],
+ "variable": []
},
- "method": "GET",
+ "method": "POST",
"header": [
{
- "key": "",
- "value": "",
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Authorization",
+ "value": "Bearer {{access_token}}",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{}"
+ },
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "/projects/abc/files",
+ "request": {
+ "url": "{{host}}/{{endpoint}}/projects/{{dummy_project}}/files/file",
+ "method": "POST",
+ "header": [
+ {
+ "key": "Authorization",
+ "value": "Bearer {{access_token}}",
+ "description": ""
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": "",
"disabled": true
}
],
- "body": {},
+ "body": {
+ "mode": "formdata",
+ "formdata": [
+ {
+ "key": "userfile",
+ "description": "",
+ "type": "file",
+ "src": "checker_black.jpg"
+ }
+ ]
+ },
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "/projects/abc/files copy",
+ "request": {
"url": {
- "raw": "{{host}}/{{endpoint}}/projects",
+ "raw": "{{host}}/{{endpoint}}/projects/{{dummy_project}}/files/file?action=move",
"host": [
"{{host}}"
],
"path": [
"{{endpoint}}",
- "projects"
- ]
+ "projects",
+ "{{dummy_project}}",
+ "files",
+ "file"
+ ],
+ "query": [
+ {
+ "key": "action",
+ "value": "move",
+ "equals": true,
+ "description": ""
+ }
+ ],
+ "variable": []
+ },
+ "method": "POST",
+ "header": [
+ {
+ "key": "Authorization",
+ "value": "Bearer {{access_token}}",
+ "description": ""
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n\t\"path\": \"newFile\"\n}"
},
"description": ""
},
"response": []
},
{
- "name": "/log",
+ "name": "/projects/abc/files",
"request": {
- "auth": {
- "type": "bearer",
- "bearer": [
+ "url": "{{host}}/{{endpoint}}/projects/{{dummy_project}}/files/",
+ "method": "GET",
+ "header": [
+ {
+ "key": "Authorization",
+ "value": "Bearer {{access_token}}",
+ "description": ""
+ },
+ {
+ "key": "Content-Type",
+ "value": "image/png",
+ "description": "",
+ "disabled": true
+ }
+ ],
+ "body": {
+ "mode": "formdata",
+ "formdata": [
{
- "key": "token",
- "value": "{{access_token}}",
- "type": "string"
+ "key": "pres",
+ "value": "",
+ "description": "",
+ "type": "file"
}
]
},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "/projects",
+ "request": {
+ "url": "{{host}}/{{endpoint}}/projects",
+ "method": "GET",
+ "header": [
+ {
+ "key": "Authorization",
+ "value": "Bearer {{access_token}}",
+ "description": ""
+ }
+ ],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "/log",
+ "request": {
+ "url": "{{host}}/{{endpoint}}/log",
"method": "GET",
"header": [
{
@@ -67,16 +196,9 @@
"disabled": true
}
],
- "body": {},
- "url": {
- "raw": "{{host}}/{{endpoint}}/log",
- "host": [
- "{{host}}"
- ],
- "path": [
- "{{endpoint}}",
- "log"
- ]
+ "body": {
+ "mode": "raw",
+ "raw": ""
},
"description": ""
},
@@ -85,28 +207,17 @@
{
"name": "/_supported_protocols",
"request": {
- "auth": {
- "type": "noauth"
- },
+ "url": "{{host}}/{{endpoint}}/_supported_protocols_",
"method": "GET",
"header": [
{
- "key": "",
- "value": "",
+ "key": "Authorization",
+ "value": "Bearer {{access_token}}",
+ "description": "",
"disabled": true
}
],
"body": {},
- "url": {
- "raw": "{{host}}/{{endpoint}}/_supported_protocols_",
- "host": [
- "{{host}}"
- ],
- "path": [
- "{{endpoint}}",
- "_supported_protocols_"
- ]
- },
"description": ""
},
"response": []
@@ -114,74 +225,120 @@
{
"name": "/project_roles",
"request": {
- "auth": {
- "type": "bearer",
- "bearer": [
- {
- "key": "token",
- "value": "{{access_token}}",
- "type": "string"
- }
- ]
- },
+ "url": "{{host}}/{{endpoint}}/project_roles",
"method": "GET",
"header": [
{
- "key": "",
- "value": "",
+ "key": "Authorization",
+ "value": "Bearer {{access_token}}",
+ "description": "",
"disabled": true
}
],
"body": {},
- "url": {
- "raw": "{{host}}/{{endpoint}}/project_roles",
- "host": [
- "{{host}}"
- ],
- "path": [
- "{{endpoint}}",
- "project_roles"
- ]
- },
"description": ""
},
"response": []
},
{
- "name": "/projects/",
+ "name": "/project_roles copy",
+ "request": {
+ "url": "{{host}}/{{endpoint}}/current_user",
+ "method": "GET",
+ "header": [
+ {
+ "key": "authorization",
+ "value": "bearer {{access_token}}",
+ "description": ""
+ }
+ ],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "/projects/abc/files_by_id",
"request": {
- "auth": {
- "type": "bearer",
- "bearer": [
+ "url": "{{host}}/{{endpoint}}/projects/{{dummy_project}}/files_by_id/d124ef49-e9e3-4794-bf50-76f40797b5d5",
+ "method": "GET",
+ "header": [
+ {
+ "key": "Authorization",
+ "value": "Bearer {{access_token}}",
+ "description": ""
+ },
+ {
+ "key": "Content-Type",
+ "value": "image/png",
+ "description": "",
+ "disabled": true
+ }
+ ],
+ "body": {
+ "mode": "formdata",
+ "formdata": [
{
- "key": "token",
- "value": "{{access_token}}",
- "type": "string"
+ "key": "pres",
+ "value": "",
+ "description": "",
+ "type": "file"
}
]
},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "/",
+ "request": {
+ "url": "{{host}}/",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "/properties",
+ "request": {
+ "url": "{{host}}/{{endpoint}}/properties",
+ "method": "GET",
+ "header": [
+ {
+ "key": "Authorization",
+ "value": "Bearer {{access_token}}",
+ "description": ""
+ }
+ ],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "/projects/ copy",
+ "request": {
+ "url": "{{host}}/{{endpoint}}/projects/{{dummy_project}}",
"method": "POST",
"header": [
{
"key": "Content-Type",
- "value": "application/json"
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Authorization",
+ "value": "Bearer {{access_token}}",
+ "description": ""
}
],
"body": {
"mode": "raw",
"raw": "{}"
},
- "url": {
- "raw": "{{host}}/{{endpoint}}/projects/{{dummy_project}}",
- "host": [
- "{{host}}"
- ],
- "path": [
- "{{endpoint}}",
- "projects",
- "{{dummy_project}}"
- ]
- },
"description": ""
},
"response": []
@@ -192,19 +349,8 @@
"name": "/oauth/token",
"event": [
{
- "listen": "prerequest",
- "script": {
- "id": "7cbb2980-4092-4675-af5e-cfcbd1c00b81",
- "type": "text/javascript",
- "exec": [
- ""
- ]
- }
- },
- {
"listen": "test",
"script": {
- "id": "7ce27395-de92-457b-97cc-7728824c821d",
"type": "text/javascript",
"exec": [
"let res = JSON.parse(responseBody);",
@@ -215,9 +361,7 @@
}
],
"request": {
- "auth": {
- "type": "noauth"
- },
+ "url": "{{host}}/{{endpoint}}/oauth/token",
"method": "POST",
"header": [
{
@@ -248,17 +392,6 @@
}
]
},
- "url": {
- "raw": "{{host}}/{{endpoint}}/oauth/token",
- "host": [
- "{{host}}"
- ],
- "path": [
- "{{endpoint}}",
- "oauth",
- "token"
- ]
- },
"description": "wefrwrbjk;"
},
"response": []
diff --git a/test/postman.json.json b/test/postman.json.json
deleted file mode 100644
index 14771e0..0000000
--- a/test/postman.json.json
+++ /dev/null
@@ -1,245 +0,0 @@
-{
- "variables": [],
- "info": {
- "name": "JH",
- "_postman_id": "d9fad1ce-92af-fc2c-ff74-074fc681c7ee",
- "description": "",
- "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
- },
- "item": [
- {
- "name": "authorised",
- "description": "",
- "item": [
- {
- "name": "/projects",
- "request": {
- "url": "{{host}}/{{endpoint}}/projects",
- "method": "GET",
- "header": [
- {
- "key": "",
- "value": "",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": ""
- },
- "description": ""
- },
- "response": []
- },
- {
- "name": "/log",
- "request": {
- "url": "{{host}}/{{endpoint}}/log",
- "method": "GET",
- "header": [
- {
- "key": "",
- "value": "",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": ""
- },
- "description": ""
- },
- "response": []
- },
- {
- "name": "/_supported_protocols",
- "request": {
- "url": "{{host}}/{{endpoint}}/_supported_protocols_",
- "method": "GET",
- "header": [
- {
- "key": "Authorization",
- "value": "Bearer {{access_token}}",
- "description": "",
- "disabled": true
- }
- ],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "/project_roles",
- "request": {
- "url": "{{host}}/{{endpoint}}/project_roles",
- "method": "GET",
- "header": [
- {
- "key": "Authorization",
- "value": "Bearer {{access_token}}",
- "description": "",
- "disabled": true
- }
- ],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "/projects/",
- "request": {
- "url": "{{host}}/{{endpoint}}/projects/{{dummy_project}}",
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- },
- {
- "key": "Authorization",
- "value": "Bearer {{access_token}}",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{}"
- },
- "description": ""
- },
- "response": []
- },
- {
- "name": "/projects/abc/files_by_id",
- "request": {
- "url": "{{host}}/{{endpoint}}/projects/{{dummy_project}}/files_by_id/d124ef49-e9e3-4794-bf50-76f40797b5d5",
- "method": "GET",
- "header": [
- {
- "key": "Authorization",
- "value": "Bearer {{access_token}}",
- "description": ""
- },
- {
- "key": "Content-Type",
- "value": "image/png",
- "description": "",
- "disabled": true
- }
- ],
- "body": {
- "mode": "formdata",
- "formdata": [
- {
- "key": "pres",
- "description": "",
- "type": "file",
- "src": "triangle_down_black.png"
- }
- ]
- },
- "description": ""
- },
- "response": []
- },
- {
- "name": "/projects/abc/files",
- "request": {
- "url": "{{host}}/{{endpoint}}/projects/{{dummy_project}}/files/path/to/image.png",
- "method": "POST",
- "header": [
- {
- "key": "Authorization",
- "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvYmplY3QiOnsidXNlcm5hbWUiOiJoYWZlZXoiLCJwYXNzd29yZEludGVybmFsIjpudWxsLCJjcmVhdGlvbkRhdGUiOiIyMDE4LTA0LTE2VDEyOjA1OjUyLjQ2N1oiLCJ1cGRhdGVkQXQiOiIyMDE4LTA0LTE2VDEyOjA1OjUyLjQ2N1oiLCJ1c2VyR3JvdXBzIjpbeyJpZCI6MSwibmFtZSI6ImxvZ2dpbmciLCJjYW5DcmVhdGVVc2VycyI6bnVsbCwiY2FuRGVsZXRlVXNlcnMiOm51bGwsImNhbkVkaXRVc2VycyI6bnVsbCwiY2FuQ3JlYXRlUHJvamVjdHMiOm51bGwsImNhbkRlbGV0ZVByb2plY3RzIjpudWxsLCJjYW5FZGl0UHJvamVjdHMiOm51bGwsImNhbkFjY2Vzc0xvZ3MiOnRydWUsImlzSW50ZXJuYWwiOmZhbHNlLCJkZXNjcmlwdGlvbiI6IkFsbG93cyBQb3N0IHRvIExvZyIsIlVzZXJIYXNQcml2aWxlZ2UiOnsidXNlcm5hbWUiOiJoYWZlZXoiLCJwcml2aWxlZ2VJZCI6MX19LHsiaWQiOjIsIm5hbWUiOiJhZG1pbiIsImNhbkNyZWF0ZVVzZXJzIjp0cnVlLCJjYW5EZWxldGVVc2VycyI6dHJ1ZSwiY2FuRWRpdFVzZXJzIjp0cnVlLCJjYW5DcmVhdGVQcm9qZWN0cyI6dHJ1ZSwiY2FuRGVsZXRlUHJvamVjdHMiOnRydWUsImNhbkVkaXRQcm9qZWN0cyI6dHJ1ZSwiY2FuQWNjZXNzTG9ncyI6bnVsbCwiaXNJbnRlcm5hbCI6ZmFsc2UsImRlc2NyaXB0aW9uIjoiU3lzdGVtcyBhZG1pbiIsIlVzZXJIYXNQcml2aWxlZ2UiOnsidXNlcm5hbWUiOiJoYWZlZXoiLCJwcml2aWxlZ2VJZCI6Mn19XSwicHJvamVjdHMiOltdfSwiaWF0IjoxNTIzODgwMzU2LCJleHAiOjE1MjM5MDE5NTZ9.LrRWCzjBQmPtEkthmPJvVdl6XsYqA4Myqw-VFHMbQ8o",
- "description": ""
- },
- {
- "key": "Content-Type",
- "value": "image/png",
- "description": ""
- }
- ],
- "body": {
- "mode": "formdata",
- "formdata": [
- {
- "key": "triangle",
- "description": "",
- "type": "file",
- "src": "triangle_down_black.png"
- }
- ]
- },
- "description": ""
- },
- "response": []
- },
- {
- "name": "/",
- "request": {
- "url": "{{host}}/",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- }
- ]
- },
- {
- "name": "/oauth/token",
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "let res = JSON.parse(responseBody);",
- "postman.setEnvironmentVariable(\"access_token\", res.access_token);",
- "postman.setEnvironmentVariable(\"refresh_token\", res.refresh_token);"
- ]
- }
- }
- ],
- "request": {
- "url": "{{host}}/{{endpoint}}/oauth/token",
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/x-www-form-urlencoded"
- }
- ],
- "body": {
- "mode": "urlencoded",
- "urlencoded": [
- {
- "key": "grant_type",
- "value": "password",
- "description": "",
- "type": "text"
- },
- {
- "key": "username",
- "value": "{{dummy_admin_username}}",
- "description": "",
- "type": "text"
- },
- {
- "key": "password",
- "value": "{{dummy_admin_pass}}",
- "description": "",
- "type": "text"
- }
- ]
- },
- "description": "wefrwrbjk;"
- },
- "response": []
- }
- ]
-} \ No newline at end of file