3Dpals/3Dpal — pull request #10 by Aldream (2013-11-27 00:42:21+00:00)
Title: REST API

### This Pull Request contains:

- The models used by our service:
- ***User*** (with some protection for the passwords)
- ***Model*** (previously named *3dObject*)
- ***Comment***
- ***File***

Note that there are some differences with the models we defined previously (ex: fields have been renamed or added, *Right* has been replaced by a recommended solution for NoSQL, ...)

- The ***REST API*** based on theses models, with the routing done.
- Not everything has been tested yet (especially the last models, ie *Comment* and *File*)
- The routing has been done, but can be subject to improvements (easily editable)
- Some useless services may have been implemented, some useful may have been forgotten (though I tried to cover all the user cases I could see)

### More about the *Rights Management*:

After reading more about MongoDB and NoSQL solutions, I realized the solution with a *Right* table with 2 foreign keys, one for the *User* and one for the *Model*, wasn't optimal for MongoDB (union like with SQL can't be cleanly done, and denormalization of the models should be applied instead).

So I replaced this *Right* document by some fields in *User* and *Model*. They are redundant, but it is the cleanest and most optimal solution I could come with, trying to think NoSQL.