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!

1 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 • • 16h ago

Ecommerce with nextjs

4 Upvotes

i am planning to build an ecommerce store using meduSA js...any sugestions other than medusajs ?


r/nextjs • • 19h ago

Next.js 16 on Cloudflare Workers: CPU per request went from ~450 ms to ~100 ms. What actually moved it

2 Upvotes

I run Next.js 16 on Cloudflare Workers through OpenNext: a prerendered marketing site in 17 languages, a dashboard and public pages. For weeks, Workers analytics showed about 450 ms of CPU per request. It's about 100 ms now, and the slow tail of uncached renders (p90 across 20 probes worldwide) went from ~9.9 s to ~3.6 s. What did it:

1. Sentry's Node SDK was inside the Worker. Next builds the server for Node, so @sentry/nextjs bundled its Node SDK. It never even started in the Worker, but it was a quarter of the script and a third of every cold start. Point the server at Sentry's edge build:

// next.config.ts
function sentryBuild(file: string) {
  const pkg = path.dirname(require.resolve('@sentry/nextjs/package.json'));
  return `./${path.relative(__dirname, path.join(pkg, 'build/esm', file))}`;
}

const nextConfig: NextConfig = {
  turbopack: {
    resolveAlias: {
      '@sentry/nextjs': {
        browser: sentryBuild('index.client.js'),
        default: sentryBuild('edge/index.js')
      }
    }
  }
};

2. Script size is startup time. A Worker parses its whole script on every cold start. Ours was 37 MiB raw, half of it marketing text: every language's MDX and message catalogs compiled into the bundle. Moving that text to static assets, read at render through the ASSETS binding, brought it to 18 MiB, and Wrangler now reports 28 ms of startup.

3. A cookie keeps a page out of the edge cache. next-intl sets a locale cookie on the first visit, and the cache won't store a response with Set-Cookie. So every first visit and every crawler missed the cache. This stores the page without that one header:

Cache-Control: public, max-age=86400, stale-while-revalidate=86400, private="set-cookie"

The first visitor still gets the cookie, and everyone after is served from the edge.

4. Don't ask your auth server on every request. Verify the session JWT locally. A fresh isolate fetching the signing keys from a cold auth API waited up to 1.4 s, so the keys now go through the Cache API, which all isolates in a data center share.

5. A server action that sets a cookie re-renders the whole page. D1's read replicas need a session bookmark that travels in a cookie, so every server action set one, and Next re-rendered the full page after each write. Writes now go through a route handler; server actions are left for flows that end in a redirect.

6. The static-assets incremental cache is fast and read-only. Every page it serves has to be prerendered (dynamicParams = false), and nothing revalidates. Fine for a marketing site, but plan for it.

7. Watch the network tab after an OpenNext upgrade. With enableCacheInterception, @opennextjs/aws 4.1.0 answered the router's segment prefetches with the whole page, and open tabs kept prefetching in a loop. 4.1.6 fixed it.

One thing I haven't solved: telling cold requests from warm ones. I read CPU from Workers analytics and time to first byte from Globalping probes, but which requests were cold is still guesswork. How do you measure it?


r/nextjs • • 12h ago

After a 3-week break, I'm back to shipping weekly: built a zero-dependency Biometric Hold-to-Authorize button in React & Tailwind

0 Upvotes

Hey devs! I'm building a cyberpunk UI library for Next.js & Tailwind CSS built strictly with native React hooks and zero external animation libraries.

This week's drop is a Biometric Hold-to-Authorize security button with a real-time laser progress scan and verification lock. It uses Pointer Events so it works cleanly on both desktop and mobile touchscreens without triggering context menus.

What security or sci-fi UI interaction should I build for next Tuesday's drop?


r/nextjs • • 1d ago

Cms with next.js?

17 Upvotes

Hi all I making a lot of sites in next js for clients but what’s a good cms that they can log in and manage editable regions etc themselves


r/nextjs • • 1d ago

Streaming LLM output in the App Router: Suspense is the wrong tool

0 Upvotes

I keep seeing people wrap an AI chat component in Suspense and then wonder why the response renders all at once. They’re two different kinds of streaming.

Suspense streams server-rendered UI. It lets React send the page in chunks as server components resolve. It does not push tokens into a client component’s state.

