Ask HN: Which web stack should I learn for personal projects?
Context: I've been a mobile native developer my entire career (~6 years, primarily Android in Java) and am finally playing around with JavaScript and the web.
To build a full-stack web product (optimized for productivity and ease of implementation on my end), which tech should I learn?
Things I've looked into but have not committed to: Iris framework built on Go, React for front-end.
Thanks in advance!
50 comments
[ 0.18 ms ] story [ 142 ms ] thread- Node.js is great if you like JS. It couples really well with MongoDB (see MEAN stack).
- Play Framework is quite nice if you want to stick to Java.
Client-side :
- React is...well you tried it.
- Vue.js is great.
I can recommend Yii (PHP MVC framework) which can help you get going quickly. It comes with a code generator and also takes care of things like JavaScript form validation and other front-end related things.
Personally, I like to only use JavaScript frameworks/libraries if they are really required. If you need to do a lot of stuff dynamically on the front-end, you can also look into libraries like Backbone, which give you a nice tool belt but keep things more flexible.
Have fun! :)
https://github.com/johnwheeler/flask-live-starter
It includes tasks to provision a full Debian box with Gunicorn and Postgres, deploy your app, provision a letsencrypt certificate, backup your database, and tail your remote logs.
http://www.florinpatan.ro/2016/10/why-you-should-not-use-iri...
- Backend: Django + Django Rest Framework + Postgres
- Frontend: React + Redux + React Router + webpack + million other small modules [1]. You may also look into Relay (esp. upcoming v2: https://github.com/facebook/relay/issues/1369) and GraphQL, because it may simplify a lot of backend <-> frontend communication.
[0] as in: I am productive using these tools. Partially, because I already know the tooling and best practices.
[1] yes, there's a lot to learn about the tooling, but when you're just starting, you can use some boilerplate or Create React App tool.
Go is also a good choice, but there are better frameworks than Iris. Depending on your needs, there's https://github.com/NYTimes/gizmo and Gin (https://gin-gonic.github.io/gin/).
Full disclaimer: I actually use golang for my personal projects because I'm attracted by its simplicity and how it really doesn't hide stuff from me using hand-wavy magic. Performance is also a factor, but not one I consider when comparing it to node.
If I'm working on something I want to roll out fairly quickly. A prototype. Then I'll probably use node and leverage npm quite a bit. Typically I'll install Express, Sequelize, and Passport. If a front-end framework is necessary then I'll use Ember.
I've used Django a long time ago, and it was nice, but I'm not sure how much its changed since then. I also worked with Ruby on Rails in the past. I think you can be really productive with it if you put in the time to learn it, but I haven't found any great internet resources to really learn it, plus it's a little too hand-wavy for me.
https://www.railstutorial.org
I would argue that the tricky part is session's and middleware. When I first attempted to build a golang web app that required session cookies I got so discouraged that I just swore them off and went with JSON web tokens instead. It also took me a while to wrap my head around the concept of clean middleware.
I would say it was rewarding in the end though, because I learned about some low-level concepts typically abstracted away by the framework I was working with. It's fun to know about these things.
The https stuff is done via Caddy server that automatically serves and updates the cert via LetsEncrypt - requests are then forwarded to the go app.
I would recommend the polar opposite, actually: use a framework that has nothing in common with anything that you already know. After all, half (or more) of the point of personal projects is to learn new things, right?
So one detail that I left off was that I actually also teach programming to complete novices in short time frames. It's kind of like a bootcamp but different in a lot of ways. We teach them node because it fits better with our tight schedule.
But if you're not too terribly rushed then sure, that does sound like a good idea.
Any tips on keeping the codebase legible?
If the developers put the projects together properly, it should have been very legible and easy to jump in on. Ruby isn't exactly a hard language to learn and generally very legible, almost to the point where each function/statement should be close to reading plain English (other than regexp and a few other things). That is, if the developers are following best practices, separation of roles, and not trying to hack together various work arounds because they don't know the language.
Personally, haven't found anything that has led me to be more productive than Rails + (Semantic UI or Bootstrap) + jQuery. Server side rendered templates with some light sprinkling of javascript covers 99% of my needs.
Sometimes, bare Java EE is good enough.
But so far I haven't heard anyone mention the Nim programming language which can compile to JavaScript or C and has what I consider to be superior syntax and excellent performance as well as great metaprogramming capabilities. See http://nim-lang.org
My recent projects have been built on a Node server. I like to use knexjs as an ORM, sometimes including bookshelfjs for model building. Cacheing or rather message queuing has been done with redis. Often, this backend server will feed a much smaller front end web server that leans on react and jsx to spit out HTML.
PS I started out with rails but moved to a primarily node stack last year.
Elixir's documentation is pretty neat and getting started with it is relatively easy.
Phoenix framework is entirely optional, Elixir comes with something called "Plug" which is all you would need to launch simple applications.
[1] http://elixir-lang.org/
[2] http://www.phoenixframework.org/
The other alternative would be doing all UI rendering on the browser, via a single-page JavaScript application. A popular choice for that is the React framework. In this case you could use the Dropwizard framework on the server side (although Spring Boot and Play would also work).
If your goal is to create a small project / product, you'll have plenty to learn already about web applications without the burden of learning a new language and toolchain.
- Don't use Iris because shady-thievery-mischief - Learning is costly: If you have to learn a lot to get into fullstack dev, learning a new language will compound that cost - Just pick whatever and f'n build something - artists build
Backend: 1. Node.js 2. RoR in second 3. Spring Boot/Play 4. Phoenix
Database: 1. Postgres
Frontend: 1. React 2. Backbone
Thanks all for the advice and avoiding the temptation to completely slam me (though it's warranted).
My takeaways are:
1. Don't forget about SSL, and LetsEncrypt provides a free option (will donate eventually) 2. Amazon Lightsail looks promising but be wary of any service that will not automatically cap usage once you've hit your spending threshold (apparently Google CC too, but not Digital Ocean) 3. I know there are .NET developers on here but they're a vocal minority (I work on a Windows/Ubuntu machine so it's within my reach but ¯\_(ツ)_/¯)
Thanks again, all! See you on the webbz.
P.S. I'm working on my first chrome extension (frontend only) and might follow-up asking for advice on that.
Again, if only for personal projects, since you are familiar with JS, I would go for node.js.