r/nextjs

▲ 11 r/nextjs+4 crossposts

How are you handling shadcn/ui customization in production apps without it becoming unmaintainable?

I’m using shadcn/ui in a production app and adapting the base components to match our Figma design system. I’m a bit stuck on how people usually handle scaling this setup.

Issues I keep running into:

- some components depend on Button variants/sizes (ghost, sm, icon, etc), so changing/removing them breaks other components (Calendar, DatePicker, etc)

- if I keep everything, I end up with a bunch of unused variants/sizes that don’t actually match our design system

- I need to introduce our own variants, but naming overlaps are already happening (same names, different visual meaning)

- changing base styles via tokens only goes so far and eventually I need real overrides

- once files are customized, updates become unclear (not sure when people actually merge upstream changes vs just stop updating)

- also not sure when it’s better to modify the base shadcn components vs wrapping them

So it feels like I’m choosing between a few imperfect options: keep shadcn mostly as-is, fork it, or build a wrapper layer on top - but none of them feel obviously “correct” for a production app that will actually evolve.

How are people handling this in real, maintained codebases?

reddit.com
u/Ok-Willingness4768 — 13 hours ago
▲ 0 r/nextjs

Built a no-auth AI tool with Next.js App Router — in-session processing, zero data stored

Shipped a side project — a résumé roaster/rewriter — and the Next.js decisions were the interesting part:
App Router, everything server-side for the AI calls
• No auth at all — land, paste, result in 30s. Killing the sign-up wall roughly doubled how many people reach first value in testing.
Because there’s no auth, résumés are processed in-session and never persisted — privacy stance falls out of the architecture for free
Anthropic API for generation, streamed back to the client
Razorpay for the paid tier, deployed on Vercel
Happy to go into how I structured the streaming + the no-auth payment flow if useful. Anything you’d have done differently?

reddit.com
u/ayuvgr8 — 14 hours ago
▲ 38 r/nextjs

Anyone here running Next.js without Vercel?

I'm curious how many people are successfully running Next.js outside of the Vercel ecosystem.

I recently moved my project to:

  • Cloudflare Pages
  • Cloudflare Workers

while replacing Supabase with Turso and WorkOS.

For those who have done something similar:

  • Any compatibility issues?
  • Any performance differences?
  • Would you go back to Vercel?

I'd love to hear your experience.

reddit.com
▲ 3 r/nextjs

I need your opinions and ideas about a desktop application that enables web application development.

Currently, I am developing a desktop app that works with a drag-and-drop and blueprint logic, allowing users to build Next.js applications. The core concept started with the idea of creating a tool for full-stack web application development by combining the design aspect of WordPress with the blueprint system of Unreal Engine. I am currently close to completing the MVP, but I would love to get your feedback. Let me explain the basic working principle to you.

On the design side, components work using a drag-and-drop method. You can customize the components as you wish, assign classes, or modify predefined properties. Essentially, you can also use components and themes prepared by other developers within a marketplace.

On the blueprint side, you can manage both the JS functions to be used on the client side and the functions to be used on the server side using a drag-and-drop system.

Architecturally, because it processes and stores all components, pages, functions, and other data as JSON files during the development phase, it runs very fast. At the same time, when the project is exported, it is exported just like a standard Next.js project and can be uploaded to GitHub or similar platforms. Additionally, other Next.js projects can be imported into the system. I don't have any plans to include AI support at the moment, but I might consider it for future versions.

What I am specifically wondering is this: I am running this project as a hobby with no financial expectations, but is it worth it? My goal is to enable people who don't know how to code to develop web applications, while also aiming to increase the efficiency of engineers. I can share screenshots if anyone is interested.

reddit.com
u/SharkmanTR — 1 day ago
▲ 2 r/nextjs+2 crossposts

Show /r/reactjs: embedded, design-token-themed payment fields that work across providers behind one <PayButton>

I open-sourced PayFanout, a React payments layer where the UI is provider-agnostic. You render <PaymentFields> and <PayButton> (or usePay() for your own button), and the same components work whether Stripe or Paysafe is behind them.

