top | item 29626371

Ask HN: What tech stack would you use to build a new web app today?

48 points| gt565k | 4 years ago

In the past I've used Rails, Django, and other web frameworks with angular and some react or jquery for the front end, and either postgres, mysql or sql server for the database.

If you were to build a new web app product with a fairly complex database schema and functionality, what tech stack would you use as a starter? Obviously things depend a bit on the use case, but let's assume it's a web application that doesn't need high concurrency.

More like building a PoC of a web app start-up that can scale for a few years.

73 comments

order
[+] BozeWolf|4 years ago|reply
I would pick what I know best and get the product out with that. Or better: I would pick the most popular framework I know best.

Most known and good frameworks can do what you want. If the product becomes succesfull, scaling up your team with good engineers is harder than scaling the product.

As long as you can do raw queries on your complex database, I do not see how a backend framework you don’t know yet will help you. You will sell the product, not the framework it is running on. If your current stack is still widely used in the industry, focus on the product, not on new tech

Small addition: if it is for hobby or learning: pick one new framework and keep the rest of the stack.

[+] aantix|4 years ago|reply
Rails 7 with Turbo and Tailwnd. Use the Jumpstart Pro template.

https://jumpstartrails.com/

Host on Heroku.

The boilerplate features are covered. Productive developer patterns are already in place. Great test coverage.

You can jump right in to building out the business logic.

[+] fabian2k|4 years ago|reply
The one you have the most experience with.

Unless you have specific requirements where that stack isn't a good fit, or other reasons not to choose it like it's too niche to hire people for.

Or if you're doing this for fun, use the most exciting one that still looks like it's at least somewhat stable and won't cause you too much trouble.

[+] fishtoaster|4 years ago|reply
Really, whatever you know. But since that's a boring answer, so I'll assume you know exactly what I know. Anyway, as usual, "it depends," but there's probably a big split based on a specific question:

"How rich is your frontend?" (and how rich will it need to get in the next few years)?

If the answer is "rich enough" - ie you want a fair deal of dynamic content and a web-app feel, I'd do:

- ReactJS via create-react-app with typescript and ReactQuery for talking to the API

- Rails in api mode serving a rest api

- Postgres for the db and Redis for caching/job storage.

- Heroku

If the answer is "not that rich," save yourself some complexity:

- Normal Rails with server-rendered pages

- Postgres/redis

- Heroku

Note: swap out Rails with whatever similar thing is in a language you know: Django, Phoenix, Laravel, etc.

Now, all that said, I strongly suspect the dominant answer to this question is shifting. There seems to be a new wave of JS-based tools like Next.JS and RedwoodJS that seem batteries-included-enough to replace Rails as the getting-off-the-ground-quickly framework of choice. We'll see, though- it's still early.

[+] gengstrand|4 years ago|reply
I have been exposed to many different tech stacks over the years. This https://github.com/gengstrand/clojure-news-feed repo contains the code used to evaluate thirteen different stacks which is what I can share publicly. What I can say is that the best choice of tech stack depends on what is being called for. Is this for an early stage startup or an intrepreneurial greenfield project? Is this for an MVP or just the next component in an already formalized microservice architecture? What are the skillsets of the developers that you will have access to? Have you reached agreement that you can throw it all away and start over or are you expected to have to live with the choice of tech stack for the life of the product? Are you mobile first? These are all important questions that very much shape the decision.
[+] isaacdl|4 years ago|reply
I'd start with a .NET 6 MVC application. The default templates will get you started with robust routing and authentication, and you can back it with anything you want for database access. You might find it valuable to start with Entity Framework (EF) - depending on whether or not you want/like to use an ORM. That would provide pretty robust tools for managing database migrations, etc.

It's "boring" but C# is an extremely developer-friendly language these days, and it's hard to beat the availability of documentation, examples, and libraries.

EDIT: and on the front-end, the MVC templates that Microsoft provides start with Bootstrap. I've found Bootstrap and some native Javascript provides more than enough flexibility for quite a while. Bootstrap is great for an MVP, and has a lot of flexibility to make it look good!

[+] tester756|4 years ago|reply
MVC 6? not Core?
[+] incognos|4 years ago|reply
downside: you have to run on windows
[+] mrdoops|4 years ago|reply
Phoenix + Liveview + TailwindCSS + Postgres

Unless a static site or buy option fits right, otherwise it doesn't get any better than a Liveview based app for continued productivity.

[+] simion314|4 years ago|reply
I suggest you add more details, like advantages and disadvantages, and tell us how many years of experience you have working with projects in this technology/frameworks.

I am curious about something that works on node buy is as boring but robust as a LAMP stack, I just hate maintaining shit where stuff is already deprecated after just a few years, but upgrading is not an option because there are 100 dependencies and we are in the hell where 10 packages are vulerable but can't be updated, 10 are abandoned and I need to research replacements and somehow make time to transplant them...

My question is this, Ruby has Rails, PHP has Laravel or Sympony, Python has Django , what is the equivalent for node backends (something that is old,stable and not a mix of 100 packages from 100 random dudes)?

[+] RedBeetDeadpool|4 years ago|reply
Any thoughts on using React or another frontend framework with liveview?
[+] kisamoto|4 years ago|reply
Personally, Django.

I know it so I can develop relatively quickly with it plus it has so much built in already.

It's also a mature framework so chances of running into bugs for normal tasks is lower than newer/cutting edge and if I do need help there are high chances that someone else has already dealt with it.

Deployment and scaling can also be taken care of by something like Heroku which already supports Django so I can best use my time focusing on the development of valuable business logic rather than reinventing the wheel and maintenance.

