Live data from Hacker News

Ask HN: Hunting for a Framework

news.ycombinator.com

41–50 of 70 posts

Re: Ask HN: Hunting for a Framework

#41
post #38

Remix, zod, tRPC(if/when API endpoints are needed), Typescript, Prisma. This stack is gorgeous. Same language and type definitions front to back is a game changer. The realtime aspect of what you are looking for is the hard part. The only options I know of are the remix stack above (you still have to do some extra plumbing), elixir/Phoenix (or other turbo links like options but most aren't fast enough). To do realtim…

Aside from replacing Remix with Next.js, this is also what I would recommend. Remix makes things that were simple hard (apparently with the goal of doing _everything_ on the server again).

create-t3-app is a great starting point for folks going this path. Has optional checkboxes for db/ORM/migrations (prisma.js), auth/sessions (next-auth.js), tailwind CSS, typed client/server communication (trpc).

https://create.t3.gg/

https://github.com/t3-oss/create-t3-app

I hadn't touched much webdev for a few years, the ecosystem / build tooling has gotten a LOT better. It's back to being fun and painless to spin up a new webapp.

Re: Ask HN: Hunting for a Framework

#42

This is what ChatGPT says about your question: > There are a few full-stack JavaScript frameworks that you may want to consider, such as Meteor and Sails.js. These frameworks can help you to avoid writing boilerplate code and automatically generate REST endpoints for your data models. > Meteor is an open-source framework that includes a number of features to help you build full-stack web applications quickly and easi…

Haha, it's funny that I wasn't the only one who had the same idea. Here's the answer I got:

> One framework that meets your requirements is NestJS. NestJS is a full-stack web development framework for Node.js that is built on top of TypeScript. It provides a central definition of data schemas, automatic generation of REST endpoints, and support for GraphQL. NestJS also includes built-in support for authorization and authentication, and it provides a reactive programming model that simplifies the process of managing data and communication between the client and the server. NestJS is open-source and is designed to be easy to use and extend. It allows you to define your data models on the server and have them automatically synchronized with the client, so that you don't have to write manual HTTP calls or manage websocket connections. NestJS may be a good fit for your needs because it provides many of the features that you are looking for in a full-stack framework.

Re: Ask HN: Hunting for a Framework

#43
I recently created ~25 full-stack example projects using the most recent technologies and frameworks. I believe the following stack is the most productive, yet very scalable (doesn't use "leaky" abstractions).

Frontend:

  - Good, old, Single Page App. I believe that all these SSR/isomorphic rendering frameworks are a lot of times just unnecessary complexity.
  - Vite.js + your preferred framework (Vite supports React/Vue/Svelte, etc).
Backend:

  - Node.js + Typescript.
  - Trpc.io - while it's not "automatic generation of REST endpoints", it's very close. It's very easy to write your endpoints, and the added flexiblity/control is definitely worth the time spent writing them.
  - Trpc also has a built-in support for subscriptions: https://trpc.io/docs/subscriptions
  - Prisma + Postgres. Good, old, proven, flexible SQL database is always a safe bet. And Prisma makes interacting with it an order of magnitude easier.
  - The whole "network layer" is completely and very efficiently handled by Trpc. It also uses React-query under the hood: https://github.com/TanStack/query.
Infrastructure + deployments:

  - I would recommend going for AWS.
  - Frontend (statically built) can be hosted in S3 bucket behind a CDN. You should also properly configure caching headers returned by Cloudfront to make it work with SPA.
  - You can run your TRPC API in AWS Fargate container (behind ALB, or behind HTTP API GW). Alternatively, you can also run it in a lambda function.
  - To make the configuration of your Infrastructure/Packaging/Deployments 97% easier, have a look at
https://stacktape.com

(disclaimer: I'm a founder)

Re: Ask HN: Hunting for a Framework

#45
post #40

RedwoodJS seems to tick the boxes although I'm not super clear on the real-time aspect. I don't see it from scanning the docs. I think RedwoodJS has to be tried given your requirements. Personally, I'd say go with Supabase, and then try SvelteKit or use React/next.js. Supabase handles the data access, mails the real-time, and bakes in auth in the right way. Decoupling the front end lets you choose and adapt the right…

The Supabase CLI does have migrations (merge-diff approach that is wonderful) and codegen for DB types for the front-end to use. We've even dispensed with Prisma recently as the ORM and just use the Supabase Client for data access on the front-end. Whole API layer disappears.

Add in a SvelteKit and deploy to a Vercel and you have a minimal yet powerful stack with everything you need for 90% of business CRUD app demands.

Re: Ask HN: Hunting for a Framework

#47
post #11

After looking for enough time, it may be worth it to make some compromises, pick one and try building your application with it. You may never find “the” framework. Lately my default has been AspNet Core and C# (or F# if I’m feeling frisky). Not because it’s the ultimate framework for me (although it _is_ very good), but it’s what I learned, thanks to learning on the job. I remain a microsoft skeptic though. I continu…

I am in a similar situation. I have written most backends in AspNet Core, mostly because C# is usually my go-to language. I have looked into Blazor a bit. There are some aspects it does well and writing frontend in C# is very appealing to me, however, the way of datafetching is not the most elegant, as far as I have seen and can judge.

I’ve been using razor pages. For me it takes the abstractions I enjoyed with aspnet MVC, with less of the boilerplate- controllers, etc

Re: Ask HN: Hunting for a Framework

#48
post #4

I would recommend Django, but it's really only the backend half of what you're looking for. What you're describing sounds very nice though. I've often wanted a VB6 equivalent for the web, but open source.

pretty sure anvil is open-source now.

https://anvil.works/

open source.

https://anvil.works/open-source

i should be a paid for how much i recommend looking at them, but i've never used it for anything production.

Re: Ask HN: Hunting for a Framework

#49
I love reading the comments. There are no simple answers.

I was and still am in a similar situation. Since performance, ease of use and resource consumption are important my backend language of choice is Go.

So I wrote a simple backend generator with RESTful CRUD endpoints. The workflow is, you define the data models in your models package. The generator then analyzes those models, creates all the routes and repositories and handlers, then creates Angular model definitions (interfaces) and finally vuex-orm model definitions.

It's very simple and primitive. If you want to change anything you have to regenerate. So this gives you a skeleton backend app. No auth. But that's the general idea. It uses mongodb as a database target. And most importantly it supports data updates via websocket. I initially worked with Angular on the frontend but have been using Vue for the last 2 years. Angular sadly only has ngrx-data which is incomplete. Relationships are not supported and have to be done manually. So I found vuex-orm, which is far from perfect, but works well and is productive, supports relationships. However vuex has been deprecated in favor of Pinia. Someone did a Pinia version of vuex-orm-next, but I haven't tried it yet.

So that's all I have.

I've been thinking to rewrite it. I wanted a simple tool, that doesn't get in my way. I've been thinking to have a clumsy model definition way like entgo.io . And the more I worked with it, the more I see that their way is a better way. Have elaborate model definitions and relationship definitions. I was thinking about that for a while and ent made it. But ent is far from perfect too. It doesn't generate client models, it's complicated, the documentation is lacking. The developers assume you're smart. I'm not smart when I have to crawl through someone else's code. They're going a certain route, and both their graphql and grpc implementations are lacking. I tried to write an extension but the learning curve was too steep. And now they have migrations with some external library, am I'm just sitting there thinking, why do you assume your libraries are a part of my world. The whole thing is a mix of marketing and hype development. They have their own company now and of course they want to make money. I prefer something less hype driven. Something where when you criticize you don't self censor in order to not hurt their reputation. And I hate that.

So I'm thinking make such library myself but how can I monetize? Who would pay me to create a useful tool to solve this 20+ year old problem? This a serious question.

I could open source my tool so far. But I didn't because it could be used by competitors to provide what I provide. Currently my income is so low that I'm actually seeking either employment or freelance work, which I haven't done in at least 8 years.

An alternative would be Spring Boot 3. Learn Java. But could I handle the Java bs on a regular basis? Sometimes when I hate Go, I experiment doing that same backend with Spring Boot. I do the JPA definitions, do the security setup and then I just say fuck it because deep diving requires more Java knowledge and the community is very unfriendly and walled-off.

I'll continue reading the other comments now.

Re: Ask HN: Hunting for a Framework

#50
post #38

Earlier quoted context omitted.

Aside from replacing Remix with Next.js, this is also what I would recommend. Remix makes things that were simple hard (apparently with the goal of doing _everything_ on the server again).

create-t3-app is a great starting point for folks going this path. Has optional checkboxes for db/ORM/migrations (prisma.js), auth/sessions (next-auth.js), tailwind CSS, typed client/server communication (trpc). https://create.t3.gg/ https://github.com/t3-oss/create-t3-app I hadn't touched much webdev for a few years, the ecosystem / build tooling has gotten a LOT better. It's back to being fun and painless to spin u…

A few hours ago, I tried to setup trpc using recommended boilerplate, I also tried fresh default T3 after that.

Both got error, which seems to be due to next/next auth dependency breaking. So it's not that painless I guess.. I found this situation quite often with nextjs example template

T3 author is very responsive though, so my issue resolved quickly

Post reply on HN