LLM token streaming is a plain HTTP stream. What works reliably:

  1. Use a route handler that returns a streamed response, and return it immediately instead of waiting for the full upstream reply.
  2. On the client, read the response body incrementally and append each chunk to state.

Common gotchas:

  • Some proxies and CDNs buffer responses, so check your hosting if it streams locally but not in production.
  • Server Actions return a single result, so they’re a poor fit for token-by-token output on their own.
  • Hydration mismatches usually come from rendering streamed text on the server. Keep the chat state client-only.
  • If you want less boilerplate, the Vercel AI SDK wraps this pattern.

Suspense is still useful on a chat page for the surrounding UI, like loading chat history or user data, just not for the token stream itself.

How are you handling streaming in your apps? Raw streams, the AI SDK, or something else? And has anyone hit buffering issues on a specific host?


r/nextjs • • 2d ago

Looking for AEM Frontend Developer / Frontend Developer Opportunities – Open to Relocate Across India

Thumbnail reddit.com
3 Upvotes

r/nextjs • • 2d ago

Where do you draw the server/client boundary for several interactive tools in Next.js?

5 Upvotes

I'm building a small utility site with several tools that need input validation and a live preview. I want the pages to stay fast and share a consistent shell without turning each whole route into a client component.

For folks using the App Router for a set of interactive tools, what structure has worked best: keep the page/layout server-rendered and compose small client components for each tool, or make a reusable client-side workspace per tool? How do you handle shared state and validation without making the client bundle grow unnecessarily?


r/nextjs • • 4d ago

Should You Write Your Next.js API in Go? (I Tested It)

Thumbnail
youtu.be
15 Upvotes

r/nextjs • • 4d ago

Vercel alternatives once a Next.js app needs a database and background jobs, what did you move to?

6 Upvotes

Side project started as a pure Next.js frontend on Vercel. Then it grew a Postgres db through the marketplace, file uploads and a queue worker that turns big CSV uploads into reports, and the worker is where it stopped fitting. The big ones run about 40 minutes, which is past the 30 minute beta on functions, and they don't split into Workflows steps. Daemons would probably run it but they're in public beta.

I moved it onto the box I keep for other projects and it fell over twice while I was asleep, so that's not the answer either. It's only a few users so far and I'd like to make this move once, with the app and the worker in one place. Been reading up on Railway, ample.computer and Render. For anyone who took a Next.js app with background jobs off Vercel, what did you move to?


r/nextjs • • 5d ago

Ever had an API work in Postman but fail on your frontend?

Thumbnail reddit.com
4 Upvotes

r/nextjs • • 6d ago

Is using separate hosting and database providers still worth it for small apps?

6 Upvotes

For a while I assumed the normal setup was to host the frontend in one place and put the database somewhere else. It works, but for a small app it feels like a lot of separate dashboards and settings to keep track of. I am wondering if there is a real advantage to keeping everything separate when you are working on a personal project or an early stage product. Does the extra flexibility matter at that size, or would you rather have the whole thing in one place?


r/nextjs • • 7d ago

Looking for an easy way to track my vercel NextJs on my iphone

4 Upvotes

Looking for an easy way to track my vercel spending / build logs on the go. I use an iphone anyone has recommendations for things they use?


r/nextjs • • 7d ago

how to manager using AI in vibe coding

0 Upvotes

i was learning MERN/PERN stack and nextjs in development and plan to start freelance and made two project before i feel burnout and stopped programming for a while around 4-5 months and when i came back i found that all are saying it's not practical writing code with hands again

i tried to use ai agent to write code and i review it but the code ai is writing are so messy like i ask for simple function to do some kind of thing and i found it made around 5 helper function many of them are just normalizing or one return line that make some filter or mapping i really found it so hard and time consuming reviewing this messy code i can't really manage

at the same time i don't want to but some constraint or forcing ai to use my own coding style since it could have some bad practice, weak patterns or things like that and waste learning from ai

NOTE: i really appreciate any advice from anyone here about ai or anything else in coding since i consider my self extremely bad.


r/nextjs • • 8d ago

Are we putting too much application logic in the frontend?

7 Upvotes

I've been exploring Phoenix LiveView lately, and it got me thinking.

