totaljs / openplatform

OpenPlatform v5 is a beautiful and simple portal for running, integrating and managing multiple 3rd party web applications.
https://www.totaljs.com/openplatform/
MIT License
98 stars 48 forks source link

Port all the databases to a better tech #3

Closed ameykshirsagar closed 8 years ago

ameykshirsagar commented 8 years ago

How can I port the internal database of open platform from file based JSON storage to a better one like MongoDB??

Thanks

petersirka commented 8 years ago

Hi @ameykshirsagar, I think that it's not a problem. But users must be read into the memory.

Just update:

  1. save users https://github.com/totaljs/openplatform/blob/master/definitions/openplatform.js#L55
  2. load users https://github.com/totaljs/openplatform/blob/master/definitions/openplatform.js#L71

But you have to update applications and settings too. It's not complicated. Thank you!

ameykshirsagar commented 8 years ago

@petersirka : I tried the mongoose utilisation and so far I am able to do basic auth & users CRUD. But the notify part isn't working as it should.

petersirka commented 8 years ago

Did you mean notifications? If yes then update only two methods:

User.prototype.getNotifications: https://github.com/totaljs/openplatform/blob/master/models/model-user.js#L77

User.prototype.notify: https://github.com/totaljs/openplatform/blob/master/models/model-user.js#L107

It should work.

ameykshirsagar commented 8 years ago

Alright cool. Thanks a lot @petersirka