正在加载视频...

视频加载失败

Just shipped a new Next.js template! • Uses Postgres and Drizzle for the database • UI components with Tailwind and shadcn/ui • Email/password authentication with JWTs stored to cookies • Dashboard pages with CRUD operations on users/teams • Basic RBAC with Owner and Member roles • Pricing page (/)...

362,516 次观看 • 1 年前 •via X (Twitter)

9 条评论

Lee Robinson 的头像
Lee Robinson1 年前

Story points to complete this: 6 newborn nap times 🤣

Guillermo Rauch 的头像
Guillermo Rauch1 年前

@nextjs Love the distinction between global / local middleware. You need to run code before the page cache (edge) and after the cache (region)

MJ 的头像
MJ1 年前

@nextjs Congratz! If you need a bit more @achromaticlabs !

Lee Robinson 的头像
Lee Robinson1 年前

@nextjs @achromaticlabs I linked to it in the README 😁 Great work!

Nico - 📖 Pull Request Best Practices 的头像
Nico - 📖 Pull Request Best Practices1 年前

@nextjs i have a question. why don't the matcher in middleware simply be /dashboard/:path* ? looking at the middleware func, i think it's only there to handle requests to protected routes 🤔 it doesn't need to run for other routes, does it?

Lee Robinson 的头像
Lee Robinson1 年前

@nextjs Good question – it also refreshes the session cookie (on all routes).

Lee Robinson 的头像
Lee Robinson1 年前

@yeg_jennifer @nextjs You can create custom themes!

DevNotes_Journal 的头像
DevNotes_Journal1 年前

@nextjs Awesome work! Love the stack with Next.js, Drizzle, and Tailwind. The RBAC and activity logging system are a great touch for scaling apps. Excited to check out the demo and dive into the code. Looking forward to seeing how you evolve this.

ND 🎯 的头像
ND 🎯1 年前

@nextjs RIP to all sass template inde hackers!!

相关视频

I've been building a music player with Next.js for fun. Here's a quick demo of how it works (it's open source!) • Demo: • Code: If you want to learn more about how it's built, here's more details ↓ I'm using Postgres (with Drizzle) to store information about the songs and playlists. Audio and image files are stored in Vercel Blob (object storage), and the URLs are then referenced in the database. For the UI, I'm using shadcn/ui (so Tailwind CSS and Radix). This made it easy to copy/paste in some nice components, like the dropdown menus. I built the entire first version of the UI in v0 and then iterated from there, feeding it my Drizzle schema as a source in the project and having it scaffold some of the boilerplate for me: I added support for keyboard navigation (using arrow keys) or vim motions (j/k to go up/down, and h/l to go between playlists and tracks). Also, space to toggle the now playing song, and / to focus the search input. The search function has a nice utility to highlight the currently searched text on the page in yellow. Then, I was exploring how to pass metadata from my application to macOS or iOS. Turns out there's an API for that – MediaSession. Web apps can share metadata about what media is playing (title, artist, album artwork) and sync play/pause/seek with system media controls. Works across modern browsers — even integrates with iOS dynamic island and shows up on lock screens: I set up my app like a PWA – it has a manifest.json file, so it can be installed to my iOS home screen or added to my dock on macOS. On iOS, it then uses the full screen height `100dvh` (dynamic viewport) and has padding on the bottom for the safe area with the `env()` CSS function. Finally, I was able to use the Vercel AI SDK in a script to clean up the metadata on audio files I downloaded from YouTube. Bonus: I even was able to dogfood the React Compiler, which helped me fix a performance bug! That's all! It's fun to make personal software:

Lee Robinson

118,242 次观看 • 1 年前

I just compared Claude Code vs Codex vs Cursor CLI The task was to build a Next.js app with Tailwind 4 and shadcn components to collect customer feedback and showcase it with a widget. I gave all three the same prompt and let them go for 30 minutes to see what they came up with. Claude Code with Opus 4.1 Even though I told it to set up the app in the existing project folder, it tried to create a directory for it. After I interrupted and told it not to do that, it built a demo form and landing page with no errors. I had to ask it to make the demo interactive so users could submit a testimonial and preview it. The landing page looked like AI and was pretty basic, but it worked and it was done in a fraction of the time of the others. Total tokens used: 33k Codex with GPT-5 At the end of the 30 minutes I just could not get Codex to produce a working app. It got stuck in a loop of not being able to set up Tailwind 4 and despite many, MANY, attempts, I ended up with a "failed to compile" error. Total tokens used: 102k Cursor Agent with GPT-5 This was the slowest agent by far and a couple of times I actually thought it got stuck in a loop and was close to Ctrl+C'ing to cancel it. The TUI is really nice though, especially how it shows diffs and it did eventually build a working app (after one or two slight errors that needed fixing) The demo was interactive and it had a very minimal design that looked bare but also a lot less like an "AI generated" app than the Opus 4.1 design. It also wasn't too chatty and just did what it needed to do! Code quality was on a par with Opus 4.1, but it did use 5.5x as many tokens to get there. Still cheaper than Opus on a direct comparison but not when you factor in a Claude Code Max subscription. Total tokens: 188k I'll be able to do a proper comparison and record some videos when I'm back from holiday but for now, Opus is still the more capable model out of the box and Claude Code is the more complete CLI product. It will be interesting to see how Cursor evolve their CLI though with commands and subagents because I think with GPT-5 they have a real shot at providing competition for Claude Code if they can optimise output to get similar quality with less tokens. Jump to 0:40 in the video to see the two apps. Which do you think is which? ;)

