r/nextjs • u/Melodic_Tower_482 • 4h ago
r/nextjs • u/AutoModerator • 1d ago
Weekly Showoff Weekly Showoff Thread! Share what you've created with Next.js or for the community in this thread only!
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 • u/Melodic_Tower_482 • 4h ago
Solo technical founder running a startup, looking for an optimal tech setup
reddit.comr/nextjs • u/No-Cat-9247 • 11h ago
Alguém aqui já desenvolveu uma plataforma robusta de estudos usando Next.js + Supabase + Vercel?
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.
r/nextjs • u/solaris-knight-elf • 1d ago
I'm getting fake signups on my side project. How to handle them?
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 • u/brminnick • 1d ago
Detecting AI agents like ChatGPT in Next.js 16
AI agents like ChatGPT and Perplexity are browsing websites for real people now. In this blog post, I explore how hard it is to tell them apart from humans and crawlers in Next.js.
r/nextjs • u/Own_Sorbet_8935 • 1d ago
Is it a good idea to lazy load a form?
It’s the above-the-fold section, and it uses React Hook Form, a date-range picker, and Zod. When I lazy-load it using dynamic/Next.js imports, the page becomes much faster because it doesn’t load any UI libraries on the initial load; it only loads React and some HTML. However, because it’s above the fold, the user experience gets worse: the form looks it's broken and shows a skeleton on the first render. What do you think about this fix?
r/nextjs • u/deseperatenerd • 1d ago
if i had one agent to choose
Hello, i've been building my startup for the past 3 months using github copilot whenever i reach the limit i create a new account and it restarts, functionally copilot is enough and more than enough, but in terms of UI/UX its not performing well, my website is pretty good i've made design by myself but when i took a look on today websites my website looked from 90's, briefly i have one month before launching and i want to spend it developing UI/UX which ai model should i subscribe to?, to have the best performance limits and price also.
r/nextjs • u/devpatternlabs • 2d ago
What website security issues do developers commonly overlook?
I've been reviewing common security considerations across WordPress websites and Next.js applications.
Something I've noticed is that developers often focus heavily on performance, design and functionality, while some basic security practices receive less attention.
A few examples:
- Exposed API keys and environment variables
- Missing server-side authorization checks
- Outdated dependencies and plugins
- Improper input validation
- Insecure file uploads
- Missing backup and recovery strategies
I think security should be part of the development process from the beginning, rather than something added just before launch.
I'm interested in hearing from developers who maintain production websites.
Questions:
- What security vulnerability have you encountered most often?
- Do you perform security checks before every deployment?
- What tools do you use for dependency and vulnerability scanning?
- Do you follow a security checklist for WordPress and Next.js projects?
Interested in practical experiences and recommendations.
r/nextjs • u/daFreakinGoat • 2d ago
Next JS + Sanity CMS for a small restaurant?
reddit.comr/nextjs • u/Total_Product9154 • 2d ago
who in your company can answer "what happened to this customer's order" without pinging a dev?
think about your own next app for a sec
customer writes in: "i paid but my booking isnt confirmed". support has to answer them. what do they open?
- sentry? only if something threw. a server action that returns { error: "card declined" } is a 200, sentry never hears about it
- vercel logs. per function, raw json, and the confirmation job ran in a worker somewhere else. no support person is reading that
- posthog shows the clicks, not what the backend did after
- admin panel shows the booking as it is now, not what happened to it
- the audit table someone built in 2023 that covers half the models
so it lands in slack. "can someone check what happened to booking 4182". a dev drops what theyre doing, opens 3 tools, stitches the request + the jobs + the db writes together in their head and types back one sentence. support pastes it to the customer. couple times a day
and now with ai agents calling endpoints at night its the same thing again. "what did the agent do" = ask a dev
theres great tooling for "is the app up" and "where did it crash". i couldnt find anything for "what happened, in words someone outside eng can read", so i ended up building my own thing for it (not linking it, rules). but before i go further i want to know if im missing something obvious
how does your team handle this? or is it a dev on slack forever
r/nextjs • u/jb-brezzy • 3d ago
a loading.tsx above my static pages moved all the real text out of <main>
next 16, app router. i added a loading.tsx in my [festival] segment (along with error and not-found pages). every page under it is prerendered.
a few days later my own audit script, which counts the words inside <main> in the raw html, said almost every page had about one word. in view-source, main only had the loading placeholder. the actual content was further down in a hidden div with a small script that swaps it in after load.
i deleted the loading.tsx and the text went right back into main. caught it before it went live, and i already had a transition on link clicks so i didn’t miss the loading state.
what i couldn’t figure out: does this actually matter for google/google adsense, since it runs js and the text is technically still in the html? or did it mostly just break my audit. and is there a way to keep a loading.tsx there without this happening
r/nextjs • u/Which-Examination-74 • 4d ago
With a slow client chunk, a non-transition state update made React discard server HTML under loading.tsx
On a client's storefront (next 16.3.0, react-dom 19.2.4) the product configurator page showed a blank spinner for about 1.4 s instead of the server-rendered page.
An e2e test caught it during development work. It runs against the production server and answers the one client chunk that holds the page root 1500 ms late, to widen the race. At the base commit it was red on both browser projects.
Same result on 3 of 3 loads. The useId-style ids had changed to client ids (our log says the tab ids became _r_0_) and the server-rendered <main> had been replaced. React threw the server HTML away and client-rendered the segment, with no console error.
The trigger was our analytics provider, a client component in the layout above the route segment. For a returning visitor with consent already stored, it called setConsent in an effect, outside any transition. That update reached the loading.tsx Suspense boundary while the boundary was still dehydrated.
We wrapped the provider's two mount-time updates in startTransition. Roughly, with a placeholder value, one of them now reads:
useEffect(() => {
startTransition(() => {
setConsent(value);
});
}, []);The test went green, 6/6.
Our notes say a transition that reaches a dehydrated boundary is held back, whereas a default-lane update is committed and discards the server HTML. Grant and deny on click stay urgent, because the banner has to close on click.
What it costs, measured after the fix: with the chunk 3000 ms late, the server-rendered cookie banner was still visible at 1500 ms, because it stays until hydration, and a tap in that window still discards the server HTML. After Reject, the opt-out happens one render later, 48 ms later than before the fix. No analytics event goes out without consent.
In a probe, next-themes discarded the server HTML the same way when the stored theme differed from the OS theme. We haven't fixed that, and it went into a follow-up task.
r/nextjs • u/carpediegm • 4d ago
Ecommerce with nextjs
i am planning to build an ecommerce store using meduSA js...any sugestions other than medusajs ?
r/nextjs • u/EventAssets • 5d ago
Next.js 16 on Cloudflare Workers: CPU per request went from ~450 ms to ~100 ms. What actually moved it
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 • u/ComponentVerse_Dev • 4d ago
After a 3-week break, I'm back to shipping weekly: built a zero-dependency Biometric Hold-to-Authorize button in React & Tailwind
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 • u/Powerful-Source-6764 • 6d ago
Cms with next.js?
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 • u/Big_Muffin8280 • 5d ago
Streaming LLM output in the App Router: Suspense is the wrong tool
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:
- Use a route handler that returns a streamed response, and return it immediately instead of waiting for the full upstream reply.
- 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 • u/Far-Bank8785 • 6d ago
Looking for AEM Frontend Developer / Frontend Developer Opportunities – Open to Relocate Across India
reddit.comWhere do you draw the server/client boundary for several interactive tools in Next.js?
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 • u/FirefighterUsual775 • 8d ago
Should You Write Your Next.js API in Go? (I Tested It)
r/nextjs • u/Fearless-1135 • 8d ago
Vercel alternatives once a Next.js app needs a database and background jobs, what did you move to?
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 • u/AutoModerator • 8d ago
Weekly Showoff Weekly Showoff Thread! Share what you've created with Next.js or for the community in this thread only!
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 • u/Mrclippoo • 11d ago
Is using separate hosting and database providers still worth it for small apps?
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?