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

in blog •  7 years ago 

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!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Calling @originalworks :)
img credz: pixabay.com
Nice, you got a 4.0% @minnowbooster upgoat, thanks to @sam4tech
Want a boost? Minnowbooster's got your back!

The @OriginalWorks bot has determined this post by @sam4tech to be original material and upvoted(2%) it!

ezgif.com-resize.gif

To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!

Using Node with Typescript is fun. I came from a background of strongly typed languages and Typescript is a great help in comparison to vanilla JS. It makes refactoring much faster and less likely to run into a bug because of a type mismatch.

I still seem to have an issue where I need plain Javascript for the front end. I'm using riot, which is an excellent minimalist library for a reactive front end (while handlebars is excellent for the backend). Unfortunately it seems that not many editors support riotjs fully. The use of components does ease up the pain of refactoring unless a backend API changes that multiple components use.

My isomorphic app has riotjs for the front end and handlebars for the backend. Built on express and of course, typescript whenever possible.

MongoDB is an excellent choice, however you may want to check out ArangoDB if you find yourself shoving a square peg in a round hole with your data.

Good luck on your project!