DEV Community

Cover image for ✨💻My Project for 2020: 🚄Node On Rails🚄
Michael "lampe" Lazarski
Michael "lampe" Lazarski

Posted on • Updated on

✨💻My Project for 2020: 🚄Node On Rails🚄

🛑Disclaimer

As of the time writing this blog post, this project is not meant to be “production-ready”. This is a hobby project to learn new technologies, frameworks, and general exercise.

⏮Preface

I always loved Ruby and Ruby on Rails. Ruby is just such an elegant language and also easy to read and, most of the time, too easy to understand. My first experience of MVC was with RoR, and even my first more significant project was written in RoR. It was a Yelp-like app before Yelp was popular.

Then meteorjs came, and I loved it too. I was already used to code in Javascript. I mean, you have to when you want to have some interaction with the user besides forms. Meteorjs was fantastic, and it was super fast to have an MVP up and running with meteorjs.

Meteorjs is kind of dead since the company named MDG behind meteorjs is now mostly working on the Apollo project. With that, we don’t have anything right now, at least in my opinion that comes near to the features and ease of use like these frameworks were back in their days.

I know that we have projects like sails.js, but that project did not have any updates since mid-June 2019. Then you have expressjs, which is as minimal as a framework can get, and you need to add everything on your own. This means everything — the database layer, the authentication provider, routing, logging, etc.

People usually say that they like that freedom and that they can pick what they want. Yes, sometimes you need this, and it is the right choice. I think that some projects, especially in their early phase, don’t need that kind of flexibility and want to get things done.

This is also why frameworks like laravel or dot.net are so popular. The basic and sometimes boring stuff is set up, and you can scaffold it with on command. You don’t have to think about so many technical details, and it is harder to screw up. Sometimes opinionated frameworks are the better choice.

✨Motivation

NodeJS and typescript are everywhere these days at big tech companies and small startups. Always bet on Javascript. Javascript will not go away in the next 10 to 20 years. Getting people to update their browsers will not be easy. Maybe we will not write directly Javascript, but in the end, it will be vanilla javascript after some transformation steps.

Setting up a new nodejs project is hard. Only configuring webpack and babeljs can be a big pain point. Not speaking about all the other stuff like coming up with a structure for a new project.

Frameworks like Ruby on Rails are often very opinionated about things like that. They are easy to use, and the project you never touched is easy to understand because you know the skeleton of the project.

This is why this year, I want to start a hobby project and work on it. It should be as easy to use and understand as Ruby on Rails, but it should be based on node js. Also, it should use modern Javascript and, for example, avoid this as much as possible.

🛠Technological choices

  • Node js
  • Typescript
  • Eslint
  • Yarn
  • Yarn workspaces
  • Docker
  • Docker compose
  • Typeorm.io
  • Mongodb
  • Graphql
  • Redis

This is just the first draft of the tools/libs/frameworks that I want to use. This list will change over time. You can see right now there is no testing framework, for example. This is still a hobby project, and I don’t want to plan everything from the beginning and add things when needed.

⏭ Next steps

The first step will be setting up a new project. Since node-on-rails should be modular and easy to maintain, I will make it a mono repo on GitHub. This means that all the code and packages and all the extra things will be in one git repo.

Okay, after that is done, I will start to implement the CLI, the core, and a basic project.

The CLI should generate a new project and all the other things like models or tests etc.

The Core should have the minimal basic things needed to bootstrap the rest. What minimal means? I have no clue. This is what I will explore with that project.

Somewhere in that process, I will post the link to the repo.

I will have it open for contribution, right away and every input is welcome!

👍 How can you help?

By sharing, linking, and posting and discussing suggestions!
I already posted a question yesterday on twitter about how the folder structure should look. you can find that tweet >>here<<

👋Say Hello! Instagram | Twitter | LinkedIn | Medium | Twitch | YouTube

Top comments (29)

Collapse
 
harryadel profile image
Harry Adel • Edited

Meteorjs is kind of dead since the company named MDG behind meteorjs is now mostly working on the Apollo project.

Please don't spread misinformation. MDG is longer the company behind Meteor.

