Ask HN: Which web stack should I learn for personal projects?

31 points by sisedi ↗ HN
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
Server-side :

- 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.

Thanks! I'll check out Play
I played with Vue just now and it felt right. :)
Welcome to the web :)

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! :)

I like the idea of not remaining trapped in the frontend framework (angular really bothers me for some reason). Others recommend backbone too so I'll check it out.
Check out Flask[0], which is a microframework for Python. Pretty easy to start with plus you will be learning Python down the road. [0] http://flask.pocoo.org/
I'm working on a Flask deployment starter that makes it easy to get a production environment up and running on the likes of Digital Ocean / AWS Lightsail / OVH (i.e. cheap VPS environments). I haven't written documentation for it yet, but the code is up

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.

looks good, thanks for posting
This is what worked [0] for me in the last couple of projects (and the current one):

- 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.

So, if you already know javascript then I would look at node.js.

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.

Thanks for the detailed reply :) I'm a little iffy with Rails myself.
Here's a great Rails learning resource:

https://www.railstutorial.org

If you do buy it, though, read it quick. I picked up a copy a few years back and finally got around to reading it after about 6 months or so... only to find that it already was so out-of-date that I couldn't follow along with any of the examples.
How easy is it to build a full web app with Golang (I'm talking backend + views here)? I have used Go for some small projects where I only built a REST API using Go's default http library but never for something bigger.
Not bad at all honestly. Golang comes with a built-in templating engine that was easy enough to convince me not to look for a better one. Routing is simple, especially if you're using the Gorilla toolkit's mux package. Figuring out how to work with database calls were tricky when I first started out because I was used to Django abstracting that part away from me, but eventually I really got the hang of it.

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.

I've been writing our in house extranet with it, and the built in templating is very easy once you get the hang of it. The context addition makes it very easy to authenticate and pass that through to the endpoints.

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.

> if you already know javascript then I would look at node.js.

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?

Huh, that's actually a pretty valid point.

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.

I just mentioned that in another comment, the fun of learning something new.
Ease of implementation? Just grab any modern Rails and pick a frontend framework later.
I worked with Rails briefly in my previous company and found a working product nearly unmanageable.

Any tips on keeping the codebase legible?

Define legible, or rather, what were your frustrations with your previous company? I have worked with many Rails apps, some at very large scale, and never found them illegible in situations where the developers 1. conformed to best practices, 2. did not try to write Ruby like a C-derivative, and 3. were using rails for CRUD apps vs. trying to wing something mostly made for CRUD into doing something it probably shouldn't have.
As @micaksica has said Rails is generally a pretty good framework and I've build and contributed to several projects myself and most of them I've never had any problems with.

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.

Spring Boot if you want to continue going down the Java path.

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.

I would suggest you use Node. It is nice not to have to switch mental contexts when switching between backend and frontend code.
If you want to stick to Java, look into servlets and JSPs. For databases, almost any will do, but I like Postgres. As for database API, use whichever JPA implementation that comes with the server you're using.

Sometimes, bare Java EE is good enough.

I am a Node.js developer and practically speaking you should probably learn that.

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

+1 for Nim - being able to write both server and client side in the same (excellent) language is very nice.
Node is great if you want to utilize npm modules.

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.

Any stack. Pick one and build something. Ship it. Remember, real artists ship.
Hah, some eternal truth right here.
C# + ASP.NET MVC + Typescript
The first .NET recommendation! I was waiting for this one. :D
You can take a look at Elixir [1] (and Phoenix framework [2]).

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/

Thank you! Phoenix is definitely bouncing around over here and I'd heard about it before this Ask as well.
Since you're fairly experienced with Java I'd stick with that for the back-end. Since you're still learning JavaScript I would recommend doing most UI rendering on the server side, and using JavaScript to add interactivity (e.g. with JQuery). For that approach you could consider Sprint Boot and Play Framework on the server side.

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).

Thank you, I'm definitely going back/forth between sticking with what I'm familiar with and learning something new (because that feels more fun?) hah
I hear you, and that can be refreshing, if your only goal is learning.

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.

That's a good point.
www.learnphoenix.io is a great book on React, Phoenix and Elixir. The book covers many more modern programming concepts and are explained in a clear and coherent way. Not only is Elixir exciting as far as the future of functional programming goes, but the content that breaks down React and all of the pieces consisting of front-end architecture is detailed from the build system to CSS modules. Anyways, just a thought, but it's a nice jumpstart into a new full-stack that's going to gain a lot of traction in the coming years.
== Consolidated advice ==

- 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.

If only for personal projects, I would say PHP. Easy to learn and implement. XAMPP stack would be sufficient enough.

Again, if only for personal projects, since you are familiar with JS, I would go for node.js.