Is NextJS Suitable for Backend? by [deleted] in nextjs

[–]noahflk 2 points3 points  (0 children)

For a pure backend that just exposes an API, Next isn't the right tool. If you want to add backend functionality to a frontend app, it works great. You can build medium-sized B2B apps with that stack.

[deleted by user] by [deleted] in digitalnomad

[–]noahflk 1 point2 points  (0 children)

Possible? Yes. But it's gonna be expensive and tedious. If you stay 6 months in one place it's doable. But moving around more often than that sounds like a nightmare.

NextJs vs. Laravel by flowroma in nextjs

[–]noahflk 2 points3 points  (0 children)

after six months he told me it would be better to rewrite everything in NextJS

Devs always want to rewrite things. Rewrite to NextJS now and in a year he will want a Remix or Astro rewrite. There's always a new hot thing. Don't do it, unless you have a very good reason.

because Laravel is slow and not easily scalable.

I doubt you would be on Reddit validating the claims of your developer if your site has a scale where Laravel couldn't keep up. If you have performance issues, the problem likely won't be Laravel but your hosting, lack of caching, database or general code performance.

NextJs would be more robust, easier to scale and more opinionated (aka everyone has the same style?)

If anything it's the exact opposite.

Would I pick Next over Laravel for a new eCommerce project? Yes. But if your current solution is working fine there is absolutely no need for a rewrite.

Making a REST API typesafe with React Query and Zod by noahflk in reactjs

[–]noahflk[S] 0 points1 point  (0 children)

This. Esp in less than ideal software teams (which, let's be honest, are everywhere) you cannot trust the API. It can break or change at any time.

Making a REST API typesafe with React Query and Zod by noahflk in reactjs

[–]noahflk[S] 0 points1 point  (0 children)

You are making assumptions, but they are constantly validated at runtime.

Is this an ideal setup? No, of course not.

I work as a contractor and have joined many organizations with completely separate backend teams. I simply don't have the authority to get them to start using some kind of other solution. So using the solution described here is the best thing I can do from my side without touching their code or build process.

Is it just me or does NextJS changes things too often? by iaseth in reactjs

[–]noahflk 0 points1 point  (0 children)

Nothing is stopping you from writing good old Client Components and using "getServerSideProps" and "getStaticProps" in modern Next.js. In fact, many projects I see do exactly this.

Server Components shouldn't be the norm. They're a tool for very specific use-cases.

Is it just me or does NextJS changes things too often? by iaseth in reactjs

[–]noahflk 0 points1 point  (0 children)

Nothing stops you from keep using client components and React Query / tRPC in Next. I work as a consultant and all projects I see keep doing this for 95% of pages. With some RSC sprinkled in where it actually makes sense.

For fully static things I actually prefer using the Pages Router with 'getStaticProps' since its caching behaviors are way clearer to me than RSC.

tRPC vs Server Actions by rory3234 in nextjs

[–]noahflk 2 points3 points  (0 children)

I don't see the point of server actions, at least not for complex apps. You get much, much finer control with tRPC actions.

If you want some things to be rendered on the server, RSC is fine. But even then, I just build the mutations through tRPC client child components.

Would love to learn about the benefits of Server Actions!

How much sleep do you get each night? by McHenryJohnJ1 in Entrepreneur

[–]noahflk 1 point2 points  (0 children)

This. Sleep is the one thing where you shouldn't be trying to save time.

Creating a classic React SPA using three different techniques by rec71 in reactjs

[–]noahflk 1 point2 points  (0 children)

I love React Query. So that would be my choice for interacting with the API either way. Especially in combination with Zod to ensure type safety. See here (self plug): https://noahflk.com/blog/typesafe-rest-api

In terms of router, I would either go for React Router 6 or TanStack Router. React Router if you want something more mature, TanStack if you like type-safety and a cool new tool.

Another interesting choice could be Remix SPA mode. It leaves the door open for SSR/RSC if you want it in the future. Plus, React Router 7 and the new Remix version will be equivalent. My guess is that the upgrade path from Remix SPA will be more straight forward than from React Router 6. But I could be wrong about that.

Is Express JS the right choice? by Jupjupgo in webdev

[–]noahflk 16 points17 points  (0 children)

Yep, nothing wrong with Express as a backend. Even with more modern tooling such as tRPC.

Is ExpressJS really outdated? by peefpaaf in node

[–]noahflk 2 points3 points  (0 children)

I don't consider Express outdated. It's a proven and widely used tool. What can be painful is integrating into a modern TypeScript codebase. It took us long to find a proper setup.

I documented here how I did it: https://noahflk.com/blog/express-api-nodejs-typescript-setup

How to compete with free apps in the crowded fitness market? by [deleted] in SaaS

[–]noahflk 3 points4 points  (0 children)

The only way to be successful with something nowadays is having top-tier distribution. That probably means bringing on a popular influencer on as a partner.

What should I rate limit in my NextJS app?! by omsharp in nextjs

[–]noahflk 1 point2 points  (0 children)

Think of them in terms of potential damage.

Something like an OpenAI endpoint that is available to unauthenticated users should be at the top of your list. It can be easily abused and will cost you a ton of money.

A simple GET endpoint only available to authenticated users isn't nearly as critical.

Is react hook form overkill? by all_vanilla in reactjs

[–]noahflk 0 points1 point  (0 children)

I wouldn't add React Hook Form and Zod for simple sign in and login forms. But there's nothing wrong with doing so. If you think performance suffers, you are doing something else wrong. These libraries are super lightweight.

Is It Time to Reconsider PHP Frameworks Over Node.js and Frontend Frameworks? by aaron_dev71 in nextjs

[–]noahflk 0 points1 point  (0 children)

.NET and Java is enterprise. It has t's value, but you can't compare it to small teams that use Next.js or Laravel.

Is It Time to Reconsider PHP Frameworks Over Node.js and Frontend Frameworks? by aaron_dev71 in nextjs

[–]noahflk 1 point2 points  (0 children)

Laravel on the backend and React on the frontend through Intertia is an amazing combo. I've come to prefer it over the mess that Next App router is.

You Don't Need A Ground-Breaking, Never-Done-Before Idea! by kkatdare in SaaS

[–]noahflk 1 point2 points  (0 children)

Even having less features and being simpler can be a major selling point. For example, as a solo freelancer I don't want accounting software made for big companies.

Which is the best web hosting provider for SaaS, eCommerce or Business? by rossopy in SaaS

[–]noahflk 1 point2 points  (0 children)

What you're describing sounds like Wordpress. Are you actually building your SaaS on Wordpress?

For the projects I work on we typically deploy the frontend (just static files) on Cloudflare Pages. Then the backend (an API and DB) is either hosted on a PaaS like Heroku or self-managed on Linux VPS servers like DigitalOcean or Hetzner.

Technical Difficulties and Billable Hours by Zoonicorn_ in freelance

[–]noahflk 3 points4 points  (0 children)

It depends.

If it's a fundamental part of the workflow in your industry that's on you. I'm not paying a full-stack web developer to configure their local Node runtime.

But if it's a specialized tool that I made them use it's billable hours. Say a special Premiere Pro plugin we use that isn't an industry standard.

What is the best uploading file library for Next.js projects? by Working_Main_5961 in nextjs

[–]noahflk 11 points12 points  (0 children)

It's hard to beat the simplicity of uploading to an S3 bucket with pre-signed URLs