Live data from Hacker News

Ask HN: Go-to web stack today?

news.ycombinator.com

31–40 of 453 posts

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

#31

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

A lot of people say that you'll know when you need it about flux implementations (redux, mobx, vuex, etc). I have a react native project that I resisted using flux (in my case, mobx) as long as possible to try this theory out. The situation I ran into that instantly told me I needed global state management was when I had an index screen for list of resources, and a edit screen for a single resource. I knew I needed g…

You can avoid flux longer by simply making a component which stores that shared state, passes it down via props to children, and along with some callback functions to update that state. It is almost exactly what is needed most times and it prevents a problem we’ve dug our selves into before which is making everything via the store because we didn’t want to pass so many props.

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

#33

Earlier quoted context omitted.

Seconded on Django. It's excellent, especially if you get it out of the box with cookiecutter-django and DRF ( rest framework ) Plus, with things like Zappa it's easy to go entirely serverless Django + NewRelic for APM is plain magic EDIT: Oh, and Celery if your use case needs it. Brillant

how is django "running" on lambda these days? -- been meaning to check that out

I'd say that Django is not a great fit for lambda. Lambda works best when you architect you code around it, with lots of tiny methods. Django does not encourage this way of coding (just like the other frameworks).

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

#34
post #31

Earlier quoted context omitted.

A lot of people say that you'll know when you need it about flux implementations (redux, mobx, vuex, etc). I have a react native project that I resisted using flux (in my case, mobx) as long as possible to try this theory out. The situation I ran into that instantly told me I needed global state management was when I had an index screen for list of resources, and a edit screen for a single resource. I knew I needed g…

You can avoid flux longer by simply making a component which stores that shared state, passes it down via props to children, and along with some callback functions to update that state. It is almost exactly what is needed most times and it prevents a problem we’ve dug our selves into before which is making everything via the store because we didn’t want to pass so many props.

Even better: https://reactjs.org/docs/context.html

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

#36
- Python, PHP, GO, depending on what I need to do. No frameworks.

- Vanilla JavaScript and CSS. No frameworks.

- Relational db and Redis

- NGINX and Ubuntu. NGINX for caching.

- AWS or DigitalOcean depending on what I need to do. I strongly prefer working with DO whenever I can now vs eg AWS or Azure. I've had a good experience with Linode and Vultr in the past, however DO's ever-improving offerings keeps putting distance between them.

I've built up my own frameworks for authentication, APIs, etc. over many years that I evolve regularly. Over the last ~15 years I've strictly only been building my own things, so I don't have to consider other organizations or teams and what they want or their pre-existing approaches. My approach only makes sense because of that.

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

#38
post #16

Earlier quoted context omitted.

Yes very good answer. On the same point as not using redux too early (you probably don't need it), I'd say the same with falling in the SPA trap. Most modern apps are now de-facto built as SPAs, mostly for wrong reasons. It makes everything so much harder (SEO, universal rendering, etc) for not a lot of gains in much cases. Don't be afraid of using your backend (Rails, etc) to render separate pages for each, and have…

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…

> but they don't know that your client-side framework will execute code inside a {{ }} block

Isn't that why they added a verbatim tag?

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

#40
JS has its uses. Once in a while I see a site which actually needs it and makes proper use of it. Much rarer, I have to develop such a site myself. But generally, I hark back to ancient times when websites meant html and css. When I do need a dose of JS, I usually go with something raw, or the unfashinable jQuery. I abhor the thought of JS in the backend.

Html and css always via Pug and Sass.

Out back, I really, really like minimalism, usually in the form of a single executable made with Nim. Static link whenever possible, so I can just bang the thing unto anything linuxish. For a reasonably low-volume site (meaning 99.9% of all sites), I go with SQLite for data. Yes, there'll be shouts of outrage that I shouldn't do it. These I know I can safely ignore, but keep my code clean and simple and easily portable to Postgresql if the should occasionally arise.

Sometimes I need easy access to every library function ever written, so I'll drop the purity and go Python. Bottle or Cherrypy is what like to build on, then.

No matter what, these days run the whole thing behind a Caddy server and be done with any headaches over configs and https.

I realise, of course, that I am completely out of whack with current general consensus. So be it. My stuff works, and works fast, and I can cram amazing amount of it into a fairly low-end VPS.

Post reply on HN