r/nextjs • • 4d ago

Weekly Showoff Weekly Showoff Thread! Share what you've created with Next.js or for the community in this thread only!

4 Upvotes

Whether you've completed a small side project, launched a major application or built something else for the community. Share it here with us.


r/nextjs • • 10h ago

Are most devs sticking with Next.JS?

23 Upvotes

Hi everyone,

I’ve recently started learning TanStack Start, and it’s great, don’t get me wrong. However, there’s quite a bit of assembly involved. Next.js, on the other hand, seems pretty great to work with due to the many out-of-the-box features it provides.

How’s the mental model of working it with? According to the Stack overflow dev survey, this is one of top complaints.

How has your experience been with Next.js? What are some things you like or dislike about using it?

I’m retired so I mainly still code by hand mostly.


r/nextjs • • 7m ago

Next.js 16 moved caching to opt-in. What changed in your apps after upgrading?

1 Upvotes

Next.js 16 changes how caching works in the App Router. According to the docs, Cache Components are enabled with the cacheComponents flag, and caching is opt-in through the use cache directive. The existing fetch and unstable_cache caching still works as a separate layer while you migrate. The version 16 upgrade guide also says that dynamic, revalidate, and fetchCache route segment exports will error once Cache Components is enabled.

The part I find most worrying is the silent load change. Code that was fast because of implicit caching can start hitting the database on every request, and nothing in the code looks different. Tests can pass while query volume climbs.

For people who have already upgraded, I'd like to hear:

  1. Did you turn on Cache Components all at once or route by route, and what made you choose that approach?
  2. How did you catch query-count or latency regressions before production? Logging, load tests, or something else?
  3. Which cacheLife profiles and tags have worked well, and which ones did you change later?
  4. Did anything break in a way the upgrade guide didn't cover?

r/nextjs • • 5h ago

Wrote a guide for deploying a MERN app on a Hostinger VPS (Nginx, PM2, SSL) after fixing a bunch of real mistakes in my own setup

Thumbnail
medium.com
1 Upvotes

I spent a while fighting through a Hostinger VPS deployment for a MERN app: firewall rule ordering, Nginx config mix-ups, the classic "my frontend env changes aren't doing anything" issue. Wrote up everything I ran into along with the actual fixes, covering a brand new deploy, pushing new code to an app that's already live, Nginx as a reverse proxy, free SSL with Certbot, and Redis if you need it.

Sharing it in case it saves someone else the same debugging loop: https://medium.com/@kmahesh18001/how-to-deploy-a-mern-app-on-a-hostinger-vps-nginx-pm2-ssl-8180f7f2f019

Happy to answer questions if something's unclear, or if you hit a different issue on your own setup.


r/nextjs • • 1d ago

Is anyone else feeling like "keeping Next.js patched" has become its own job?

44 Upvotes

Not complaining about the Next.js team, I know they're doing a lot. But I feel like I'm upgrading every other day lately because of some security fix or another, and it's starting to eat into actual dev time.

Is this just how it is now, or have I been unlucky? How do you guys keep up without it taking over your week?

Should we just blame LLM and move on?


r/nextjs • • 23h ago

Moving a site to Next.js: what each redirect option sends (307 vs 308) and how Google reads it

5 Upvotes

If you're moving an existing site to next.js, the redirect layer decides whether google carries the old urls over. the status codes aren't the ones most seo checklists talk about, so here's what each option sends

  • redirect() in a server component or route handler: 307
  • permanentRedirect(): 308
  • redirects in next.config with permanent: true: 308, with permanent: false: 307
  • NextResponse.redirect in proxy: whatever status you pass

How google reads them: its redirect docs list 301 and 308 together as permanent, both signal that the target should become the canonical url. 302, 303 and 307 are temporary, and google is told to keep showing the source url

The trap in a migration is the first line. a moved page handled with redirect() works for every visitor and looks fine in a browser, but it's a 307, so for google the old url is still the one to show

Scale: the next.js docs note that vercel caps next.config redirects at 1,024. past that they suggest a redirect map in a key-value store read from proxy, with a bloom filter in front so you don't do a lookup on every request. vercel also has bulk redirects (csv or json files) meant for large migrations