React specifics:

  • Embedded, not redirected: card fields render inside your UI in the PSP's hosted iframe (no raw card input, SAQ-A), themed by your design tokens; 3DS/SCA runs inline.
  • SDKs load lazily, only the adapter you actually mount downloads its script, and everything is SSR-safe (works as client components under the Next.js App Router).
  • Two inverted provider flows (confirm-on-client vs server-completion) hide behind one <PayButton>, your JSX is identical either way.
  • Split-field providers let you place each field via slots (data-payfanout-field="cardNumber") in any grid you want.
  • Built-in localized button/error text (en/fr/de/es), fully overridable.

MIT, TypeScript. Repo: https://github.com/donapulse/payfanout

u/arkanizer — 1 day ago
▲ 0 r/nextjs

Many design decisions around server actions seem stupid

1. Forced sequential and disabled parallel execution. Why?

It is huge constraint. If I need something to be sequentially executed, I would just do await await await anyway.

Sometimes, on frontend, I need to call multiple longer tasks in parallel (like image generation) or fetch many things at once.

I understand that "data fetching" is intended to be done inside server components, but many times I need to fetch data dynamically during some client side interaction, inside client components.

In mentioned cases, server actions suck.


2. Version skew and inability to provide custom function id. Why?

On every redeploy server actions get new id, which creates errors for users who opened website before that (and loaded old ids).

This is huge pain in the a**.

Why are we not able to just provide our id, and change it when we feel it is needed?


3. All checks (like rate limit and auth) can be done ONLY after full body was parsed and loaded into RAM. Why?

I want to load body only if request passes rate limit and auth check. It does not make sense to do it before and waste hosting resources (RAM, CPU...).

Further more, loading whole body into RAM before mentioned checks opens big opportunity for denial of service attacks and similar.


4. Forcing POST requests and mutations as only intended use. Why?

Why can't we specify which type of request certain server action will be?


5. Relying on "use server" directive at top of the file instead of having special function for creating server actions. Why?

Maybe just personal preference, but I like more how it is done inside TanStack start. Much more DX friendly.


So, all mentioned problems with NextJS server actions are solved in TanStack start:

  • server function creation and usage: link
  • customizable ids persisted during deployments (not ideal, but still better): link

Why NextJS seems so stupid about all this?

Why NextJS does not have some good general purpose remote procedure call (RPC) system, like TanStack start?

Yeah, there is tRPC etc, but it has lots of boilerplate and it's not native framework thing.

u/Zogid — 1 day ago
▲ 23 r/nextjs

I self-studied full stack, built a project with real users, no jobs...

Hey,

So I studied full stack web development and I'm backend oriented.
I created a shift management app for my manager in the security company I work as a guard.
I did it with the meta stack, that most of the companies work with:
- JS / Node.js - focused on fundamentals
- Next.js / React - full stack apps
- TS / Zod / RHF / pg / ShadcnUI /Better-Auth/Neon/Prisma etc

Every single day for almost a year, I did 30 minutes of recalls while improving answers bit by bit, then 1:30 of study sessions, then building projects.
I started doing mock technical interviews with Claude/GPT, and I'm able to pass them and talk about each concept a lot.

Right now, it work on the building I work at, and this week we are expanding to 2 more buildings, and soon to 10-20 more.

I also collected data of 3000 urls of career pages of companies, created a node scraper with Claude Code, it matches around 4-5 open roles in a week. But for each one of them, probably 100+ people sent their cvs so I cannot get even an interview.

I barely see open roles for Juniors, and I'm someone who is fast with computers (used to be a heavy gamer) and I feel like I made a mistake and spent a lot of time studying something that is not required anymore.

I live in Israel, which is considered the startup nation, with the highest rate of startups for the amount of the population, and yet no open roles, many people are being fired.

Should I stop and start another chapter in other place and not in developing?

reddit.com
u/Fabulous_Variety_256 — 2 days ago
▲ 0 r/nextjs

What was the issue with react libraries not being able to use context provider when rendering on the server and cannot put data inside module stores either because user session data may leak to other users?

Was that problem ever resolved?

