First of all copy config.js.dist
to config.js
file
cp ./server/config.js.dist ./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.
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": "admin@admin.com", "password": "password" }
- Sign-in new userPOST /api/signout {}
- Sign-out current user (if you've successfully signed in before)POST /api/signup { "email": "admin@admin.com", "password": "password", "firstName": "Admin", "lastName": "System" }
- Sign up new user
Actually at the moment you have 2 entity types in your database:
- User - Document structure is:
{
"_id": {
"$oid": "572fccb1f8c2e76df19c652e"
},
"email": "admin@admin.com",
"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.