for those who've moved a few thousand urls: bulk redirects or the proxy + bloom filter route, and why?


r/nextjs • • 2d ago

_next/image 504 gateway timeout when deploying to production nginx server

3 Upvotes

context: upgrading to nextjs 16.4.6, i need to add {unoptimized: true} in next.config.images inside images object. anyone come across this matter?


r/nextjs • • 2d ago

Are your non-technical clients suddenly asking for GitHub access because they want to code with AI?

44 Upvotes

I've had several clients this month asking for access to their GitHub repositories because they want to make changes and do development themselves.

I build with Next.js and Sanity, and these are people with little to no coding experience.
I've never really experienced this before, but suddenly it seems like clients believe AI can help them take over development.

I'm not against it, but even getting them set up with the repo, local environment and everything else takes time.

How are you guys handling this? Do you charge for onboarding and setup, give them access, or simply let them figure it out themselves?


r/nextjs • • 2d ago

I built an ad exchange where indie devs trade ad space instead of buying it

1 Upvotes

r/nextjs • • 3d ago

Question about the Workers free plan

Thumbnail
reddit.com
3 Upvotes

r/nextjs • • 4d ago

Domain driven design

3 Upvotes

Hi all!

I'm building an app with next.js and payload.

This application is growing and I would go for DDD.

Any suggestions on project structure?

I'm eager to read any wise advice.


r/nextjs • • 5d ago

Tomorrow is Black Friday and I don't trust our ISR pages. What are you checking on a headless store this week?

5 Upvotes

my stack is next.js app router on vercel, storefront api for products and cart.

last year our sale prices went live at midnight but the PDPs were static, so for like 40 min the page showed $89 and the cart showed $59. some people were happy about it lol but most thought the site was broken and leave

this year I moved to on demand revalidation, revalidateTag off the products/update webhook. it worked fine in testing but testing isn't midnight on black friday. if one of those webhooks is late or just never shows up that page stays wrong until something else touches it

I do have a dotcom monitor check running add to cart and checkout every 5 min but it's one test product and it doesn't look at the price on the page, so it wouldn't have caught last year's problem either

plan right now is to setup a script that starts at 12:05 and runs every 10 min. it pulls the 15ish sale PDPs, compares the html price to the storefront api and if they don't match it calls revalidateTag and slacks me. is that overkill? the only other option i can think of is purging everything at midnight and taking the cold starts, which during the busiest hour of the year seems worse

what else should I be looking at? feels like I'm missing something obvious


r/nextjs • • 5d ago

Contentful

2 Upvotes

Are there any good resources to use for learning contentful.


r/nextjs • • 6d ago

How do you decide between SSR, SSG, ISR and CSR in real-world Next.js projects?

Post image
10 Upvotes

I've been exploring different rendering strategies in Next.js, and one thing I've noticed is that choosing the right approach depends heavily on the type of application.

For example:

  • SSG seems ideal for blogs and documentation.
  • SSR makes sense for personalized and frequently changing content.
  • ISR is useful for content-heavy websites where rebuilding everything isn't practical.
  • CSR works well for interactive dashboards and application interfaces.

But in real-world applications, these approaches can overlap.

I'm curious about how other developers approach this.

  1. Do you usually combine multiple rendering strategies in one application?
  2. How do you decide when a page should use server-side data fetching?
  3. Have you experienced performance issues from choosing the wrong rendering strategy?

Interested in hearing practical experiences rather than just theoretical comparisons.


r/nextjs • • 6d ago

How do you decide when a query deserves its own endpoint?

35 Upvotes

In a Next.js app with Supabase I can fetch data in a Server Component, use a Server Action for a mutation or introduce a Route Handler when I need an endpoint. I keep changing my mind about the boundaries. What rule has held up for you as an app grows?


r/nextjs • • 6d ago

Our cart badge went 1, 2, 1 on one tap: TanStack Query keeps a mutation pending through onSuccess

0 Upvotes

