For Voting on Stories and Tickets remotely and asynchronously e.g. planning poker
In order to install this application you need first to ensure that you have NPM installed With Node.JS version 6.8 or higher
To install the application get the code
git clone https://github.com/AgileVentures/AsyncVoter.git
Inside the folder AsyncVoter run the following command
npm install
At this point we have all the dependencies installed and we are ready to start
We currently deploy the app via dokku. We can create an app on dokku like so:
$ dokku create:app asyncvoter-api-test
Then we need a mongo db:
$ dokku mongo:create asyncvoter-api-test
which we must link to the app like so:
$ dokku mongo:link asyncvoter-api-test asyncvoter-api-test
and we also need to ensure that the MONGODB
environment variable is set as well, i.e.
$ dokku config:set asyncvoter-api-test mongodb://asyncvoter-api-test......etc.
and then it should all work 🎉
Please create a .env file (if you don't have one already) and copy the contents from .env.sample. This is needed before running your application.
... We will need to fill this up with mongo db connection info
If you are unsure what this means just: cp .env.sample .env
After the configuration is done we can start the application using
npm start
To run all the Chai/Mocha tests execute
npm test
To use the new cucumber tests execute:
npm run cucumber
If you get this error try cleaning the cache using
npm cache clean
If you are experiencing errors like:
Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
Make sure that the version of node is >= 6.8
node -v
Top-level routing is now handled in the src/routes.js
file. For domain-level sub-routes please use an appropriate routing file in the domain folder.
Please see src/routes.js
and src/story/story.routes.js
for examples of how it is done.
### GET /stories
curl localhost:3000/stories
[{
"_id":"58288ffb96bdf8316b234782",
"updatedAt":"2016-11-13T16:08:27.411Z",
"createdAt":"2016-11-13T16:08:27.411Z",
"name":"document the API",
"size":"0",
"url":"https://github.com/AgileVentures/AsyncVoter/issues/69",
"__v":0
}]
### POST /stories
curl -H "Content-Type: application/json" localhost:3000/stories -d '{"name": "document the API", "size": "0", "url": "https://github.com/AgileVentures/AsyncVoter/issues/69"}'
{
"__v":0,
"updatedAt":"2016-11-13T16:08:27.411Z",
"createdAt":"2016-11-13T16:08:27.411Z",
"name":"document the API",
"size":"0",
"url":"https://github.com/AgileVentures/AsyncVoter/issues/69",
"_id":"58288ffb96bdf8316b234782"
}
curl localhost:3000/stories
{
"_id":"58288e666023a72ff4856fe2",
"updatedAt":"2016-11-13T16:01:42.527Z",
"createdAt":"2016-11-13T16:01:42.527Z",
"__v":0
}
curl -H "Content-Type: application/json" -X PUT localhost:3000/stories -d '{"size": "3"}'
{
"_id":"58288ffb96bdf8316b234782",
"updatedAt":"2016-11-18T07:56:57.652Z",
"createdAt":"2016-11-13T16:08:27.411Z",
"name":"document the API",
"size":"3",
"url":"https://github.com/AgileVentures/AsyncVoter/issues/69",
"__v":0
}
curl -H "Content-Type: application/json" localhost:3000/stories/58288e666023a72ff4856fe2/votes
{
"__v":0,
"story":"58288e666023a72ff4856fe2",
"size":"1",
"_id":"5828908096bdf8316b234783"
}
curl -H "Content-Type: application/json" localhost:3000/stories/58288e666023a72ff4856fe2/votes -d '{"size": "1"}'
{
"__v":0,
"story":"58288e666023a72ff4856fe2",
"size":"1",
"_id":"5828908096bdf8316b234783"
}