Why I coded my first website in nodeJS instead of Ruby On Rails, from 0 to 1. ?

sam4tech(55)
Published in
#blog
Words
572
Reading
3 min
9y
Listen to this post
~4 min

If I enjoy the front-end development of a website, mixing my knowledge of languages: HTML, CSS and JavaScript. For me, sticking specifications of the appearance of a website has no barrier, from design to code. Back-end development gives rise to more questions, from learning languages ​​to managing databases and using frameworks.

So e-store manager for an e-commerce website running prestashop for the e-commerce platform and WordPress for the blog. My web skills were limited to front-end development and UX.
During a brainstorming session, with the management and the sales team, an online growth axis was defined: a marketplace to put athletes in touch with organizers. I was asked to lead the development project for this platform. My only other constraint was to achieve it internally without budget line and without human means.

Although tried to learn Ruby or Pithon known for their "small" walk to the entrance and their learning curves. Or PHP for its ubiquity in CMS and other more standard projects. I made the choice to stay on a language that I knew to quickly write the first lines of code and avoid a gymnastics language front-end / back-end thanks to JavaScript.

NodeJS: the end of Javascript to dad

JavaScript with its server side overlay: NodeJS, presents for me five advantages:

  • it is asynchronous,
  • It natively manages the http,
  • He's effective,
  • It is suitable for a small team
  • It makes it easier to use REST APIs

Passionate about this new challenge, I structure my list of server-side knowledge needed to master the basic logic. I scour the available resources, learn, train me and especially apply thanks to this project! This choice will have allowed me to reach my first goal: quickly write the first lines of code and release a beta version in 2 months.

Thanks to the library available for NodeJS: NPM, I was able to integrate and manage quickly without complex programming:

  • the creation of user account,
  • management of access rights,
  • password hashing,
  • https redirection,
  • e-mail notifications ...

The packages available under NodeJS have been very useful and their documentation sufficiently accessible and supported to simplify their integration. The inevitable remains, in my opinion, the choice of templating package. I opted for "handlebars", if it is not the least verbose, the fact that it takes again the structure HTML allowed me to structure it quickly.

MongoDB the unstructured database

The other essential point, which is at the center of the structure, was the choice of the database. Starting on a project with a very undefined and uncluttered specifications, I opted for a noSQL mongoDB database. This had two advantages:
The mongoDB noSQL database makes it easier to change the structure of the database,
The query in nodeJS is in the form of JavaScript objects.

Soon Ruby On Rails

For all these reasons, staying on a server-side JavaScript environment was, for me and this project, a relatively simple, reassuring and effective solution.

I know that if the deadline had been longer, I would have embarked on a Ruby realisation with the Ruby on Rails frameworks. I think the achievement would have been more effective at writing for its less verbose side and the availability of a large library. As this involved learning a new language, I lacked confidence and dexterity to juggle a new language between the front end and the back end. It will be for a project!

Why I coded my first website in nodeJS instead of Ruby On Rails, fr... | Ecency