Ian Nuttall

194,949 次观看 • 11 个月前

✨ A dream I had finally came true: I can now chat directly with my sites to build any feature or fix any bug just via Telegram I've been playing with OpenClaw for 3 weeks now and it's great but I was always too scared to run it on any production server And I was right a bit as Marc Köhlbrugge was able to hack it by social engineering and acting as if it was me, and with enough tries it believed him, and was able to modify the server, change SSH keys etc. of course I had it isolated properly on its own VPS and it didn't touch anything sensitive (as it should!) Marc then reported that bug to Peter Steinberger 🦞 who patched it fast But I wanted to try something more basic and simple, and I think maybe more secure: to just connect Claude Code on my server to Telegram which would be hard locked to only messages from me So I installed claude-code-telegram by Richard Atkinson on the server and run it as a system daemon and it works really well The cool thing is that I was already using Telegram for server errors like this: > Photo AI - ❌ Random credits giveaway failed (Attempt 30/30) with an exception: SQLSTATE[HY000]: General error: 5 database is locked So now I can just reply, "Ok fix this", and Claude Code on the server in production will try (and probably succeed) in fixing it In the video below I asked it to make show [🌳 Parks ] on the map by default on load, it did that, then I reloaded the page and it instantly worked One thing it still needs is sending actual messages while it's doing stuff which OpenClaw does really well, it's annoying to just wait while it says "Working..." but that's probably next

@levelsio

642,033 次观看 • 5 个月前

How should you search, filter, and paginate data with Next.js? This demo has 50,000 books in a Postgres database. • Page Load: When the page loads, we see the React Suspense fallback. This loading skeleton is displayed until the first page of books is retrieved from the database. • Searching: The search input has a 200ms debounce. After 200ms of inactivity, the form submits, updating the URL state with `?q={search}`. The Server Component reads `searchParams` and queries the database. On form submission, a React transition starts, allowing us to read the pending status with `useFormStatus` to display an inline loading state. • State Preservation: Navigating to an individual book page retains the search input state. Reloading the page or sharing the link preserves the search results. • Client-side Filtering: Filtering authors in the left sidebar is done client-side. Authors are fetched by a Server Component and passed as props to the sidebar. Changing the input value updates React state and re-renders the sidebar. • Optimistic Updates: The sidebar’s selected authors are optimistically updated with `useOptimistic`. Checkbox selections update instantly without waiting for the URL to change. • State Preservation: Navigating to an individual book page retains the sidebar filter input and selected author state across navigations, giving it an app-like feel. • Pagination: Navigating between pages updates the URL state, triggering the Server Component to query the database for the specific page of books. We also fetch the total book count to show the total number of pages. This demo isn't perfect yet (still working on it) but it's been a fun playground for some of these patterns. You can imagine a similar experience for thousands of movies, cars, products, or any other very large dataset. Demo → Code →

Lee Robinson

236,802 次观看 • 1 年前