Just pay close attention to the version you’re using and the docs version and whether a feature is experimental or deprecated. A great way is honestly just perusing the docs. ![]() I’d really probably start, before even doing any of that, by learning the Node-specific capabilities like file system (fs). And don’t fall into the trap that you can just serve your app directly using a Node http server and not use an actual web server as a reverse proxy - this is commonly shown in tutorials for brevity but rarely identified as a terrible, insecure practice in the real world. Last, I’d suggest learning how to stand that app up behind an Nginx reverse proxy. I’d also add to that target building the whole app and leveraging your own API as well as well as using a database like Mongo or another NoSQL DB. If you really want to learn Node itself rather than use it for managing a front-end app during development, I second the recommendation to build something with Express and learn what middleware means in the JS world, and an API is a great start. Nodejs switch has been great for me - hope it helps you too. But eventually stuck to the approach I have shared above. I got lost in the famework world of nodejs. I realised this as I was making an app using hotwire-android & hotwire-ios and after 2 weeks switched to native app wrappers on Rails webview.Īnd 2 weeks ago - I was starting work on a new app, and just thought of trying node. Even after ~2 year of launch- hotwire-android (turbo-android part of hotwire) has 0 videos on youtube. Even though I initially loved hotwire & actionstorage (unlike ActionText which is horrible compared to other rich text editors) - you are alone with no help on the internet. So keeping your framework to a minimal, your development speed will be faster (and I might say performance of app will be faster too due to less framework bloat).Īfter ~10 years of Rails, I was sick of Rails-specific features (ActionText, hotwire, actionstorage) not having enough help on the internet due to a much smaller & declining community. Why not look for a framework like Rails - The knowledge base available on the internet on html, css and javascript is more comprehensive than it is for a Rails latest features rails-6 onwards (or any new framework like Rails). If you want to make an app with a complicated front-end with slick transitions of UI - after this tutorial you can add ReactJS. ![]() Add more routes using your new database to do CRUD - and make their associated EJS templates.You can make a file "seeds.js", write commends for adding data (pg-promise commands) and load data in your database For connecting to the database through the app- you can use pg-promise (minimal learning curve if you understand basic SQL strings) or understand and setup an ORM like sequelize. Or you can setup a AWS RDS or supabase free plan. Add database - Setup a database on heroku with free app, and use its connection string."/hello/:your-name" and pass this to ejs template. Understand parameterised routing - to understand route parameters and passing the same to ejs templates.Add templating engine ejs like erb- app.set("view engine", "ejs"), add a folder called "views" and make a file hello.ejs inside it, and write some html like Hello World.Hello world on console - Use express ( ).Over a period of time - you can learn more nodejs ecosystem specific things. Start with Expressjs (minimal + largest node community) - The steps below will take ~2-4 hours of transition time and will help you know-enough to your preexisting HTML/CSS/backend knowledge and build any fully functional web-app. Hi - I did the same a couple of weeks ago and my main recommendation is to NOT look for a framework like rails If what you want is to start using Node and maintain the velocity you had with Rails, Adonis is a great option. It follows the same MVC structure as Rails, it uses a database ORM called Lucid which is ActiveRecord based, and for almost every problem I've found the framework offered an out-of-the-box first party solution. It is a complete framework inspired by Laravel, which was in turn inspired by Rails, so you'll likely find it a comfortable transition. Eventually I came across AdonisJS, which gets a lot less attention than it deserves. NET where there are more abstraction layers. It ticks that box to an extent, but personally it wasn't what I wanted - it's probably a smoother way to transition from something like. I wanted something that that just let me focus on the actual domain problems I was trying to solve. For me, what I loved about Rails was that I didn't have to spend a heap of time thinking about libraries and glue code, so I found that transition painful. For some people that's what they love about Node. ![]() The hardest part about transitioning from something like Ruby on Rails to Node is that Node has next to no convention.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |