vendredi 3 juillet 2015

Pattern for Content Management in Node.js + Angular

I have an node.js/angular front-end application that displays news and upcoming events. This information comes as JSON from a backend server and is currently managed manually (i.e. editing the backend data base using db tools). The backend service also includes simple update operations on existing entries, like registering for an event or likeing a news item. User management is provided by yet another service.

The structure of the app still looks pretty much the way it was generated by yeoman angular.

We now want to extend the existing frontend app to be able to add, delete and fully modify the events and news content. The content backend service has already been extended to support the required CRUD operations. I am now wondering how to extend the frontend app in a smart way. I could only think of two possibilities which both don't satisfy me:

  1. I could 'pollute' the existing controllers by adding the content-management components to them, which is only enabled if a user with the specific rights is logged in. The thing is that we do not have different user rights implemented in our user management service yet, so that's a bit expensive, because the two backend services will need to communicate directly, without going through the frontend. But also I have concerns about the readability, maintainability and security of this approach.

  2. I could copy the modules and extend the copies. This is easier, particularly regarding access control. Basically that means that there is one static password and admin account (like now), which is has nothing to do with the existing user management. That is very easy, but also a bit web 1.0, and there will be a lot of redundancy in the modules.

I am lacking the experience in webdesign using current technologies, so I don't know which way to go from here. Can someone give me some recommendations/best practices/patterns/tricks?

Aucun commentaire:

Enregistrer un commentaire