If I want to render on the server, can I still useContext?

reddit.com
u/aliassuck — 2 days ago
▲ 44 r/nextjs+2 crossposts

My Next.js SaaS architecture tech stack as a solo developer

The goal of this diagram is to show how I structure my SaaS app as a solo developer.

This is not “the perfect stack”, and I don’t think every project needs all of this. The goal isn’t to say everyone should use the exact same tools, I'm just sharing an architecture that currently works well for me.

At a high level:

Frontend: Next.js, React, Tailwind CSS, shadcn/ui, React Hook Form, TypeScript

Backend: Node.js, oRPC, Zod for the frontend/backend contract

Database: PostgreSQL with Drizzle ORM

Auth: Clerk

Payments: Stripe

Emails: React Email

Observability: Sentry + LogTape

CI/CD and quality: ESLint, Vitest, Playwright, Knip, Storybook, GitHub Actions

I turned this architecture into an open-source GitHub project here: SaaS Boilerplate

u/ixartz — 3 days ago
▲ 4 r/nextjs

Next.js (App Router) + FastAPI: How do you handle role-based auth & middleware?

I'm building a dashboard with Next.js (App Router) as the frontend and a separate FastAPI backend. Authentication is handled by the backend, while Next.js stores the JWT in a secure httpOnly cookie and acts as a BFF.

Now I'm adding role-based access (admin and user). What's the recommended architecture for handling page protection in this kind of setup?

Should Next.js verify the JWT locally (using the shared public key/secret), call the backend to validate roles, or rely on another approach? What's considered the best practice when using a separate backend?

reddit.com
u/Empty_Break_8792 — 3 days ago
▲ 3 r/nextjs

How would you test whether a consumer fintech app has repeat value or is just a one-time curiosity?

I’m working on a consumer fintech idea around spending abroad.

The first version would let someone look back at their foreign card transactions and see where they may have lost money through bad exchange rates or DCC, and which of their cards performed worst.

My main worry is that the first reveal might be interesting, but only once. Someone sees the number, thinks “that’s annoying,” and then never opens the app again.

The more useful version would probably help during future trips by flagging expensive charges and telling people which card would be better to use next time. That sounds stronger, but it also means building a lot more before knowing if people actually care.

How would you test the repeat-use side without overbuilding it?

I was thinking of looking at whether people come back before another trip, turn on alerts, or check which card is best for a destination. Curious what other signals or small experiments you’d use before investing too much into the full version.

reddit.com
u/Former_Banana_890 — 2 days ago
▲ 4 r/nextjs

What am I missing with Prisma and Types?

Hi all,

I am building a new app in Next.js and Prisma, because I saw the hype online.

My previous application was raw SQL, which was fine, and I could use promises of types to help with type safety.

So, in my new project I have two files

types.ts

schema-prisma.ts

Let's say I have a type of Book

export type Book { id: string, pages: number; title: string }

Then, you have the same in Prisma to store books

Model Book { id: string , pages: number; title: string }

So, the second you make a change to your type of Book, like adding new data or making something null, you need to go back into the prisma schema to make it match.

What should I be doing?

AI suggests to delete types.ts and use the schema prisma as the types, is that correct?

reddit.com
u/grand-yojimbo — 3 days ago
▲ 1 r/nextjs

Any way to add another step in Clerk authentication?

Hello, I'm using clerk for my new projects and the am also okay with switching to the pro plan. However, I see no way to collect additional information after sign up. For example, I would like to add a phone number collection request after Google sign up (I know if it offers phone authentication separately but most people prefer login using Google on desktop). Also, is there any way for them to provide additional information like the industry they belong to? If there's no default option, is there any feasible workaround which can achieve this?

reddit.com
u/Hannibaldex — 2 days ago
▲ 11 r/nextjs

how do you decide between server components vs api routes for data tables in next.js?

If you are building a data table, with pagination and sorting, do you use server components, with page reloads per sort/pagination click, or do you make the table client side, with API calls for the data loads?

I can see pros and cons of both.

Curious what people doing?

Would be great to hear the reasons for your choice also.