We've been reworking the cart of a client's Next.js 16 food-ordering storefront, as design concepts on a staging branch. None of it is in production. Before the rework the add button waited for the server. With Slow 4G emulation that basket POST took 580-1220 ms, though the API itself answers an add in 10-18 ms. After the first add the page then fetched the whole basket again.

On the branch every basket write is a TanStack Query mutation. They all share one mutation scope, so they run one after another and an older answer can't land on top of a newer one. Each answer goes into the cache with setQueryData before the basket id cookie changes, and with a 10-second staleTime the query on the new key takes that basket as fresh. No second GET.

The cart badge adds pieces sent and not yet answered, which it reads with useMutationState filtered to status: "pending". Added lines and every total still come from the server's answer. Piece counts are optimistic; money never is.

The add buttons now react in their onSubmit, as soon as the request goes out. In one variant that took the visible response to a tap from 587-626 ms to 5-28 ms. That was a dev build on localhost, as is the trace below. We haven't measured a production build.

Then we put a DOM MutationObserver on the badge and did a first add to an empty cart on Slow 4G:

""  -> "1"   at 36 ms
"1" -> "2"   at 834 ms
"2" -> "1"   at 865 ms

By 834 ms the answer was in the cache and the new line was counted. The add was still pending, though. TanStack keeps a mutation pending until its onSuccess and onSettled have run, so for those 31 ms the same piece was counted twice: once in the cached lines, once as a pending add.

The fix is a marker per add, kept in the mutation context:

onMutate: () => ({ answered: false }),
onSuccess: (basket, _variants, context) => {
  if (context) context.answered = true;
  qc.setQueryData(basketKey(basket.encoded_id), basket);
  setBasketId(basket.encoded_id);
},

The badge skips answered adds. It reads the flag at render, not inside useMutationState's select, because that select only re-runs on mutation cache events and flipping a field on the context object isn't one. What re-renders the badge is the setQueryData call, through the basket query.

The trace above is from before the fix. We haven't taken a new one, and no test covers it yet.

If your badge sums cached lines and pending mutations, watch it during a first add on a throttled network and see whether it ever reads 2.


r/nextjs • • 7d ago

Server Actions vs Route Handlers in the Next.js App Router: how do you decide which to use for mutations?

15 Upvotes

I use Server Actions for mutations from my own UI (forms, buttons) and Route Handlers for webhooks, third-party calls or a possible mobile app later. I re-check auth inside every action instead of relying only on middleware.

Does this split hold up in production for you, and have Server Actions caused problems beyond simple forms?


r/nextjs • • 8d ago Bravo

What is the best headless CMS for Vercel and NextJS projects optimized for SEO and AI Visiblity?

31 Upvotes

'm building a new marketing site and blog on Next.js, hosted on Vercel, and I'm stuck picking a headless CMS. I need editors to control meta titles, descriptions, canonicals and OG images per page, manage schema like FAQ and Article without touching code, and publish quickly with ISR or on-demand revalidation.

I've looked at Sanity, Contentful, Payload, Storyblok and Hygraph. Sanity looks flexible but needs a lot of setup, Contentful gets expensive fast, and Payload is interesting since it runs inside Next.js, but I'm not sure how well it works for a non-technical content team.

The part I can't figure out is AI visibility. Does the CMS choice actually affect whether ChatGPT, Perplexity or Google's AI Overviews cite your content, or is it all about the writing, schema and server rendering? If you run Next.js on Vercel in production, which CMS did you pick and would you choose it again if SEO and AI search traffic were your main goals?


r/nextjs • • 9d ago

Anyone moved from Firebase to Supabase on a Next js app?

20 Upvotes

Anyone switched from Firebase to Supabase on a Next.js app?

I'm pretty much done with Firebase and Supabase keeps coming up as the replacement. I'd rather hear from people who've actually used it with Next than read another comparison blog post

How does auth work with server components and middleware? Was moving the data over painful? And if you looked at Supabase and went with something else, what did you pick


r/nextjs • • 9d ago

Agentic features in Next.js: where the agent should live and how events reach the browser

0 Upvotes

Adding an agent to a Next.js app raises a few architecture questions that "call the LLM from a route handler" doesn't answer once the agent does real work:

1. Keep the agent as its own TypeScript service. Agent runs can be long, call several tools and wait on a human. That doesn't fit request-scoped handlers with execution time limits. A separate agent service (e.g. built with Mastra) that your app talks to keeps runs alive independently of any single request.

2. Stream events, not just text. The browser needs more than tokens: run started, tool call started and finished, state changed, waiting for approval, run finished or errored. A typed event stream (this is what the AG-UI protocol standardises) lets your components react to each event instead of parsing prose.

3. Sync state both ways. If the agent updates data the page shows, send state snapshots and small deltas rather than re-fetching everything. The user and the agent should never disagree about what's on screen.

4. Make cancellation travel end to end. Closing a stream in the browser isn't the same as stopping a run. Cancellation should reach the agent service, and the UI should show a definite "stopped" state.

5. Put guardrails at the boundary. Validate tool arguments against a schema, time out slow steps, and require explicit approval before anything consequential. Your app is the last place a human can say no.

How are you structuring this today: agents inside route handlers, or as a separate service?

(This comes from a hands-on workshop Rainer Hahnekamp and Murat Sari, co-maintainers of CopilotKit's Angular integration, are running on Saturday, using CopilotKit, AG-UI and Mastra.)


r/nextjs • • 9d ago

Solo technical founder running a startup, looking for an optimal tech setup

Thumbnail reddit.com
0 Upvotes

r/nextjs • • 9d ago

Solo technical founder running a startup, looking for an optimal tech setup

Thumbnail reddit.com
0 Upvotes

r/nextjs • • 11d ago

I'm getting fake signups on my side project. How to handle them?

14 Upvotes

I have a small project. I'm seeing fake signups with throwaway emails and bursts of accounts within a few minutes.

What do you use for this?

- A CAPTCHA? Which one?

- A list of throwaway email domains, or an API?

- Rate limits per IP or per device?

- Per-user caps on anything that costs you money (AI calls, emails, SMS)?

How do you avoid blocking real users who use a VPN or a private relay email? That's my main worry. I'll share what I end up with.


r/nextjs • • 10d ago

Alguém aqui já desenvolveu uma plataforma robusta de estudos usando Next.js + Supabase + Vercel?

0 Upvotes

Estou desenvolvendo uma plataforma de estudos focada em preparação para Residência Médica, utilizando Next.js, Supabase, Vercel, VS Code e Claude AI como ferramentas principais.

A ideia é construir um banco de questões estruturado, com milhares de questões, filtros por especialidade, instituição, banca, área médica e assunto, além de um sistema inteligente de revisão espaçada, que organize automaticamente as revisões de acordo com o desempenho e as dificuldades do usuário.

Estou investindo em uma solução mais personalizada, que vá além dos modelos tradicionais de plataformas de questões.

Gostaria de ouvir experiências de quem já desenvolveu e mantém projetos com uma arquitetura semelhante, especialmente em relação aos seguintes pontos:

  • Supabase: como ele se comporta com bancos de dados grandes, milhares de usuários simultâneos e consultas complexas?
  • Desempenho: é possível manter buscas, filtros e carregamento de questões rápidos mesmo com centenas de milhares de registros?
  • Next.js: a arquitetura continua gerenciável quando o projeto cresce e ganha funcionalidades mais complexas?
  • Vercel: existem limitações de infraestrutura, custos inesperados ou problemas de escalabilidade?
  • Autenticação e usuários: o Supabase Auth atende bem a uma plataforma com contas individuais, histórico de desempenho e acompanhamento de estudos?
  • Revisão espaçada: alguém já implementou algoritmos de revisão inteligente e processamento personalizado para cada usuário nessa stack?

Minha preocupação principal é construir uma arquitetura que funcione bem não apenas no início, mas também quando a plataforma tiver uma base grande de questões, muitos usuários, histórico individual de desempenho e processamento de revisões diárias.

Alguém já construiu ou mantém algo semelhante? Vale a pena seguir com essa stack pensando em escalabilidade e crescimento a longo prazo?

Gostaria muito de ouvir relatos reais, inclusive problemas que encontraram no caminho e decisões arquiteturais que fariam diferente hoje.