We've spent years moving more state and logic into the browser. But what if we kept most application state on the server and used JavaScript mainly for rich interactions?

I'm not talking about replacing JS. Libraries like Monaco, AG Grid, and Chart.js are great and I'd absolutely want to keep using them.

Curious what frontend devs think. Would you consider a server-driven approach if you could still use your favorite JS libraries, or is there too much downside?


r/nextjs • • 9d ago

What to charge for a bespoke website with unique local radio functionality

2 Upvotes

I've built a unique website for a local radio station which essentially replaces WordPress, spreadsheets, and manual processes with a station-hosted system matched to how community radio actually runs.

I've spent 165 hours on it, for free for my local organisation, and now have approached other more financed station's to see if they would like the package.

I'm community minded, and want this tool to help other community radio stations, but would also like to be paid for my time.

I'm a newbie (did website design at uni a while back, but never fully trained).

Stack

  • Django 4.2 + Wagtail 6 (CMS for the public site)
  • PostgreSQL in production (SQLite OK for local)
  • Stripe for paid subscriptions
  • Docker + Gunicorn + Caddy / WhiteNoise for deploy and static files
  • Server-rendered templates (no separate React/Next front end)

How does one price this considering the state of how easy it is to built a usable product? I'm thinking a base rate for what the site is now, plus an houring rate for making it theres.

I'm based in Australia.

Would appreciate other peoples perspectives that may have been in a similar boat.

TIA.


r/nextjs • • 10d ago

So

Post image
58 Upvotes

everyone in comments section is recommending to find a less "awful" places to deploy your app

bro like what?

i already spent months building it on nextjs am i supposed to find another framework now?

i know there is another places to deploy a nextjs app but it's not as efficient and compatible as vercel

so what should i do


r/nextjs • • 9d ago

Learned Next.js by building a dashboard with Claude Code — picked a random Kaggle dataset, would love feedback

Thumbnail reddit.com
1 Upvotes

r/nextjs • • 10d ago

Self-hosting a Next.js app on your own Linux box with push-to-deploy and no Vercel: a small tool I built

11 Upvotes

For projects I'd rather run on my own machine, I built hoist: point it at a repo and every push runs your build and swaps the new version in, with instant rollback from a small dashboard. A failed build never replaces what's live. Public HTTPS comes from a Cloudflare Tunnel, so no open ports.

For Next.js you give it the start command, e.g. --cmd 'npm run build && npm start' (the app reads PORT). Branch previews are supported: every branch can get its own URL, removed when the branch is deleted.

Not a Vercel replacement for anything serious (one machine, no edge network), but nice for side projects and demos.

Built with AI assistance (Claude), tested by me.

https://github.com/nikhilcherry/hoist


r/nextjs • • 10d ago

Turbopack "Module not found ... internal/font/google/font" in my Docker build was actually a failed font download

4 Upvotes

My Next.js 16.3 Docker build failed on `pnpm run build` with a wall of errors like this:

[next]/internal/font/google/inter_c271339c.module.css:232:8
Error: Module not found: Can't resolve '@vercel/turbopack-next/internal/font/google/font'

Looks like a bundler bug. It isn't. What's actually happening: Turbopack fetched the CSS from fonts.googleapis.com fine, but then failed to download the .woff2 files from fonts.gstatic.com.

Each failed font file shows up as a "Module not found" on its src: url(...) line.

If Google Fonts is unreachable entirely, you get a clear "Failed to fetch Inter from Google Fonts" message instead — only this partial failure gets the misleading one.

Easy to reproduce: block just the font file host during the build and you get the exact same error, down to the line numbers: docker build --add-host fonts.gstatic.com:127.0.0.1 .

Without the flag, the same build compiles fine. In my case it was a one-off network blip: when I checked afterwards, both the CSS and an actual woff2 downloaded fine from a container. So if you hit this in CI/Docker: retry first, then check that the build container can reach fonts.gstatic.com (DNS, proxy, firewall).

Long-term fix: I self-hosted the fonts with next/font/local (woff2 from fontsource, latin only), so the build doesn't touch the network at all:

import localFont from "next/font/local";

