Live data from Hacker News

Ask HN: Go-to web stack today?

news.ycombinator.com

181–190 of 453 posts

Re: Ask HN: Go-to web stack today?

#181
If you go for React, I would highly recommend Mobx for state management. And create-react-app + yarn eject to get started. CRA is a joy to work with.

Mobx is a bit more difficult to grok and debug for newcomers than Redux, but it's really really fast, easy to test and requires little boilerplate.

On the other hand you get reactive state management by default in Vue.

If you use Node for the backend I can recommend using Knex for database queries and migrations while using Postgres.

But if your app will be write heavy, you should consider NoSQL. Neo4j looks very promising in this area and Mongodb also works well.

You will have an easier time migrating data and keeping the data in a known, consistent state with an SQL database. So use that unless your app is write heavy.

I also like using Sqlite for smaller apps. Your database is a single file, you can use knex and switch to Postgres if needed.

As for the backend, I recommend using dependency injection and decouple the http layer from the APIs in all cases where it's possible. It makes things easier to test. Personally I rolled my own library (@adrianhelvik/container) for DI in Node.

Re: Ask HN: Go-to web stack today?

#182

Earlier quoted context omitted.

Ah, it's poor design because you don't understand it? Right.

No, not right. I have work on a daily base with redux unfortunately. Redux is not too hard, but it's poor in design. Also you will have to give up redux soon, the hype is over and better things are at the horizon. There is definitely some pride in dev's working with redux, once they understand it they feel like they've grown as a developer. Do you really think redux is the holy grail of stores? If you're really smart…

You haven't explained why it's "poor in design".

Re: Ask HN: Go-to web stack today?

#183

Scala, ScalaJS, Slinky React. No Javascript to learn and no worrying about ECMA versions or whatever today's new build tool is. Shared code between client and server. Type safe so you can get a proper IDE, refactoring and a lot less bugs. Full reuse of React + Javascript libraries as well as the incomparable JVM ecosystem on the backend. Also probably the fastest and most scalable language you can use and is used at…

Thanks for the Slinky reference, I had not seen it before. I spent some time evaluating Scala.js a few years ago and liked it, but ended up not using it. When I retire from my full time job in a few months I am planning on reworking/rewriting a few of my web apps and I will do an evaluation of Scala.js with Slinky.

Re: Ask HN: Go-to web stack today?

#184
post #177

- On the frontend, use React with TypeScript. Create React App now makes it dead easy. Just do: npx create-react-app myapp --typescript - Do not use redux until you know React well. You might not need it. If you do need it, use `redux-starter-kit` offered by the core Redux team. - For backend, just use Django (or Rails). Elixir's Phoenix is also very well thought out. - If you use node: express, sequelize. Async/awai…

> just use Django (or Rails) What do you mean by "just use"? The OP seems to have a long experience and having had used Rails recently myself as a 20 years experience web developer, all I can say is stay away if you know the way web works and not doing it as a medium team size. You need to learn everything the rails way even if you know every moving parts of what makes a web site which can often get in the way and I…

PostgreSQL is a good default choice because it is rigorously engineered and offers a wide variety of production equality extensions that mold it into whatever you need it to be.

If, halfway through your implementation, it turns out that you need to store GIS data or time series or you need a key-value document store, Postgres can easily do all of that, and you can have everything in one DB (unless it turns out that your requirements are truly special).

Re: Ask HN: Go-to web stack today?

#187

Earlier quoted context omitted.

This is a good approach for many apps, but watch out for the thorny XSS issues you can have when mixing server-side rendering with a client-side framework which supports interpolations e.g {{ some_var }} . Rails/Django etc will correctly sanitize the rendered data for a HTML context, but they don't know that your client-side framework will execute code inside a {{ }} block, so those aren't removed - so if you render…

I use go templating to assemble Vue components. Luckily Go templates can switch from using {{ }} to any other delimiter. I use [[ ]]. It works well. And that means I strip all "{{", "}}", "[[" and "]]" from any user input.

Interesting. Do you happen to have examples of these templates?

Re: Ask HN: Go-to web stack today?

#189
If you didn't provide constraints (node/react), I would use the following. Please note, this is highly opinionated, so nothing to get offended or upset about. I like to keep my stack simple:

A. Simple static sites:

- Jekyll

B. Medium complexity, CRUD applications:

- Phoenix/Elixir - Coffeescript

Note: With the latest version of Phoenix, you absolutely don't any JS frontends at all. Watch they keynote presentation for the liveview demo: https://www.youtube.com/watch?v=Z2DU0qLfPIY

C. Complex Web applications:

- Phoenix/Elixir - GraphQL/Absinthe - VueJs + Vuex + Coffeescript

Developing with Phoenix/Elixir is so much better than any of the node frameworks in the ecosystem - this has consistently been my experience. So, give it a shot if you can.

Re: Ask HN: Go-to web stack today?

#190
golang backend restful api, websocket service, frontend some client side SPA or static pages. database + redis for k/v and queuing, for heavy duty stuff rabbitmq.

the nice thing about golang is that i don't need containers because my runtime package is basically a binary, golang is great about cross compiling for various platforms, too. when i used ruby or python, i'd have to package up all the dependencies and even get the runtime interpreter installed while using some tools like rbenv, etc. really, really annoying.

Post reply on HN