First of all copy config.js.dist
to config.js
file
cp ./server/config.js.dist ./server/config.js
To set up this application you should go to MongoLab sign up a new account
and create a new free tier database with the name scrum
. Then go to Account users page choose your user
copy API key and paste it into server/config.js
file apiKey
value. Also don't forget to enable Data API Access at the bottom of Account users page
Now you should run following command (assuming you have installed node.js on your machine, if not then plese visit node.js official website and install the latest node version):
$ cd ./server
$ npm install
$ npm start
- User signing in / signing out / signing up
- Proxying your MongoLab database through MongoLab REST API.
- Serve all the static files in the directory
../client/dist
POST /api/signin { "email": "[email protected]", "password": "password" }
- Sign-in new userPOST /api/signout {}
- Sign-out current user (if you've successfully signed in before)POST /api/signup { "email": "[email protected]", "password": "password", "firstName": "Admin", "lastName": "System" }
- Sign up new userGET /api/current-user
- get currently signed in user from server session
Actually at the moment you have 2 entity types in your database:
- User - Document structure is:
{
"_id": {
"$oid": "572fccb1f8c2e76df19c652e"
},
"email": "[email protected]",
"password": "password",
"admin": true,
"firstName": "Admin",
"lastName": "System"
}
- Project - Document structure is:
{
"_id": {
"$oid": "572fce2ff8c2e76df19c72ee"
},
"teamMembers": [
"572fcdbb0a00b26ba172c2a2" // <-- user._id.$oid
],
"name": "Test Project",
"desc": "The first project",
"productOwner": "572fccb1f8c2e76df19c652e", // <-- user._id.$oid
"scrumMaster": "572fcdbb0a00b26ba172c2a2" // <-- user._id.$oid
}
All the requests for the urls
/api/collections/__COLLECTION_NAME__/*
are proxied to
https://api.mongolab.com/api/1/databases/__DB_NAME__/collections/__COLLECTION_NAME__/
GET /api/collections/users/572fccb1f8c2e76df19c652e
Is proxied to
GET https://api.mongolab.com/api/1/databases/scrum/collections/users/572fccb1f8c2e76df19c652e
PUT /api/collections/projects/572fce2ff8c2e76df19c72ee {"name": "Real Project"}
Is proxied to
PUT https://api.mongolab.com/api/1/databases/scrum/collections/projects/572fccb1f8c2e76df19c652e {"name": "Real Project"}
Please read more details regarding MongoLab Data API here. In fact this is classic RESTful API.
To check that backend server works you should go to http://localhost:8000/api/health-check I should return following response:
)]}',
{
"status": true
}
All you need to do to set up the front end application is:
cd ./client
npm install && bower install
gulp serve