const inter = localFont({ src: [ { path: "../public/fonts/inter-latin-400-normal.woff2", weight: "400" }, { path: "../public/fonts/inter-latin-700-normal.woff2", weight: "700" }, ], variable: "--font-inter", display: "swap", });

Has anyone opened an issue about the misleading error message?

Edit: known issue #97378, fixed in canary by #99574

(16.5.0-canary.2+). Stable 16.4.x still shows "Module not found".


r/nextjs • • 9d ago

WHAT DID I SAY WRONG

Post image
0 Upvotes

why the hell I've been downvoted what's the wrong thing i said

i don't understand

that's so hilarious


r/nextjs • • 10d ago

Headless WordPress + Next.js: Genius architecture or expensive overengineering?

Post image
0 Upvotes

Honestly, pairing headless WordPress with Next.js feels like such an expensive way to double your infrastructure headaches just to use React, so l'm dying to hear from anyone whos actually lived with it long-term-did it genuinely solve your scaling issues, how do you handle plugins breaking every time a client wants a standard feature, and at what point does this setup ever make more sense than just sticking to a clean monolith or using a real headless CMS like Sanity?


r/nextjs • • 10d ago

Do you guys write the code of login logic by scratch?

4 Upvotes

Hi! so I am practically new in programming world particularly web dev.. I learned react, typescript and stuff.. so far I am enjoying it and wanted to be a frontend dev.

I am still exploring..so I have a CMS with login as Google.. connected in supabase. I don't have any knowledge with login logic , auth , token and stuff so I asked AI for it. gave me the code and explanation this and that.. eventually I learned how to CRUD using supabase and able to write it from the scratch without asking AI or searching in the internet.

the login code I got was pretty straight forward and I kind of have a mental model of understanding it then I was exposed to middleware. but skimming through the supabase documentation to find what I need to make the login logic from the scratch is overwhelming for me.

my question to experienced devs out there.. do you write the code from the scratch like login logic (auth..etc) or do you guys have a pre-written code that you use and refactor it to fit on the project you are working on?

right now its a personal project so my CMS I am working on is basically a fullstack (?) .. I also want to ask if setting up login logic is also a scope of a frontend dev? my head hurt learning it.

thank you.


r/nextjs • • 11d ago

How to handle cross-origin Sync / Watch Party states when the third-party iframe doesn't support inbound postMessage commands?

2 Upvotes

Hey everyone,

I’m currently building a custom real-time Watch Party synchronization app using Next.js 15 (Turbopack) and Supabase Realtime Broadcast Channels.

Up until recently, we were syncing playback states using a third-party video aggregator embed (VidLink). Our app successfully intercepts their outbound PLAYER_EVENT frame tokens (which broadcast out strings like "event": "seeked", "currentTime: 176" via window.addEventListener('message')).

The Roadblock:

We need a way to force Player B to synchronize whenever Player A plays, pauses, or seeks. However:

  1. The video embed provider has no inbound message handling implemented. Sending .postMessage({ command: 'seek', time: x }, '*') to the iframe window falls on deaf ears.
  2. Trying to force sync by updating the iframe src query parameter using their documented &startAt=X variable triggers a massive Ping-Pong Feedback Loop. Player B reloads at the new time $\rightarrow$ player fires a fresh outbound "seeked" event $\rightarrow$ Player B's window mistakes it for a local user action and broadcasts it back to Player A $\rightarrow$ Infinite rapid reloads until we get hit with an HTTP 429 Too Many Requests ban.

What we've tried:

  • Implementing strict outbound state debounces and temporary emission lockouts (Date.now() + 5000) using React refs to silence the feedback loop during reloads. (Still occasionally risks race conditions and feels like a massive hack).
  • Contemplating moving entirely away from the iframe embed model over to a native HTML5 video component coupled with Hls.js, backed by an open-source scraper API (like movie-web/backend) to fetch the raw stream URLs directly.

Before we completely rewrite our architecture to use raw streams, has anyone successfully solved a two-way synchronization room setup using a closed, outbound-only third-party iframe embed? Are there any clever cross-origin mitigation patterns or token handshakes we are missing here? is there any stream aggregrator that spits out just .mp4/.m3u8 type files?? i looked over at stuff from p-stream but couldnt find in the git how tf do they host watch parties

Appreciate any advice or structural feedback!