Skip to content

Commit

Permalink
Merge pull request #59 from RUGSoftEng/release-iteration2.1
Browse files Browse the repository at this point in the history
Release (Iteration 2.1)
  • Loading branch information
martinavagyan authored Jun 2, 2017
2 parents a53bf8c + 701571a commit a3b15a1
Show file tree
Hide file tree
Showing 47 changed files with 1,937 additions and 805 deletions.
6 changes: 6 additions & 0 deletions .directory
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Dolphin]
Timestamp=2017,5,28,14,25,41
Version=3

[Settings]
HiddenFilesShown=true
33 changes: 33 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
language: node_js

env:
- CXX=g++-4.9

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9

services:
- mongodb

node_js:
- "stable"

notifications:
slack:
on_success: never
on_failure: never
email:
on_success: never
on_failure: never

before_script:
- sleep 15
- mongo mydb_test --eval 'db.addUser("travis", "test");'
- npm install

script:
- npm test
33 changes: 5 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ Running project: [VIEW](https://medid.herokuapp.com/)

Client-side documentation: [VIEW](https://htmlpreview.github.io/?https://raw.githubusercontent.com/RUGSoftEng/2017-Medical-ID/develop/doc/index.html)

**Install and run instructions:**
**Install and run instructions:**
Ensure you have Python2.7 and NodeJS installed on your machine.

In app.js, you can find the mongoose.connect() function. In here, you will find the address of the Mongo database. Replace this with the address of the Mongo database you would like to use.

In forgot.js, there are two sections as such:

'''sh
```sh
auth: {
user: '[email protected]',
pass: 'enterpasswordhere'
}
'''
```

Here, you should enter the username and password of the account you would like to send the password reset emails.

Expand All @@ -27,28 +29,3 @@ $ npm install
```sh
$ npm start
```


### cmd Reminders ###

**Obtaining files:**
git clone -b develop https://github.com/RUGSoftEng/2017-Medical-ID.git
git pull origin develop

**Creating a new branch:**
git checkout -b newBranch develop

**Before a push:**
git status
git add folderName/* (or: git add -A)
(remove file:) git rm fileName
git commit -m "I just did some change"
git push origin branchName

**Add tag:**
git tag -a tagName hashofCommit -m "tagging message"
git push --follow-tags

**Delete tag:**
git tag -d tagName
git push --delete origin tagName
16 changes: 11 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ var mongo = require('mongodb');
var mongoose = require('mongoose');
var serverSettings = require('./serverSettings.js');
var forceHttps = require('express-force-https');
mongoose.Promise = require('bluebird');

mongoose.connect(serverSettings.parameters.db || 'mongodb://root:[email protected]:27017,med-shard-00-01-mgwxu.mongodb.net:27017,med-shard-00-02-mgwxu.mongodb.net:27017/loginapp?ssl=true&replicaSet=med-shard-0&authSource=admin');

if (serverSettings.parameters.db) {
console.log("Connected to custom database '" + serverSettings.parameters.db + "'.");
}

//mongoose.connect('mongodb://localhost/loginapp');
var db = mongoose.connection;

var routes = require('./routes/index');
var users = require('./routes/users');
var create = require('./routes/create');
var save = require('./routes/save');
var profile = require('./routes/profile');
Expand Down Expand Up @@ -93,10 +93,11 @@ app.use(function (req, res, next) {
next();
});


// Needed for testing:
if (serverSettings.parameters.test)
app.use(serverSettings.parameters.test);

app.use('/', routes);
app.use('/users', users);
app.use('/create', create);
app.use('/save', save);
app.use('/profile', profile);
Expand All @@ -106,6 +107,11 @@ app.use('/forgot', forgot);
// Set Port
app.set('port', (process.env.PORT || 3000));

app.listen(app.get('port'), function(){
var server = app.listen(app.get('port'), function(){
console.log("Server started on port " + app.get('port') + ".");
});

module.exports = {
'app': app,
'server': server
};
28 changes: 22 additions & 6 deletions doc/card.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h1 class="page-title">Source: card.js</h1>

<section>
<article>
<pre class="prettyprint source linenums"><code>define(['jspdf', 'jquery', 'medid/res'], function(jsPDF, $) {
<pre class="prettyprint source linenums"><code>define(['jspdf', 'jquery', 'medid/hyphenator', 'medid/res'], function(jsPDF, $, hyphenator) {

/**
* The card module implements card creation functionality upon the creator.js module.
Expand All @@ -35,6 +35,7 @@ <h1 class="page-title">Source: card.js</h1>
* @exports MIDcard
* @requires jquery
* @requires jsPDF
* @requires hyphenator
* @required res
*/
var MIDcard = {};
Expand Down Expand Up @@ -81,8 +82,8 @@ <h1 class="page-title">Source: card.js</h1>
var leftStartPos = [12,55], rightStartPos = [38,30];
var lineHeight = 5, leftLabelWidth = 19, rightLabelWidth = 21;
for (i = 0; i &lt; fields.length &amp;&amp; i &lt; creator.cardNum; i++) {
fields[i].label = fields[i].label.substring(0, 13);
fields[i].field = fields[i].field.substring(0, 19);
fields[i].label = fields[i].label.substring(0, 14);
fields[i].field = fields[i].field.substring(0, 20);
if (fields[i].label == 'Donor' || fields[i].label == 'Blood type') {
// We place the short fields 'donor' and 'blood type' in the corner
if (leftCounter &lt; 2) { // Max capacity
Expand Down Expand Up @@ -123,8 +124,23 @@ <h1 class="page-title">Source: card.js</h1>
doc.text(104, 19, "SCAN FOR MORE INFORMATION");

// Retrieving QR code from server
$.get('/save/qr', function(qrcode) {
doc.addImage(qrcode, 'JPEG', 123, 25, 38, 38);
$.getJSON("/save/code", function(code) {
if (code.code) {
doc.addImage(code.qr, 'JPEG', 105, 25, 38, 38);
doc.setFontSize(8);
doc.setFontStyle("normal");
doc.setTextColor(124,124,124);
doc.text(145, 34, "Don't have a code scanner?");
doc.text(145, 38, "Go to:");
doc.setTextColor(0,0,0);
doc.setFontStyle("bold"); doc.text(150, 42, "medid.herokuapp.com"); doc.setFontStyle("normal");
doc.setTextColor(124,124,124);
doc.text(145, 46, "Enter the code:");
doc.setTextColor(0,0,0);
doc.setFontStyle("bold"); doc.text(150, 50, hyphenator.insertHyphen(code.code)); doc.setFontStyle("normal");
} else {
doc.addImage(code.qr, 'JPEG', 123, 25, 38, 38);
}
callback(doc);
})
}
Expand Down Expand Up @@ -170,7 +186,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-cr
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Thu May 04 2017 10:05:08 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Wed May 24 2017 15:18:01 GMT+0200 (CEST)
</footer>

<script> prettyPrint(); </script>
Expand Down
Loading

0 comments on commit a3b15a1

Please sign in to comment.