[+] onemiketwelve|4 years ago|reply
I would also recommend just going for something boring and fast (for you the developer).

It's a poc, the only thing that matters is getting it out the door. In fact code might not even be necessary for a poc.

If this were me, I would dig up my last abandoned monolith with all the boring details like routing, migrations, seeding, auth all figured out, rip out the old code and start from there.

[+] dnautics|4 years ago|reply
> that can scale for a few years

I don't think "boring and fast" is the only consideration you should take. You should also consider: "are you going to be able to read your code without wanting to tableflip after a year?"

[+] jaybrendansmith|4 years ago|reply
This is the best answer. Don't just build what you know, use something you've already built (if you have it.) Maybe upgrade to the latest, first. And also: If you are trying to create a new business, go as boring as possible. Do you want to experiment with technology, or with business logic? Decide this up-front and if its business logic, go with boring, stable, mature, steady, proven. You can always create experimental services once the boring monolith business takes off.
[+] aloisdg|4 years ago|reply
All my poc are in vanillajs. Quick and dirty.
[+] nikivi|4 years ago|reply
NextJS, Prisma, Postgres via Supabase as data store + Postgraphile connected (for GraphQL).

Some Go/Deno microservices deployed via GCP Cloud Run where needed.

On NextJS side, use React Query (https://react-query.tanstack.com) to call GraphQL & cache where needed. For CSS, use Tailwind & some nice primitive components from Radix UI (https://www.radix-ui.com/docs/primitives/overview/introducti...). Deployed on Vercel.

Tech choices are mostly motivated by how good tooling for it is in VSCode.

I'd maybe switch React Query with Relay (https://relay.dev) but Relay seems more complex.

[+] omneity|4 years ago|reply
I wouldn’t go very fancy unless I have specific requirements or challenges. Starting point:

- Backend: Express + Sequelize + Postgres

- Frontend: Svelte + TailwindCSS + Webpack

Do I need to iterate very quickly on the database schema? Use a document DB like MongoDB (JSONB on PG is great but has caveats such as atomicity)

Do I need to handle a high volume of background jobs? throw Redis into the mix.

Do I want HA? Make the app stateless (JWTs help in this case but come with their own caveats), duplicate the server 2 more times and put a cloud load balancer in front of all 3 servers.

Do I need to serve low bandwidth or low power devices? I go vanilla JS and limit how much interactions does the page have, or move to server-side rendering only altogether.

And the list goes on. But with no specific constraint, my personal preference goes to that initial stack (and I’m very productive in it).

[+] Ensorceled|4 years ago|reply
What is your favourite stack? Django and Rails are both accelerators.

Personally, I'd go with Django and React with PostgreSQL and probably Bootstrap, because that's what I know. I would be running on my domain on day 1.

What frameworks would have you and your team up and running on day 1? Pick those.

[+] incognos|4 years ago|reply
With Django you also get the free admin tool which is an add-on in most frameworks.
[+] p2t2p|4 years ago|reply
Two choices:

- Node with no fancy stuff like TypeScript, just JavaScript, jest for tests, React on frontend, require 100% test coverage (or less test coverage but use TypeScript).

- Java with Sptrig Boot and their reactive web framework and React on frontend.

Reasons:

- Either of those provides _fast_ feedback loop. Node.js is even faster.

- Either of those have got _huge_ ecosystem and a library for anything.

- Either of those is supported by major cloud vendors and first-class citizens.

- The amount of googleable information on the web if you need some docs or help is enormous.

- The amount of devs to hire is huge.

- IDE support for both is excellent.

- There are official base docker images for either, there are version management tools for either that are very easy to use (mvnvm, sdkman, nvm).

- If your webapp grows you have _a lot_ of scaling opportunities.

KISS database side and use Postgres. Try to make someone else to manage it for you, something like Aurora from AWS or whatever there’s out there. If you _really_ sure that your database model is solid and won’t change and/or you’ve got lots of money to through at problems you may want to consider something managed NoSQL like DynamoDB or what was that, Cosmos from MS?

Host on something like Heroku but be aware that they lack a lot of Enterprise required compliances, we recently moved away from it because of that (we have to be compliant).

[+] mikece|4 years ago|reply
I would use something boring[1] since the virtues and vices are well known, documentation, libraries, and code samples will be plentiful, and I would not need to waste a ton of time getting a team up to speed on something cutting edge or finding and fixing edge cases that had not been ironed out yet.

[1] https://mcfunley.com/choose-boring-technology

[+] spamizbad|4 years ago|reply
I would go with where my strengths are currently.

Python + FastAPI + SQLAlchemy + Postgres. With React on the FE. Maybe try a CSS framework that plays nice.

However, I am a Python developer with some JS experience. If I was, say, a Java developer by day I'd probably pick Java and a corresponding framework.

Go to war with the army (of knowledge) you have.

[+] csw-001|4 years ago|reply
I’d write it in assembly and output it to punch cards organized in standard 5ft tall filing cabinets. /s
[+] kiru_io|4 years ago|reply
Don't get stuck on technical details. It is a mental blocker and hinders from actually solving the problem.

I used to think about the best stack and how easy it is to maintain in the future, but never managed to finish any side projects.

For my last project Flashdictation.com I used such an unconventional stack for me: Next.js and Supabase. It just solves my problem. Exposing the database would have been such an huge mental blocker, but with the proper safety it just works.

Sidenote: I am just trying out the above stack, just pick one with which you are comfortable and think about what you want to solve.