# This is a prototype application that demonstrates a Document Publishing Service using Nodejs, Express, Passport, and Sequelize. 


## Test Platform

ubuntu-16.04.1-desktop-amd64
firefox: version 48

## Installation



```
npm install DPS
```

## Configuration


Run the setup script that creates the 'users' and 'docs' table. It also adds a default user 
(username: `user`, email: cfjs@outlook.com, password: `user`) and a default document. 
From the root directory run:

```
../bin/node setup.js
```

## Run the application

From the  DPS root folder of the project you can run the application with: 
```
nohup ../bin/node app.js &
```
logs all transactions of the service at the 'nohup.out' file.

You can then access the application on `http://localhost:8080`.


## Run the tests

Nightwatch works with the Selenium standalone server so the first thing you need to do is download 
the selenium server jar file:
 `https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar`

Download 'selenium-server-standalone-2.53.1.jar' at the DPS root folder 


Install nightwatch: 

from the root folder run:

```
../bin/npm install  nightwatch
```
Install JDK

```
sudo apt-get install default-jdk
``` 

run the tests

```
../bin/node node_modules/nightwatch/bin/runner.js
```

## References

* [Node.js](https://nodejs.org/en/)
* [Express](http://expressjs.com/)
* [Passport](http://passportjs.org)
* [Sequelize](http://sequelizejs.com)
* [Multer](https://github.com/expressjs/multer)
* [Handlebars](http://handlebarsjs.com/)
* [Nightwatch](http://nightwatchjs.org/)


## License


License: The MIT License (MIT) cfjs AT outlook.com
