3 ms·
Ask HN: am I doing back-end right?
Hi, I have done quite few projects both in front-end and back-end. I've tried different technologies for both, but I think only back-end tech are relevant here: bare-bones PHP, Symphony, Node.js with Express and Passport, Flask
The thing is, when I have to make a front-end prototype it takes me under 1 hour to have the first prototype and the pipeline ready to continue, be it Javascript or CSS. However, when I have to do a project with a User system there are way too many details to consider, even if I'm using helpers as Pasport.js
For instance, for each of the PUT/POST/DELETE methods where there is some data, I need to check (in Express with Passport.js):
- Authentication
- Authorization
- Is the data valid?
- There is data at all
- DB validation as a ReGex or similar
- Build response (some times complex)
- Handle errors in EACH of the previous steps
I feel like I'm missing something as I'm repeating manually most of the steps. Is this the way it's supposed to be, that each POST method takes a large amount of checks?
- fiedzia 10y agoYes, you are missing a framework. With a decent one you'll get all of that for free, without doing anything at all. Try Django, and you'll get user, validation, authentication and more out of the box.
- franciscop 10y agoI am recently using Node.js with Express, which is a framework. I'll try Sails.js as it seems more complete, thanks.