Tiny has acquired Meteor and Meteor Galaxy (The official Meteor Deployment service, think Atlas to MongoDB) and is dedicated on bringing Meteor back to the spotlight.

dev.to/harryadelb/tiny-acquires-me...

Meteor 1.9 is about to be released too BTW. And many more great changes coming its way.

github.com/meteor/meteor/pull/10527

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

I wrote my bachelor's thesis about meteor and I organized meteorjs Meetups in my city. I also worked professionally with meteor for over 5 years.

I was working with meteor bevor atmosphere and meteor packages even excited so yeah I think I know what I'm saying.

Looking big at the promises and the maintainers from mdg. They are working more on Apollo then on meteor.

Maybe meteor is not dead but it's on life support.

As of today I would not recommend anyone using neteorjs.

Collapse
 
harryadel profile image
Harry Adel • Edited

You've a solid background no doubt and I appreciate your enthusiasm for Meteor. And I'm even totally okay with your current stance on whether or not to recommend Meteor. But what does that have to do with stating proper facts? Tiny is the company behind Meteor; not MDG. And, while Meteor suffered a while of low attention by MDG; It's still going strong with active development and many plans for the future!

I don't want you to take personally and sorry if I have offended you, thanks.

Thread Thread
 
lampewebdev profile image
Michael "lampe" Lazarski

No offense taken.

I was just burned to often by MeteorJS.

I hope tiny can fix some of the biggest problems of meteor.

For me the 2 top important would be

  • make meteor an npm package
  • make testing easier and faster on larger apps
Thread Thread
 
harryadel profile image
Harry Adel

Glad, we could find mutual ground.

make testing easier and faster on larger apps

They're working on improving the testing docs in the new roadmap.

Collapse
 
johngoldsmith profile image
John

More misinformation:

I know that we have projects like sails.js but that project did not have any updates since mid-June 2019

According to Github, the last commit was on Dec 16, 2019.

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

It is a typo fix 🤨

The last release was 8 months ago according to GitHub.

Collapse
 
andreacanton profile image
Andrea Canton • Edited

how about adonisjs? (however seems a great project yours!)

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Yes I have seen it but never used it.

Collapse
 
michi profile image
Michael Z

Adonis is the Laravel of Node. Definitely check it out if you need some inspiration.

Collapse
 
drewtownchi profile image
Drew Town

It sounds like a fun and challenging project to take on!

To me, minimal for these sort of Rails, Django, Keystone types of projects has 3 major components: Auth, Admin UI, Auto-model scaffolding.

Those 3 things should show up as either a part of the core or as first-class plugins.

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Yes for me auth and data scaffolding are also very important and should be a first party package.

A admin-ui can be an plugin but can also the a 3rd party aka community plugin :)

but yeah in general more scaffolding like in rails would be nice :)

Collapse
 
dploeger profile image
Dennis Ploeger

Please keep in mind to support the local development environment regarding requirements.

Sometimes developers are overwhelmed when they need to setup a MongoDB, Redis or stuff like that in order to get started; so something like a docker compose stack for example could be quite useful.

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Yes I am also thinking that it should run without docker.

For example the required db could be sqlite3

But yeah I'm with your general suggestion

Collapse
 
ben profile image
Ben Halpern

Interesting

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

I hope it is and also that the journey will be interesting for people 😊🙌

Collapse
 
mgce profile image
Mateusz Gajda

Why you decided to use mongo instead for example postgres? Relational databases are better choices in most cases because only sometimes we don't need to make a relations between object.

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

I'm just used to mongodb in most projects.

I want to use TypeORM so adding other Databases should be easy :)

Collapse
 
ilyalibin profile image
Ilya Libin

Isn’t it called Sailsjs?
sailsjs.com/

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Isn't sails like kind of not really maintained any more?

Collapse
 
charbelsako profile image
Charbel Sarkis

This is great.
I wish to learn a thing or two.

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

I hope to learn new things too :)

Collapse
 
obone profile image
O.B.One

I will recommend you to check the SugoiJS project (wiki.sugoijs.com/) you might find it satisfying for your needs:)

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

I will have a look

This project is more for me to learn not to have something in production. If it ended up in production it would be cool but it's not a must for me 👍😄