reddit.com
u/Ok_Train_9768 — 4 days ago
▲ 3 r/nextjs+1 crossposts

I spent 6 months building a standalone AI dev app instead of an IDE extension. Was this a mistake?

Hey everyone,

For the last 6 months, I’ve been building ReCode, a dedicated AI web workbench for developers. But because I've been building in a silo, I need a brutal reality check.

I know inline IDE tools like Cursor and Copilot dominate right now. But my goal was to build a separate environment specifically for boring, multi-step tasks that usually clutter up an IDE chat tab. It also doesn't store any of your code (processed in memory) so isnt a vibe coding tool at all.

Here is what it handles right now:

Mock Data Factory: Parses your SQL/Prisma schemas and generates complex, relational mock data with proper foreign key mapping.

Code Auditor: Runs a deep health check for architecture smells, security flaws, and visualizes Big O complexity.

Universal Translator: Accurately migrates logic and whole files between languages (like Python to TS, C++ to Rust).

And there are more tools but they are less important.

My Dilemma:

I know developers hate breaking their flow.

Is context-switching to a standalone web app a total dealbreaker for you?

Would you ever use a separate tool for complex tasks like DB seeding or deep code audits, writing boring RegEx, translating CSS between its frameworks and so on, or is your IDE chat genuinely enough?

If I need to swallow my pride and pivot this into a VS Code extension, tell me. Be brutal. I’ve attached a few screenshots so you can see what the UI looks like. Thanks!

P.S. If anyone actually wants to poke around the UI and tell me why it sucks, the alpha is live here: recode-alpha.vercel.app

reddit.com
u/Consistent-Star-3906 — 3 days ago
▲ 173 r/nextjs

Just finished migration to Tanstack Start from NextJS

A mid size frontend application with ~100K users. A noticeable difference on prod.

u/Accomplished_You5937 — 5 days ago
▲ 7 r/nextjs

Should I merge my 4 repos (2 TypeScript apps + 2 Python services) into one monorepo?

I'm building an video platform and right now it lives in 4 separate repos:

  1. Main web app — React (TanStack Start), deployed on Vercel
  2. Admin dashboard — also React/TypeScript, internal tool
  3. API backend — Python FastAPI + a Redis worker, deployed on AWS/Railway
  4. Video pipeline — Python, runs on AWS Lambda

They all talk to the same Supabase (Postgres) database and Redis, and they call each other. The database migrations live in the main web app repo, but the Python services read the same tables.

The pain points I'm having:

  • When I change the database schema, I have to update types/models in multiple repos by hand and keep them in sync.
  • A single feature often means opening PRs in 2–3 repos at once.
  • Shared config (env vars, API contracts) drifts between repos.

My question: is it worth moving all of this into one monorepo, even though it's mixed TypeScript + Python with completely different deploy targets (Vercel, AWS Lambda, ECS)? Or is the mixed-language, mixed-deployment situation exactly when you should NOT do a monorepo?

If you've done this — did tools like Turborepo/Nx/Pants handle the Python side okay, or did you just use a plain monorepo with separate CI workflows per folder? Any regrets either way?

Solo dev / small team, so I care more about "less friction day to day" than big-org tooling.

reddit.com
u/klausblade — 4 days ago
▲ 0 r/nextjs

Got 100/100 on PageSpeed Insights across Performance, Accessibility, Best Practices, and SEO on my indie quiz platform — here's what actually moved the needle

Been building BrainRivals.com solo for a while and finally hit a clean sweep on PSI desktop today. Sharing what made the difference:

- No render-blocking resources — deferred everything non-critical

- Image optimization (WebP, lazy loading, explicit width/height)

- Minimal JS bundle — stripped unused deps aggressively

- Proper heading hierarchy + ARIA labels for accessibility

- Clean meta, canonical tags, structured sitemap for SEO

Not easy to hold all four at 100 simultaneously — usually fixing one breaks another. The Agentic Browsing 3/3 is a new PSI metric worth watching too.

Happy to answer questions on the stack or specific fixes.

u/WesternElectronic21 — 3 days ago