Wednesday 18 November 2015

Confused about architecting my next web/mobile app

Warning, wall of text.I've started a personal project which involves building a website that has user login/registration (including a backend where users will be able to do something) and an app that will enable the user to do almost the same (but it will be a native app), plus call a few other APIs.Now, the website itself will have a few static pages (i.e. home, FAQ, About, Features, etc). The main focus will be on the backend - in other words, the interface once the user logs in.This is my first time building a Node.js app (have been a front-end dev for a while) and it seems very simple. The last time I was working on backend it was with PHP (during 5.2.x days) and ASP.NET MVC 4. So, it's been some time, but not too long for me to forget all the basic concepts and principles.The way I envisioned this website to work is to have everything served by Node (jade templates, including the user's backend, etc). In addition, I will have 4-5 API endpoints that the mobile app will call. In my opinion, the frontend JavaScript required in this case would be minimal - maybe some events and that's all.I've started working on this and it is going alright - I've had some issues. For example, I've been having issues coupling passport-local and Json Web Token. I would like to use JWT instead of session ID for authentication, but I'm having issues making it work.However, the more I've been reading the literature online, the less inclined I am to believe that this is the right approach. It seems that, even with Node, the focus is still heavily on the frontend, whereas the Node is just providing the API endpoints. Whatever example I find seems to be using Angular or Backbone. For example, while looking for a way to get JWT to work, I've found a dozen articles saying "oh, just send an AJAX request via Angular/jQuery/Backbone, obtain the token, and then add the token to the Auth header".I am familiar with Backbone and would be open to learning React and/or Angular. At my workplace, we use Backbone to render web components, and all they do is pull data from an API and then get rendered.I am perfectly fine with this more front-end heavy approach as well - I'm not too deep into the app, so I can scrap it a little bit and restructure it, but I would like your advice on which approach to follow. Focus more on the frontend or the backend? Or have a nice, even split between the two?

Submitted November 19, 2015 at 06:24AM by Deusdies

No comments:

Post a Comment