Next.js vs TanStack Start - Building 2 apps

English
MMaximilian Schwarzmüller
Computing/SoftwareInternet Technology

Transcript

00:00:00[BLANK_AUDIO]
00:00:30[BLANK_AUDIO]
00:01:00[BLANK_AUDIO]
00:01:30[BLANK_AUDIO]
00:01:40>> Hello, hello, hi everybody, so nice to see you all again.
00:01:55Another Thursday, another stream.
00:01:58This time today with hopefully, whoops, hopefully an interesting topic.
00:02:04I just need to quickly close a little.
00:02:09Yeah, because we'll dive into Next.js and
00:02:1410-stick start because I got asked quite a bit in my courses and X and YouTube.
00:02:22Which of the two to choose, which one's better?
00:02:25And today, I'll try to find the answer or help you find the answer.
00:02:29And we'll do that by building two apps.
00:02:32One with Next.js and one with 10-stick start.
00:02:36And actually it'll be the same app, not a super complex one.
00:02:39I'll say that right away because I only got around two hours as for all my streams.
00:02:44But we'll build the same app side by side, so to say, with Next.js and 10-stick start.
00:02:50And also a bit of AI to help me get through that because two hours for
00:02:55an app, even though it's simple, can be quite ambitious.
00:02:58So yeah, that is what we'll do.
00:03:00So hi everybody.
00:03:01Hello to everybody who's saying hi, lovely to see you all here.
00:03:06And if you've got any questions about Next.js, 10-stick start, or
00:03:11my opinion on the two, obviously ask them.
00:03:14But this stream, of course, should also help.
00:03:19So, some theory first, because everybody loves theory.
00:03:27Let me quickly draw something here for Next.js and 10-stick start.
00:03:39Okay, that's maybe a bit too big.
00:03:43Let's go like this.
00:03:45Okay, so obviously these are both pretty popular frameworks.
00:03:52And most importantly, they're both full stack React frameworks.
00:03:57So that is, of course, something that is important to understand.
00:04:01Just in case that's not clear, we're talking about full stack React frameworks
00:04:07here, which means you build, guess what, full stack React applications with them.
00:04:13So that means client side, server side, combined.
00:04:17You don't need either of the two if you just want to build a single page application.
00:04:22And I'm saying that here because I sometimes see the question if you
00:04:28should use React Router or Next.js.
00:04:32And that kind of makes sense nowadays because React Router can also
00:04:36be used as a full stack framework.
00:04:37But most people that ask this are talking about single page applications.
00:04:42And it's worth noting that neither of the two here, Next.js or 10-stick start,
00:04:46are necessarily a good choice for that.
00:04:49Because if you just want to build a single page application, you can just
00:04:52create a React application with Vite at React Router for routing or at 10-stick router.
00:05:01So here I'm in the docs because there actually are two packages, 10-stick
00:05:05start and 10-stick router, and they kind of work together, but you can use 10-stick
00:05:09router without 10-stick start.
00:05:12So 10-stick router would essentially be kind of the SPA solution if you use just that.
00:05:21And 10-stick start is then the full stack solution.
00:05:26So that is something that's worth noting here.
00:05:29And today we'll take a look at the actual framework, so full stack applications.
00:05:35Now, regarding the comparison, there are many dimensions you could compare.
00:05:42And we'll go through them automatically in this stream.
00:05:45And feel free to ask whatever comes to your mind.
00:05:48And I'm reading the chat.
00:05:49I'll get back to the questions soon.
00:05:50No worries.
00:05:52One thing you could compare besides the technical stuff, of course, which we'll
00:05:56also see, is like the ecosystem and how easy it is to use these frameworks
00:06:04from the ecosystem perspective.
00:06:06So how many resources are out there?
00:06:09And also important nowadays, how well does AI know about them?
00:06:14And of course, on that front, Next.js is better if that is the main thing you are interested
00:06:24in because of course it's more mature and there are more resources out there about Next.js.
00:06:31And for example, AI knows a lot about Next.js out of the box.
00:06:36Not all of that is great and not all of that is up to date.
00:06:38I will say that, but it does know a lot about it because of course it has seen a lot of repos
00:06:44out there that use Next.js during the training process.
00:06:48And for 10-stack start, that's not necessarily the case.
00:06:53That however is not necessarily a big issue because nowadays, of course, we got many ways
00:06:59of giving AI tools like cursor or cloud code the extra knowledge they need.
00:07:04You can manually copy and paste docs articles into your prompt, something which I really
00:07:09like to do.
00:07:10You can use MCPs like the Context 7 MCP, which is really amazing.
00:07:15I'm not a big fan of MCPs, but I will say the Context 7 MCP is pretty good.
00:07:20Essentially that is an MCP that allows models to dynamically fetch documentation for many,
00:07:26many, many projects and libraries out there.
00:07:29So that is useful.
00:07:30And of course then tools like cursor or cloud code can also do web search.
00:07:35So they can simply search for the doc.
00:07:36So there are ways of making that available.
00:07:39Still, you will find more resources, more tutorials and courses if you're interested in that for
00:07:44Next.js.
00:07:45Before I continue, there is a question, which tool am I using for the presentation?
00:07:51So this canvas app here, this drawing app is an app I'm building.
00:07:54It's not released yet, but I will release it soon, hopefully.
00:07:57And then you can use it for free.
00:07:59This same mode I'm using here.
00:08:02So I'll then link it below future videos whenever that is done.
00:08:06And then this nice app for drawing these arrows.
00:08:10That is not an app by me.
00:08:11Instead, that is this app here, DemoPro, which I got many years ago.
00:08:17It's a Mac OS only app, I think, and it's really nice for drawing on the screen.
00:08:22So that's what I'm using here.
00:08:25As a beginner, are Next.js and Tanstech Start alternatives to Nuxt?
00:08:28Yes, they are for the React ecosystem, though, or not though, but it's worth noting that Tanstech
00:08:35Start is actually not just React, but can also be used with Solid.js, not sure, Solid.js.
00:08:47I don't even know where in their docs I could, ah, here.
00:08:50Yeah.
00:08:51I could use it with Solid, too, but I don't know if it's totally equal regarding the features
00:08:58that are supported.
00:08:59I've only used it with React.
00:09:01Okay.
00:09:02So that's the first dimension here, the ecosystem.
00:09:07Another one you could look at is maybe the ease of learning or ease of use.
00:09:14And again, you can always argue if that is super important nowadays, because clearly,
00:09:20we got AI, of course, so that might not be too important, you could argue.
00:09:26But then again, I would argue it makes sense to understand the code you are writing or generating.
00:09:33And here, I'd say Next.js, it's easy to get started, but I would say it's kind of hard
00:09:42to master it.
00:09:45And for Tanstech Start, it's the opposite, I will say.
00:09:48At least it was for me.
00:09:50I found it a bit harder to get started with Tanstech Start, but once you got the hang of
00:09:54it, it's actually easier.
00:09:56So they are equal for me for different reasons.
00:09:59And by the way, this, of course, is all very subjective here.
00:10:02This is absolutely not the only way of looking at it.
00:10:08That's just my way.
00:10:09And one reason why I found Tanstech Start a bit harder to get started with is that the
00:10:15documentation used to be not that good.
00:10:19And nowadays, it definitely is better.
00:10:22Still not perfect, I'd say it can be a bit chaotic if you like go through it feels a bit
00:10:28like a brain dump still, but it got better, way better.
00:10:32The search also got way better.
00:10:35It used to find all kinds of stuff.
00:10:37If you searched for a server function, for example, now it's a bit more helpful.
00:10:41So that is definitely way easier.
00:10:46On the other hand, Next.js, the documentation, well, maybe just because I'm used to it, but
00:10:55I found it pretty well structured.
00:10:57You can move through it pretty smoothly and a lot of stuff makes sense.
00:11:04But Next.js has a lot of hidden and not so hidden complexity.
00:11:09The entire caching stuff can be totally overwhelming and it got better, I think.
00:11:16There's less magic going on.
00:11:20It used to be pretty hard to understand when components would get cached.
00:11:27And most importantly, there used to be quite a lot of differences between running your app
00:11:33in development and in production.
00:11:35That meant you always had to kind of test it in production and you should always test it
00:11:39in production before shipping to production.
00:11:40But you had to constantly do that to rule out issues, essentially, because things would
00:11:46load and update in development, but not in production and that could be super annoying.
00:11:50That got a bit better, but still you got a lot of directives and stuff.
00:11:55You got use server, use client, use cache, and some people absolutely hate this.
00:12:01I'm not one of them, but I will say that it can definitely be confusing once you dive in
00:12:07a bit deeper.
00:12:10That said, I have a Next.js course.
00:12:14If you go to my website, academy.com, under courses there, there is a Next.js course.
00:12:21It's up to date for the app router and all that, and you can use that.
00:12:28So just a little bit of promotion for that.
00:12:30Got no 10 stack start course yet, maybe.
00:12:33Maybe I'll create one.
00:12:34We'll see.
00:12:35Also, because I saw it, there are some messages in the chat that Remix is not included or Nuxt
00:12:47is not included.
00:12:48And that is all true.
00:12:49Essentially, I have two hours, so I have to kind of limit it.
00:12:53And I wanted to do this build one app with two technologies thing.
00:12:57And if I also add Remix, so React Router and Nuxt and then maybe also SvelteKit, that kind
00:13:04of gets a bit too complex.
00:13:06And the truth is that Next.js in the React world is simply the biggest, the most important
00:13:12framework, you could say.
00:13:15It's AI's darling.
00:13:17The default apps you get with AI are typically React, Next.js, Tailwind and so on.
00:13:23And 10 stack start has a lot of hype right now on X, on YouTube to some extent.
00:13:30And that is why I'm looking at these two.
00:13:31That does not mean that Remix, Nuxt and all the others are bad.
00:13:34Just to be very clear.
00:13:37Okay.
00:13:40What I don't like about 10 stack, it doesn't have a view option.
00:13:42That's true.
00:13:43But Next.js doesn't have that either.
00:13:46Yeah, yeah, yeah.
00:13:50So I was just researching.
00:13:53I see my favorite tutor covering this.
00:13:56Oh, that's too kind.
00:13:58How do you remember and keep so many technologies in your mind?
00:14:01I don't keep them in my mind.
00:14:03Regarding Next.js and 10 stack, I just used to work a lot with them.
00:14:07I mean, 10 stack start, I built this, built my graphic site, which I have mentioned it
00:14:12here and there already.
00:14:13I will not bore you with more promotion, but I have built stuff with it that I also shipped
00:14:18and also with Next.js.
00:14:19So it's not like I'm using all these frameworks all the time and I know them all by heart.
00:14:24That's not true.
00:14:26Yeah.
00:14:28So yeah, we're going to build one app with both frameworks and I'll try to remember to
00:14:34add more to this comparison, but I don't want to bore you with too much theory.
00:14:37So let's get started.
00:14:38Oh yeah.
00:14:39One thing that's worth mentioning of course is that 10 stack start, it's hidden behind
00:14:43the chat here, but it's in RC right now.
00:14:46So release candidate.
00:14:47It's not stable yet.
00:14:51Not a lot should change about it.
00:14:53But for example, it doesn't have react server component support yet.
00:14:56Not sure if that will come before it's stable and not sure if you need it.
00:15:00But yeah, that's worth noting.
00:15:01It's in release candidate phase.
00:15:03Okay.
00:15:05So what are we going to build here?
00:15:11Don't I use VS Code anymore?
00:15:12Oh, I'm switching all the time.
00:15:14Also for course purposes right now, I'm using Cursor and I will use Cursor today.
00:15:19Yeah.
00:15:21And so that we can actually see how it's different regarding the syntax and code, we'll build
00:15:25an app as I mentioned.
00:15:26And what will we build?
00:15:29We'll keep it simple.
00:15:30We'll build a note taking app.
00:15:32And I know you're now all basically going crazy due to all the excitement.
00:15:38What could be more exciting than a note taking app?
00:15:41Of course it'll be a CRUD app in the end, but hear me out.
00:15:45We got two hours.
00:15:46I want to compare them.
00:15:47And a note taking app allows me to include a bunch of stuff that I want to have in there.
00:15:53Essentially, the idea is that we will have authentication, we'll add authentication using
00:15:58better auth, and then we'll allow users to take and manage and view notes.
00:16:05So it will be of course a CRUD app.
00:16:08It's nothing more than that.
00:16:09It's just a CRUD app, but of course it will allow me to show a bunch of features here.
00:16:16And for taking the notes, I want to have a rich text editor and we'll use Tiptap for that.
00:16:23That's the plan.
00:16:24I have not built that before.
00:16:25We'll see if we can get it done in the two hours because of course I'll be talking, explaining,
00:16:29and I want to do it in both frameworks, but that is the plan and we'll use some friendly
00:16:35AI support here so that we hopefully can get this done quicker or maybe not at all.
00:16:43We'll see.
00:16:45Okay.
00:16:46So that is what we'll build.
00:16:48With that, I'm already in a folder, empty folder right now, and I want to create both projects
00:16:54here and I'll do that with help of the official docs.
00:16:57So for Next.js, we'll create a new app with Bun.
00:17:06I'll use Bun.
00:17:08So essentially these commands here, bun create, next app at latest.
00:17:15And I'll name it next app or next notes.
00:17:21And I'll use the defaults, which you see it is TypeScript, ESLint, Tailwind, AppRouter.
00:17:26That sounds good.
00:17:27I'll use that.
00:17:28And I'm using Bun here for the installation for running it simply because it's a bit faster,
00:17:33especially for all the package management stuff.
00:17:37But of course you can use Node as well.
00:17:40Okay.
00:17:41So now I can navigate into next notes here.
00:17:45We can run the dev server, but I'll do that in my IDE later.
00:17:49First I'll get out of there and we'll create our 10-stack start application.
00:17:57Getting started, no quick start.
00:18:03And I'll also use Bun for that.
00:18:07So Bun create at 10-stack/start latest, and I'll have my 10-stack notes here.
00:18:17And 10-stack start by default right now, when you run this command here, we'll also create
00:18:25a project with Tailwind and TypeScript and so by the way.
00:18:29So let me now open that in Cursor, as I mentioned, that is my plan.
00:18:37So one second.
00:18:43Where is it?
00:18:44Here it is.
00:18:45That is the Next.js application.
00:18:52Can I drag you over?
00:18:53Please.
00:18:54Thank you.
00:18:55The Next.js application here in Cursor.
00:18:58And then in a separate window, I'll open up the next 10-stack, the 10-stack notes application
00:19:08in Cursor too.
00:19:10Okay.
00:19:11So got both the projects open here and we'll do some switching here.
00:19:15So yeah, sorry about that.
00:19:17We'll have to switch around, but I won't have them in separate editors.
00:19:22Let's see.
00:19:23Which questions do we have?
00:19:24Am I going to make, oh, thank you so much.
00:19:28We got a new follower's goal.
00:19:30I didn't even know that I had that set up, but cool.
00:19:34How good is, no, sorry, what was the question?
00:19:38Why not create a poll to see what course your viewers would be interested?
00:19:41Oh, the thing is I have a good idea of what many people are interested in because I get
00:19:46requests all the time.
00:19:47Time is the only issue and I'm always a bit hesitant to create polls because the winner
00:19:53then feels like I have to do the winner then and if then something doesn't work out about
00:19:59that, I don't want to disappoint people.
00:20:00So that's why I'm not doing that.
00:20:04So what do we have?
00:20:13How good is 10-stack star for creating PWAs?
00:20:15I haven't done that yet.
00:20:16So I don't know.
00:20:17I have to admit.
00:20:18Am I going to make a 10-stack course?
00:20:20Definitely something I would love to do.
00:20:24Time is the only issue.
00:20:27Am I planning a tutorial on model training and fine-tuning?
00:20:32Not in the very near future, I would say.
00:20:40Of course, all will be doing by hands, not the eye.
00:20:43Nope, I will definitely also use AI.
00:20:53Do you think Cursor is better for building apps than VS Code?
00:20:57Well I think Cursor, the AI agent, the harness in which the AI models run is pretty good.
00:21:05I think VS Code has caught up a lot.
00:21:08To be honest, I would simply use whatever works best for you.
00:21:11I mean, the best tool is just like the best AI model.
00:21:14It changes every week, so I wouldn't worry too much about that.
00:21:23What do you think about Solid and Solid Start?
00:21:26It's been like one and a half years since I last worked with Solid.js.
00:21:29I liked it a lot, but I haven't used Solid Start.
00:21:32Let's get going.
00:21:35As I said, I will be using AI, but I'll not just use AI.
00:21:41We want to have that notes-taking app with authentication.
00:21:44For authentication, I'll use BetterAuth because BetterAuth is an amazing library.
00:21:48Oh, by the way, because I forgot it for the database, that will be SQLite.
00:21:56We'll use a SQLite database and I'll use BUNS built in SQLite capabilities.
00:22:02BetterAuth it is for authentication because BetterAuth is pretty amazing.
00:22:08One thing I'll try, and it has worked in the past, we'll see if it works today, is I'll
00:22:20use Cursor here.
00:22:22This is the next JS application I'm in.
00:22:24I'll use Cursor and I'll ask it to set up the authentication with BetterAuth.
00:22:28For me, we're building a note-taking app and we need user authentication using BetterAuth
00:22:38already installed because I'll do that real quick.
00:22:41I'll add the BetterAuth package here and then I'll say, "Please set up authentication via
00:22:51BetterAuth according to the BetterAuth docs for next JS using SQLite because that's what
00:23:06we'll use."
00:23:09One thing I'll do real quick, I will actually go into app or actually outside of app, I'll
00:23:20add a lib folder.
00:23:21In there, I'll add a dbts file.
00:23:24In there, I want to set up my database access so that the AI can use that.
00:23:29I will use BUN SQLite, as I mentioned.
00:23:33BUN has that built-in SQLite client, where client is the wrong word.
00:23:37It's the entire database in the end, the way SQLite works.
00:23:40That means we don't need to install an extra package since I'm using BUN anyways.
00:23:46I'll just, well, copy this, though actually we don't need to do that.
00:23:52I guess we can just import.
00:23:53What is it?
00:23:54I keep on forgetting it.
00:23:55Import database from BUN and add the types for that to make TypeScript happy.
00:24:06Then I'll have my database.
00:24:08STB sounds good, and I want to export that and create table if not exist nodes.
00:24:17Sounds reasonable, I guess.
00:24:20Oh, and it's BUN SQLite, of course.
00:24:24Yeah.
00:24:25Okay.
00:24:26And that is run, I think.
00:24:29Okay.
00:24:30So that should give us a basic notes table and we'll store our content in there, which
00:24:33later will be some JSON coming from the TipTap editor.
00:24:37That is the plan.
00:24:39And I can copy that, of course, because I'll have the same over here in the 10-stack start
00:24:47application.
00:24:48So there I'll also add types BUN and I'll also add the better-of package because we need authentication
00:24:55there as well.
00:24:58So that is the plan.
00:24:59In there, in that 10-stack start application, I'll also clean up the demo routes, add the
00:25:03data here, and I guess we can keep the component for now.
00:25:08Okay.
00:25:11Can you please explain the difference between 10-stack start and XJSY 10-stack start is better?
00:25:1510-stack start is not better.
00:25:16And regarding the difference, that is essentially, we'll explore it together, this stream.
00:25:21I already outlined some things here in this first basic comparison and we'll kind of build
00:25:27up on that and we'll just build both so that you can form your own opinion.
00:25:31There isn't a better or a worse choice.
00:25:33They're just different and each has its advantages, as we will probably also see throughout this
00:25:38stream.
00:25:39Okay.
00:25:40So now we got the database handle set up here.
00:25:43Actually, I also want to run the pragma command here to use vol mode, which is better for performance
00:25:54for SQLite.
00:25:57And that should be good.
00:25:58So now back here in the next JS application, I'll move my, thank you so much for the subscription.
00:26:09I'll move that chat over there again.
00:26:12So telling cursor to set up better auth, look up the better auth docs for that.
00:26:19Use context seven as a hint I give it so that it uses this context seven MCP, which I'm using
00:26:23to look up the docs, hopefully, or web search.
00:26:28Use DBTS for the database and we'll use plan mode and I'll copy that and I'll do the same.
00:26:34Of course, in the 10 stack start application, paste it in there.
00:26:38We're building a note taking app and we need to use user authentication.
00:26:40I'm not mentioning next JS here.
00:26:42Am I?
00:26:43I am for 10 stack start.
00:26:47Yeah, and I'll let the AI plan that here too so that it sets up authentication in both.
00:26:59Do you have a free alternative to cursor?
00:27:02Well, the expensive part is the AI and that costs money everywhere, no matter which client
00:27:06you use.
00:27:09Okay.
00:27:13Vercel hosting is very expensive.
00:27:14Next is not scalable using a custom server.
00:27:16Well, that got a bit easier.
00:27:18I will say indeed.
00:27:20It's totally true that in the past hosting next JS outside of Vercel was pretty difficult
00:27:26or annoying or not straightforward at least, but they have actually quite good guides on
00:27:32their website now, the deploying guides where they walk you through setting up and I think
00:27:40there are more than that too, where they walk you through setting up next JS on other pages
00:27:46as well.
00:27:47Other hosting providers, including VPS and so on.
00:27:50So that got better, but I will agree.
00:27:52It's definitely easier on Vercel and that in turn can get quite expensive for sure.
00:27:58Yeah, okay.
00:28:02So what's the AI doing?
00:28:04We got a plan here.
00:28:05Let's see.
00:28:06I'm actually reading the plans.
00:28:09So libdbts creating an auth server, libauth blah, blah, blah.
00:28:18Yeah, I mean it could just use the handle from the db file.
00:28:24So use db handle from dbts.
00:28:28Don't set it up again.
00:28:29It's not a super important difference, but why not?
00:28:33Oh yeah.
00:28:36And one important thing I forgot, we will- no, no, it's fine.
00:28:42Email and password is fine.
00:28:47Okay.
00:28:50Add environment variable, run database migrations.
00:28:55Okay.
00:28:56Yeah, we'll see.
00:28:57That looks good.
00:28:58Let's take a look at the other plan here.
00:29:00Here it is importing my db handle the way I want it.
00:29:03Let's take start cookies, server handlers.
00:29:08That's looking good.
00:29:10I think it also wants to run the migrations here.
00:29:14We'll see.
00:29:15We'll see whether that works.
00:29:16So let it cook, let it cook.
00:29:22What do you think about convex?
00:29:25I just found out that I'm blown away.
00:29:27I know there's a lot of hype around convex.
00:29:28I have to admit, I just haven't had the time to really dive into it yet.
00:29:33So I don't have an opinion.
00:29:34I will definitely take a look at it because so many people are so excited about it.
00:29:40So yeah, I'll see and for my own opinion.
00:29:45And thank you so, so much, wise boy, for the very nice message and for the sub means a lot
00:29:50to me.
00:29:51Thank you so, so much.
00:29:55Does the AI for developers course have a cloud code?
00:29:58No, it's about GitHub Copilot and cursor.
00:30:04Next change is caching every other month.
00:30:07Yeah, the caching part about Next.js, as I mentioned before, can be super frustrating.
00:30:12Okay, so now it's setting up a .env file for me here.
00:30:16Not a super big fan when AI does that, but it's fine here for me.
00:30:19I didn't have one anyways.
00:30:23Let's see if that migrate command works.
00:30:27Not in the sandbox, I guess.
00:30:32I don't recall whether the better off migration thing worked with Bun.
00:30:38I thought there were problems with that.
00:30:40Yeah, I cannot find Bun SQLite.
00:30:47So now it tries to generate a SQL file here.
00:30:51Yeah, that won't work.
00:30:55Let's see if it can figure that out.
00:30:57Same problem here, I guess.
00:30:59So we can just watch AI fail here and actually instead of doing that, what I'll do is I'll
00:31:06quickly head over to better off and there under, I think database, they are clearly specifying
00:31:13the schema it needs in the database.
00:31:16So I will just copy that here.
00:31:19These are the tables better off needs with the columns it needs.
00:31:23So I'll say here are the official better off docs on this schema.
00:31:32Use that and set it up manually in code.
00:31:37Copy that, send that and do that here too.
00:31:42Oh, I think here it actually did something.
00:31:46Here it actually, oh yeah, it already, it found another way of migrating, I guess.
00:31:55Let's see.
00:31:56Let me switch that over so that we can see the file browser.
00:32:00So that's the TanStack project and in there it created this off migrations TS file.
00:32:06So essentially it did that.
00:32:07Now I guess it just verified whether the tables are set up correctly and it ran those manually,
00:32:17I think.
00:32:18Oh, okay.
00:32:19So that should be, that should be fine.
00:32:22And in the next JS project, it now adds them here to DBTS and therefore that will, these
00:32:30tables will also be created whenever we start the app.
00:32:32So that should be working too.
00:32:34So with that, I can run my next JS application here.
00:32:43And I think actually I should run that with dash B to make sure that the bun runtime is
00:32:49being used and then I can visit localhost 3000.
00:32:53That's the wrong port.
00:32:55That's my local app here.
00:32:56So let's set the port to 3001.
00:33:07And that is the next JS application.
00:33:10And then here for better or for TanStack, I'll use 3002.
00:33:26What's that?
00:33:34What is this weird error?
00:33:39Is that maybe because I deleted something which I should have cleaned up?
00:33:45Let's see.
00:33:50One thing I should do here is I should set these scripts up like this.
00:34:02Okay, well, where's this error coming from?
00:34:10I swear to God, I work with TanStack start all day in dozens of projects.
00:34:18And the moment I started streaming, I get some weird errors.
00:34:27But that's what we have AI for, right?
00:34:36I mean, that's really weird.
00:34:41One thing I also want to do here in the next JS project.
00:34:45Also there, I want to ensure that I'm reusing bun for running these scripts.
00:34:56Because otherwise, the runtime is not available and the SQLite database will not work.
00:35:01App config.
00:35:05What's that about?
00:35:06Classic.
00:35:07Yeah.
00:35:08Hi, Francesco.
00:35:09Yeah.
00:35:10I mean, you don't have me to believe me.
00:35:19But I have literally only worked with TanStack start for the last weeks.
00:35:24And now I create a project with their command and I get some weird error.
00:35:34One thing I'll check real quick is the version.
00:35:39I have a number project, as I just said, which TanStack versions am I using there and which
00:35:45maybe it's a broken new version or something like that.
00:35:49So oh, I guess we can also try bun update.
00:36:01Any old versions we locked in here?
00:36:03No changes, huh?
00:36:12So that app config thing here, I don't know what that was about.
00:36:26One thing I'll do here, because I don't want to spend my day here on this, I'll just copy
00:36:35over some dependencies from my other project where it's working.
00:36:46Where I'm using TanStack start, hoping that this will do the trick.
00:36:54And then we'll see, I guess.
00:36:59No, that's not it.
00:37:06Oh boy, I'll see.
00:37:07We will not even get one app done, will we?
00:37:15I mean, just to check this real quick, if I create a new project here, TanStack start,
00:37:22TanStack nodes two, if I create a new project and I don't change anything about it, will
00:37:27that run?
00:37:28It does, I'll just try to copy over the code and see when it breaks.
00:37:32So let's get into TanStack nodes two, and bun run def, that's the wrong port.
00:37:44Or is it the port?
00:37:45Is that the problem?
00:37:47Shouldn't be though.
00:37:50Okay, so that seems to be working.
00:37:53So clearly I messed something up in code, I guess.
00:37:58Whatever that could be for that weird error, whoops, that's the wrong route.
00:38:03Okay, that's the TanStack start project, whatever, I don't know what's going on here.
00:38:07But what I do know is I'll just open this new project then and I'll just copy over the
00:38:12code and hope that it doesn't break.
00:38:17That's TanStack, TanStack nodes two, okay, and then let me grab the lib folder.
00:38:28Into the source folder, let's grab these API routes here because these are the auth routes
00:38:33that we need.
00:38:34Let's get rid of the demo routes here.
00:38:38And let's see.
00:38:40Okay, now it started crashing again.
00:38:43What did I do that it started crashing?
00:38:47Cannot find module better auth, okay, that makes sense, that was a different error.
00:38:50Obviously we need better auth and we'll also need the bun types here.
00:38:59Okay so now let's see.
00:39:04Okay now it starts crashing again.
00:39:06TanStack start injected head scripts, is that a better auth related error?
00:39:15What is going on here?
00:39:22What is going on here?
00:39:25Or is there an error in this file?
00:39:26No, this looks good.
00:39:34Does it work if I delete lib and the API routes?
00:39:39So the dev server is not running here.
00:39:41Let's now run it here, bun run dev.
00:39:44I mean that's the exact same setup I had in other projects.
00:39:46Okay so now it's working.
00:39:48When does it crash?
00:39:49Does it crash if I add the API routes?
00:39:55I mean there's an error in that file because the lib folder with auth is missing.
00:40:01So if I copy in the lib folder, is that when it starts crashing?
00:40:07No.
00:40:11Is it up and running?
00:40:19No.
00:40:24This is now related to bun and that is probably because I have to run this with bun run bun.
00:40:40But now I get this again.
00:40:43I wanted this stream to be about a comparison and not about why setting up a project with
00:40:47TanStack start suddenly breaks after it worked before.
00:41:06I'm very sorry about this.
00:41:08I did not seek this coming.
00:41:10This is not a complex app, clearly.
00:41:13So if it's related to the auth, I'll just do it without the auth.
00:41:19So I'll delete auth.
00:41:20I'll delete the auth routes.
00:41:25And I have been TanStack start with auth running in other projects, but maybe it's a new, better
00:41:33auth version.
00:41:35I don't know.
00:41:36I want to continue, so yeah, we'll do it without auth.
00:41:41I'm sorry.
00:41:42We'll do it without auth and that will have to do.
00:41:47So we have our database, we'll still use that, but there will not be authentication.
00:41:53And therefore, of course, I'll also remove it here for next test.
00:41:57I'm sure we could figure this out, but I don't want to bore you with me debugging some weird
00:42:02error and seeing if it's a better auth error or whatever.
00:42:07Okay, so that is that.
00:42:11How are things going for you?
00:42:15They're going great over here.
00:42:18So I guess we'll simplify the app.
00:42:20We'll build an app without authentication.
00:42:25Now this was not the best start for TanStack start, I will say that.
00:42:29And just to also be clear, the goal of this video is not to show you that TanStack start
00:42:34is better or Next.js is better.
00:42:37Personally, despite what just happened, I really like TanStack start a lot.
00:42:43As I said, I've been using it for plenty of projects, some released, some not over the
00:42:47last two months.
00:42:50And I think it's amazing.
00:42:51The problem you just saw is a problem I never had before.
00:42:54And also just to be clear, because there are always some people that think it's sponsored
00:42:59or something like this.
00:43:00This is not sponsored.
00:43:01This is my opinion.
00:43:02This is not sponsored.
00:43:04Yeah.
00:43:05So just to get that out of the way.
00:43:08First rule of programming.
00:43:09If the code works, don't touch it.
00:43:10True.
00:43:11And that's why I won't add authentication now.
00:43:14Okay.
00:43:15So we're 40 minutes into the stream and we got essentially a basic Next.js and TanStack
00:43:21start application set up.
00:43:24Let's see if the next step goes any better.
00:43:26I want an editor, we're building a node taking out, right?
00:43:30So we need some routes.
00:43:31We need some routes.
00:43:32In the Next.js application, I want my nodes route with a page TSX file in there.
00:43:39And I want my editor route in there, which allows me to add new nodes, for example.
00:43:48And of course, I also want my detail route in there.
00:43:55So just to walk you through that, where is it?
00:44:03It's been some time since I last was in the Next.js documentation.
00:44:11So dynamic routes in Next.js are created by wrapping the route segment in square brackets.
00:44:17So I'll have my nested folder in there.
00:44:23Hello, can you please create a folder?
00:44:25Thank you.
00:44:26And that is my node ID.
00:44:28And in there, I also have page TSX.
00:44:30So that is the structure I want.
00:44:32I want a nodes route with all my nodes, an editor route for adding nodes and an ID route
00:44:38for viewing a node.
00:44:40And I want the same here in TanStack start.
00:44:43So in there, the routing is also a file-based routing by default.
00:44:47And you can also create subfolders.
00:44:50You can also create these flat files.
00:44:52So I could have nodes TSX and then nodes.editor TSX, and the dot here would be interpreted
00:45:00as a slash.
00:45:01But in my experience, this can cause some problems with nested routes.
00:45:06And I prefer having folders for routes anyways.
00:45:09So I will go with nodes and then an index TSX file in there.
00:45:13It's page TSX in Next.js.
00:45:15It's index TSX in TanStack start for the main route under that segment.
00:45:21So under the nodes segment.
00:45:23And then I want to have an editor route in there with index TSX.
00:45:27And then I want to have my nested route in there.
00:45:30And in TanStack, that's not square brackets for the dynamic segments.
00:45:34It's a dollar sign instead.
00:45:36So that would be my nested route.
00:45:39And instead of this, just to be clear, I said it before, I could have also created a file
00:45:45named node ID TSX with a dollar sign at the beginning in the nodes folder.
00:45:51And that would then give us nodes slash and then the ID and that would load that route.
00:45:57So yeah, that is that.
00:45:59That's the route structure I want to have here in this project.
00:46:04Now what's interesting about TanStack start is that when you create a new route file, you
00:46:09will see that it gets populated with some code and that code is important.
00:46:15If you delete it, I think it comes back.
00:46:17Yeah.
00:46:18If I save the file, it comes back.
00:46:20You have your route component here.
00:46:21That's obviously where your, guess what component, your markup goes.
00:46:25And then you have this create file route thing here.
00:46:27And here you can add stuff like a loader to fetch data that should be fetched before the
00:46:31route loads.
00:46:32You can do before load.
00:46:34That is where you could, for example, that is a function where you could check for user
00:46:38authentication before the route even loads and stuff like that.
00:46:42And in Next.js, that will be different.
00:46:45There you have nothing in that file right now.
00:46:47And there instead you, the components you set up in there in these route files are React
00:46:54server components.
00:46:55So they're rendered on the server and you can fetch data inside of the components because
00:47:00they're guaranteed to only run on the server.
00:47:03And yet, unless you add use client at the top of the file, which I don't.
00:47:07In TanStack start, we're not dealing with React server components, at least not right now.
00:47:12Server components are coming, but to me, at least it's not clear yet how they will be implemented.
00:47:17But these route files don't give you server components.
00:47:20So this component here will be pre-rendered on the server for every request, but it also
00:47:26then re-renders on the client.
00:47:28So it's not guaranteed to run on the server.
00:47:30And that's why in TanStack start, we don't put any server code into our component functions
00:47:35and why we instead have this loader pattern, which you might also know from React router,
00:47:39for example.
00:47:40So just to get that out of the way.
00:47:42So in my nice comparison here, I guess one thing we could add is the data fetching part
00:47:49there for Next.js, we have RSC.
00:47:55So we can use React server components, we can fetch right in the component.
00:47:58For TanStack start, we have normal components plus this loader pattern, or you could use
00:48:05useEffect, you can use TanStack query, of course, but that is how that would look like or work.
00:48:12Yeah, so that's that.
00:48:16I am adding a database.
00:48:18I'm using SQLite as a database.
00:48:20I got my database code here.
00:48:22I guess I can get rid of the auth tables now here in the Next.js app because we're not adding
00:48:27auth because something's broken about the better auth package in conjunction with TanStack start.
00:48:31So yeah, we'll do it like this.
00:48:33Okay, long story short.
00:48:35Now it's time to let AI do some work again, because now I wanted to generate some dummy
00:48:41pages.
00:48:42So I'll say, this is by the way, the TanStack app now.
00:48:45We're building a note taking app using TanStack start.
00:48:50We need a /notes page in, and then I'll just point it at this index file here in the notes
00:49:00folder, set up some dummy page there that loads notes from the DB and renders a list of notes
00:49:12in a beautiful design.
00:49:14We'll see what AI gives us here.
00:49:19This should be links that take us to the note ID file route, look up the TanStack start docs
00:49:33to learn how to use loader.
00:49:35So I'm pointing the AI that I want to use loader.
00:49:38I'm doing agentic engineering here.
00:49:40I'm not wipe coding.
00:49:41I'm telling the AI that I want to use this loader feature and I'll tell it to use the
00:49:47context seven MCP or web search to look up the docs.
00:49:51Also explore the docs for other concepts you might need.
00:49:56We use Tailwind for styling.
00:49:58Okay.
00:49:59So that's my prompt here.
00:50:01I'll let it create a plan.
00:50:03And then here in the Next.js project, I'll send the same, but of course here we're building
00:50:08this with Next.js and we don't have an index file here instead here in this route, it's
00:50:16my notes page TSX file that will render the notes.
00:50:21I have my database file here of course.
00:50:25And I want to go to the whoops, to the page TSX file in the note ID folder for the details.
00:50:35Look up the Next.js docs to learn how to use, how to learn how to fetch data in a RSC.
00:50:42Okay, and that should hopefully do the trick and let's see what AI gives us.
00:50:53For the design Gemini may be better.
00:50:55That is possible.
00:50:56I hope Opus will give us something decent here, but we'll see.
00:50:59Now for the plan, that's the 10 stack app here, a loader pattern, use loader data that looks
00:51:06good.
00:51:07So it wants to add a note server TS file with a get notes, create server function.
00:51:13That's good.
00:51:14That is in 10 stack start.
00:51:16I said that there are no react server components in 10 stack start, but that components would
00:51:20be pre-rendered and that you can use the loader for fetching data.
00:51:24That is actually only part of the truth because you can add loader, but this loader, this loader
00:51:31function, which you define here will actually run on both the server side and the client
00:51:36side because the page can update on the client side.
00:51:39That means that for data fetching, it's kind of bad if you want to put your database code
00:51:45into the loader function, because that can't really run on the client side because we're
00:51:50using bun, which is not available in the browser.
00:51:52And we wouldn't want it to run on the client side because we don't want to expose credentials
00:51:56if we had a database with credentials and so on.
00:51:59So the loader is only a part of the data fetching puzzle.
00:52:02The other part is that 10 stack start has server functions and server functions are functions
00:52:11that are created with help of the create server function function.
00:52:16That's a lot of functions by 10 stack.
00:52:19So you create a function by putting it into this handler here essentially.
00:52:23And then this code is guaranteed to only run on the server, even if you call it from inside
00:52:28a loader.
00:52:29So if I create a server function with create server function, and I then call this function
00:52:34here in a loader, then this function will be ignored, not ignored on the client side,
00:52:40but the code will only end up on the server side.
00:52:43And on the client side, 10 stack start will simply send the HTTP request to the server
00:52:48side, it will create an endpoint for me behind the scenes, so to say.
00:52:53And on the server side, it will just directly execute it.
00:52:55So it will guarantee that the code in here will run on the server side.
00:52:59That's why it's good that in this plan, the AI correctly researched that we want to use
00:53:05create server function for our database code using our database handler, which uses BUN.
00:53:12And then it wants to use a loader.
00:53:14It mentioned that somewhere here.
00:53:16So that is looking good, I think, seed some dummy data.
00:53:20I don't want that.
00:53:21I'll delete that.
00:53:24And yeah, let's build this.
00:53:26Looks good.
00:53:27For Next.js, we have the nodes file here.
00:53:31We are in a server component.
00:53:34So it creates a helper function, get nodes.
00:53:38And then in the component, it calls that.
00:53:41And in Next.js, we can do that for the reasons I mentioned, and then output this because this
00:53:46React server component will only be executed on the server.
00:53:49So let's do that too.
00:53:56If wanting to try out new AI stuff, would you recommend starting out with Cloud Code
00:54:01or Cursor?
00:54:05Depends on your level of knowledge, I would probably go with Cursor because it's an IDE
00:54:10and Cloud Code is a command line tool only.
00:54:12And depending on your experience with command line tools, that can be overwhelming at first.
00:54:17You don't know the shortcuts and so on.
00:54:20So I think Cursor might be a bit easier there.
00:54:26Which one is better?
00:54:27Again, I did answer and you won't get a better answer from me than there is no better one.
00:54:35It comes down to preference.
00:54:37Both are amazing.
00:54:38Next.js is better if you want the richer ecosystem, if you want the framework with more jobs, if
00:54:45you want the more established framework because Next.js is older and has a bigger ecosystem
00:54:50and has more jobs.
00:54:52It can be slow.
00:54:53The caching can be confusing.
00:54:55I mentioned before that the learning curve for Next.js, it's a bit easier to get started
00:55:01with and then it gets more complex.
00:55:03And for 10-stick start, I feel like it's the opposite.
00:55:06The learning curve is initially pretty steep, but it gets easier over time.
00:55:10But yeah, you won't hear a better or worse from me.
00:55:19So I would really encourage you to take a look at both and find your own favorite.
00:55:26So now the Next.js application is done.
00:55:32So if I go to my running application, to the notes page, I see no notes yet, which makes
00:55:40sense.
00:55:41And the sign is okay thus far.
00:55:43And how about 10-stack?
00:55:45It's also done.
00:55:47So let's see if I go to slash notes here.
00:55:51Yeah, that looks a bit more basic.
00:55:58What's what's wrong here?
00:56:03Let me move this.
00:56:06The 10-stack app here.
00:56:08I have an idea of what's wrong.
00:56:10Okay, my idea is wrong as it seems.
00:56:16Maybe beautiful dark theme with amber accents.
00:56:23I mean, there are styles here.
00:56:40They're not getting applied.
00:56:42So is Tailwind not being loaded?
00:56:48Oh, is this not using Tailwind?
00:56:54It used to use Tailwind by default, my bad.
00:56:57Did I create that in a different way because everything's going wrong suddenly?
00:57:04Okay, so I guess we'll just add Tailwind real quick.
00:57:1010-stack start Tailwind.
00:57:19Let's just quickly go through these steps here.
00:57:23Steps here.
00:57:24Yeah, I did not want to do that.
00:57:29Okay, so let's install bun install.
00:57:37Let's install Tailwind and add Tailwind plugin to the vid config.
00:57:49No, not the function declaration, I want the import.
00:57:58Let's import into the CSS file.
00:58:07So into styles, okay, and we are importing styles into root.
00:58:17So I think that should be it.
00:58:19If we now go back, oh, if I restart the dev server, of course.
00:58:28That's up and running again.
00:58:30Okay, now that looks better.
00:58:31Okay, an interesting choice.
00:58:34And to be honest, I'm not hating it, that it looks different than all the other AI apps.
00:58:40So yeah, fine by me.
00:58:43Now, I want AI to also work on the header.
00:58:47So let me bring that back over so that you can see it in the same chat as before.
00:58:55Please update the header, both the styling and the items.
00:59:03For now, only nodes will add more later.
00:59:11Got a typo, but I think it will be fine.
00:59:15And now, sorry for all the switching, by the way, I know it can be annoying.
00:59:20But here for an Excel, I'll say please add a header that has only the nodes route for
00:59:27now.
00:59:28Okay, so we'll do that.
00:59:36Difference of 10-stack-start, 10-stack-router, query.
00:59:5510-stack-start is the full stack framework for React, an alternative to Next.js.
01:00:0010-stack-router is just the router, which you can use in a single page application.
01:00:05So you could use it instead of React router, for example.
01:00:10The difference is that 10-stack-start, for example, gives you this server function thing,
01:00:14which is not in 10-stack-router.
01:00:16Basically, 10-stack-start gives you all the server-side stuff.
01:00:20That makes it full stack.
01:00:2110-stack-router is 10-stack-start minus the server-side stuff you could say.
01:00:2810-stack-query is a library for fetching data, for replacing useEffect, for data fetching.
01:00:35You can use 10-stack-query with 10-stack-start, but you don't have to because when using 10-stack-start,
01:00:42you can use that loader, which I mentioned before.
01:00:45But if you wanted to pull for data, fetch data every second or so, you could do that with
01:00:5210-stack-query.
01:00:53You can use that.
01:00:54It's a data fetching library.
01:00:55You can use it totally without 10-stack-start in any React project, also without 10-stack-router,
01:01:00but you can also use it with those libraries.
01:01:02So I hope that helps.
01:01:12For a licensed project, what do I choose?
01:01:14Next or 10-stack-start?
01:01:15I had a Turbo Pack.
01:01:16Well, I would probably go with Next if it's any commercial project or anything like that
01:01:22and you don't feel like getting into this brand new framework, 10-stack-start, which
01:01:27is not even stable yet, to put it like this.
01:01:30But I will say my experience with 10-stack-start, even though it may seem a bit different today,
01:01:34but my experience with it has been pretty good.
01:01:37So I would use it for production applications any day, but I don't want to recommend that
01:01:43to anybody else who then might be frustrated that some things might still be buggy or not
01:01:47work the way you want them to work.
01:01:52The Hono framework, by the way, I know.
01:01:56I'm not sure if I'll make a course on it, but I think Hono is a pretty cool BUN framework.
01:02:02Makes building REST APIs, for example, with BUN really, really enjoyable.
01:02:11Waiting for the Laravel course.
01:02:12By the way, many thanks for all the kind messages, reading them all.
01:02:19So thank you so, so much.
01:02:22And regarding a Laravel course, not planned, Golang course, I have.
01:02:29What operating system am I using?
01:02:31I'm using macOS.
01:02:33I have not used Linux as a main system in many, many years.
01:02:36I would like to give it a try again, but then again, I don't really have time for it.
01:02:40So yeah.
01:02:42But yeah, just macOS it is.
01:02:46Okay.
01:02:48So back to the apps.
01:02:51Now we have our Tanstag app here and the Next.js app.
01:02:59Now as the next step, of course, we want to make sure that we can add notes.
01:03:03And for that, I'll try to use Tiptap because I want to have a rich text editor.
01:03:10Tiptap in case you don't know, is exactly that.
01:03:14It's a library that makes building rich text editors in your web apps a breeze.
01:03:19It supports all kinds of frameworks and libraries.
01:03:22You can also use it with vanilla JavaScript and therefore in the end you can use it in
01:03:26any project, but of course you can also use it with React and you can build editors like
01:03:30this.
01:03:31So I can go back to my interactive here and you see, I can make things bold, strikethrough.
01:03:37So we have this rich text editor and behind the scenes as an output, what we get is JSON
01:03:45in the end.
01:03:46So the user sees the rich text editor and can interact with it as it can with Microsoft
01:03:52Word.
01:03:53But we, as a developer, we get some JSON output, which we can store in the database and then
01:03:58render in any way we want.
01:04:03That is how it works.
01:04:06So yeah, that is essentially the format we get as a developer.
01:04:09That is what we get from the user's input.
01:04:12And that is what we can store in the database, for example.
01:04:15And then we can write our own logic to render this as React components.
01:04:20And I want to build a rich text editor with Tiptap.
01:04:27And therefore first we'll install it.
01:04:36So I will run this install command here to install the React library.
01:04:43ProseMirror is basically a library Tiptap is using under the hood.
01:04:47And the starter kit, so that we can easily add these basic rich text styling options
01:04:54like bold, italic, and so on.
01:04:58So what I'll do here in my TanStack project, I'll run bun install, copy this and run it
01:05:11here.
01:05:12And then in the next project, I'll do the same.
01:05:19Install that and then spin up the dev server again, also of course here in TanStack start.
01:05:25That's the first step.
01:05:26The next step is to actually integrate it.
01:05:28And the cool thing is we can use hooks and components from the Tiptap package to add that
01:05:34editor.
01:05:35But I will try to let AI do that and we'll see if that works.
01:05:40I've done it before.
01:05:41It worked.
01:05:42So that of course means it will probably not work today.
01:05:44This is the TanStack application and so we're building a notes taking app.
01:05:50I now want you to add a rich text editor built with Tiptap already installed in the editor
01:06:03route.
01:06:07Here are the React Tiptap quickstart docs to kind of point it into the right direction.
01:06:20Tiptap React.
01:06:22I like to use these XML tags here.
01:06:25Not sure if they really help that much.
01:06:28Also use context seven and web search to do more research on the Tiptap and TanStack start
01:06:42docs to correctly implement this editor into this app.
01:06:48So I'll again let it make a plan.
01:06:52And then the same here for Next.js though of course here it's in the editor page route
01:07:01Tiptap docs and here of course it's Next.js so we want to point it at that and also let
01:07:11it make a plan.
01:07:12And with that it should hopefully be able to generate something meaningful.
01:07:17Hey Max just wanted to thank you for all the educational content.
01:07:23A lot of it has helped me immensely.
01:07:26Hope you have a great day.
01:07:27Thank you so much.
01:07:28And again thank you all so much.
01:07:29So many kind messages means a lot to me.
01:07:33So yeah thank you so so much.
01:07:43Reading some comments about Turbo Pack here indeed Next.js used to be super slow in development
01:07:48with Turbo.
01:07:50It's faster in my experience.
01:07:53It was really horrible with Webpack in the past.
01:07:57In bigger apps or even medium sized apps it was super slow.
01:08:03Does Tiptap support React 17?
01:08:05I don't know.
01:08:06It works with the latest version.
01:08:07If it works with older versions I'm not sure.
01:08:10I wouldn't bet on it.
01:08:13What are Context 7 and Context 6?
01:08:15Context 7 is an MCP.
01:08:18Context 7 is an MCP you can add to your AI tools.
01:08:21I added Cursor and it's essentially an MCP that exposes a tool to the AI that allows it
01:08:27to easily search documentation for all kinds of libraries.
01:08:32So it makes it a bit easier for the AI to find the documentation for TansTechStart and stuff
01:08:36like that.
01:08:38So here it for example did some research using Context 7 on Tiptap component menus as it seems.
01:08:46And this extra context of course helps reduce the danger of the AI hallucinating.
01:08:51So let's take a look at the plan.
01:08:53This one, this is the, what is this, this is the TansTech application.
01:08:58So the plan is we need to handle Tiptap properly, yeah, we must do it on the client side.
01:09:09Optionally wrap, yeah, I think we should do that, wrap with TansTech.
01:09:18I actually don't know if Tiptap is, how does it work with server-side rendering?
01:09:29You need to use immediately render option and set it to false.
01:09:32Okay, so that is in line with what the AI got from the docs, which makes sense because I
01:09:37shared that article with it.
01:09:40Features to include, bold, italic, strike, heading, code in line, sounds good, yeah, that
01:09:46sounds good, styling, okay, yeah, looks like a good plan, let's do that.
01:09:53So that's working and now for Next.js here, also immediately render false, yep, use client,
01:10:06we need that for Next.js because Tiptap is of course happening on the client side.
01:10:14This entire editor is about the client, the user interacting with it, so that must be
01:10:19a client-side component here because we're using a hook and we can't use hooks in React
01:10:26Server Components, so that also looks good, let's start building here too.
01:10:32So the AI is now working in both applications, giving me some time to look at the chat.
01:10:41The cursor theme I'm using here, what's my theme, that's a good question.
01:10:45That's catpuchin mocha, I think it's an extra theme I installed from the extension store.
01:10:54What do you think about Elysia.js?
01:11:00Looks interesting, haven't used it.
01:11:02I'm a big fan of BUN frameworks like Hano and Hano can actually also be used with Node.js,
01:11:09but it works particularly well with BUN and I think the same is probably true for Elysia.
01:11:13I will say the docs are beautiful.
01:11:17It's on the long list of things I would like to explore.
01:11:19There's just so much stuff on it that times the main issue.
01:11:26Since Udemy is merging, will the courses purchased on Udemy remain available lifetime or do we
01:11:31need to pay?
01:11:32I have no idea.
01:11:33I don't work at Udemy and unfortunately I have no other information than everybody else
01:11:37has.
01:11:38I would love to have more and I would share it, but I don't.
01:11:43Been learning from you Udemy days, literally learned React from you, which is my bread and
01:11:47butter.
01:11:48Many thanks, Max.
01:11:49Many thanks to you.
01:11:50And as always, or as I said before, all of you here, so many nice messages.
01:11:53I'm not just saying it, it does mean a lot to me.
01:11:56Reading all that is so, so amazing and you're all amazing.
01:11:59So thank you so, so much.
01:12:01What about C# or Java Udemy course, do you have a plan for that?
01:12:05If anything C#, it's been, I guess, 15 years, 12 years since I last worked with Java.
01:12:16But it's not planned, the C# course is also not planned for the near future.
01:12:21What kind of apps do you think should a dev build nowadays to add value to the resume?
01:12:28I mean, stuff like e-commerce apps and so on are always good.
01:12:32And now with all the AI stuff, of course, building AI wrappers, image generation apps, maybe chat
01:12:39bots where users can add their own knowledge bases and sources, stuff like that, I think
01:12:45can also be interesting apps to build nowadays.
01:12:48Okay, so we're done here.
01:12:53This is the TanStack app here.
01:12:57And we can see that in this index.tsx file, the /editor page, it added a bunch of imports,
01:13:07added a check if the editor is set up.
01:13:09If it's not set up, it's showing some fallback here.
01:13:14And then we got a bunch of functions for handling the user interacting with the toolbar, I guess.
01:13:20And then here it has a toolbar, which it renders, and then it has the editor certainly somewhere.
01:13:28Here's the editor.
01:13:29Yeah.
01:13:30Okay, so that I think looks good.
01:13:36Added some styles too.
01:13:38And for Next.js, it's also done here.
01:13:43Also the tiptap editor is a new component it built.
01:13:46We got a type error in there, is possibly null, if not editor return null.
01:13:53So why?
01:13:54We should never reach this point here.
01:13:59I guess technically the way functions are handled.
01:14:06So yeah, I'll just quickly...
01:14:14I mean, probably this actually, these functions will never get called if the editor is null,
01:14:20but I'll fix it like this.
01:14:23Okay.
01:14:25Let's take a look, shall we?
01:14:31A button to go there would be nice.
01:14:33Also add a button to the header, or actually a link of course, to the notes page to go to
01:14:46the editor to add a new note.
01:14:49And I could add it myself.
01:14:50I just ask the AI because I want to have a nice looking button and I don't want to type
01:14:55the styling code myself here.
01:14:58Cursor versus anti-gravity, which one is your choice?
01:15:01I only played with anti-gravity when it was released.
01:15:05And back then it was pretty buggy.
01:15:07I'm happy with Cursor.
01:15:08I'm also using Claude code a lot on other projects.
01:15:12So I haven't visited or I haven't taken another look at anti-gravity.
01:15:20Yeah.
01:15:23So this here is the Next.js app.
01:15:28This is the TanStack app, Next.js new note.
01:15:32That's my editor, TanStack got a brief error flashing there.
01:15:39Okay.
01:15:40Probably just a dev server reloading.
01:15:41That's the editor here.
01:15:45Next I'll say make the editor taller.
01:15:50Right now it's just one line.
01:15:55I'd like it to fix that.
01:16:00I will say I don't hate the styling it found here for TanStack.
01:16:06It does not look like the typical AI apps, which is quite nice.
01:16:09Okay.
01:16:10Now the editor is bigger here too.
01:16:12So now let's see, this is a test.
01:16:15Let's make this a header.
01:16:17Does this work?
01:16:18Make this bold.
01:16:20This is italic.
01:16:23So that works and then let's add some, some codes like script, script const a equals max
01:16:34and let's paste this over here.
01:16:37Yep.
01:16:39So looks like the editor is working.
01:16:41The next question is if we can save that.
01:16:45Is this live stream going to be saved?
01:16:46Yes, it is by the way.
01:16:47And also I'll come back to the other questions.
01:16:49No worries.
01:16:50The live stream will stay online on this channel.
01:16:52In the past, I used to upload it to another channel, but now it will just stay here.
01:16:57Okay.
01:16:58So now next step is we want to save that to the database.
01:17:03And for doing that, before we implement it, let's again, take a look at the docs.
01:17:11With TanStacks, because this is about comparing the two, right?
01:17:14And we saw how data is loaded.
01:17:16I explained that.
01:17:17Now, how are we going to save data?
01:17:19With TanStack start, I mentioned before, we have these server functions, which we create
01:17:25with create server function.
01:17:27We can use them in a loader, as I explained before, to load data, but we can also use them
01:17:32to store data because these server functions cannot just be called in the loader.
01:17:36You can call them from anywhere, essentially.
01:17:39You can also call them from inside your event handlers.
01:17:43So in my TanStack application on the editor page, we could add a safe or a handle safe
01:17:58function here, and then probably do some validation that the editor is not empty, for example.
01:18:07And then thereafter, we can call a server function.
01:18:10So let me switch the sidebar position again so that we can work on the file system here.
01:18:21We can add, we have our nodes server TS file here already.
01:18:27Let me actually accept all these changes.
01:18:30We got the node server file where we have this get nodes function.
01:18:34Now, of course, we can also export a create node function and this suggestion looks good,
01:18:42I guess, though I will change it a bit.
01:18:44That's not entirely correct.
01:18:47What you can do with those server functions is you can also validate.
01:18:52You can also validate.
01:18:55Here in documentation, we see it, we can use sort, for example, and we can use input validator,
01:19:01set up a sort schema and pass that to input validator.
01:19:05And that will then automatically throw an error and return it to the client side where we then
01:19:09can show an error message if validation fails.
01:19:12And otherwise, this data thing here, which is automatically received in the handler function,
01:19:18which is the actual code that will run on the server, will have this shape.
01:19:22So we get automatic type inference here.
01:19:25Yeah, so that's what we can do.
01:19:28For that, of course, I need to add sort as a first step here in this Tanstech start application.
01:19:35And then I'll import C and I'll set up my node schema.
01:19:40And yeah, I want to have a title and a content.
01:19:44Kind of doesn't make sense to define it here as well.
01:19:49But I'll keep it for fetching the nodes here.
01:19:51And then we add input validator and we can pass our node schema here and the validation
01:19:58will be handled automatically, as I mentioned.
01:20:00And then here we actually destructure data and that will then be an object of that shape,
01:20:06which is pretty convenient.
01:20:07And then we can insert this into the nodes table in my DBTS file.
01:20:17I'm creating this nodes table.
01:20:19The ID will be set automatically, by the way, this is technically not needed for SQLite.
01:20:23It will automatically increment anyways.
01:20:25But yeah, this is the shape.
01:20:26It wants title and content.
01:20:28Content is this JSON and JSON of course is just text, so we can store this.
01:20:33And we store the JSON here, which is this string.
01:20:39That's the idea.
01:20:42We could be a bit more elaborate on the schema here, but this should be fine.
01:20:47So that should allow us to store this and that's how we do it in TAN stake start.
01:20:53Now for Next.js, that of course is different.
01:20:58In Next.js, when we want to mutate data, we can use server functions.
01:21:04Server functions are a react feature, but technically a react feature that's mostly available in
01:21:09Next.js to this day.
01:21:12And these are functions that have use server inside of them, this directive.
01:21:18Or you put use server at the top of a file and then all the functions in that file become
01:21:22server functions.
01:21:23And the special thing about server functions is that even if you define them in a component
01:21:29or if you call them from inside a component, even if it's a client component marked with
01:21:33use client, the code in this function will only run on the server.
01:21:38Just as the code in here in this server function in TAN stack.
01:21:42In both cases, we got code that only runs on the server.
01:21:45And in both cases, we can call them from the client side and behind the scenes, the framework
01:21:49will do some magic and will basically send the request to the server.
01:21:58It will create an endpoint on the server and send the request for us.
01:22:02So data mutations are handled with react server functions in the case of react.
01:22:15And here it's just server functions, TAN stack server functions, not the official react ones.
01:22:23So that's maybe important for here.
01:22:26We need to use server directive, right?
01:22:29Because we're dealing with react server functions.
01:22:31And here we need nothing of that kind because that is really just this server function concept
01:22:38of TAN stack start.
01:22:40So that's that.
01:22:43With that out of the way, I'll copy this page.
01:22:46And again, let AI help me a little bit here.
01:22:50Bring that over to the other side so that you can see it and you chat.
01:22:58This is the TAN stack app.
01:23:00So I'll say we're building and I could also create some rule files so that I don't have
01:23:05to repeat that all the time, but I'll just do it here.
01:23:07We're building a note taking app with TAN stack start.
01:23:13And now we want to make sure notes can be saved from the editor page.
01:23:23Use server functions as describe server functions.
01:23:27I actually created one already.
01:23:29See notes server and also see official docs, TAN stack docs here, TAN stack docs.
01:23:42Also use context seven and web search for further docs lookup.
01:23:49Make sure to handle validation errors on the client, including errors from the server side
01:23:59and show an appropriate message after success redirect to the notes page.
01:24:11So that's, I'll let it make a plan.
01:24:13And now for next JS, I'll copy in the same prompt.
01:24:17But of course here we're using next JS.
01:24:22And the route is the, the editor page use server, use react or a functions.
01:24:33And therefore, of course, I'll delete that explore the react and next JS docs via context
01:24:42seven and web search to understand how to do that.
01:24:49Make sure to handle validation.
01:24:53Yeah.
01:24:54And let it make a plan.
01:24:55So time for some questions.
01:24:58How to stay motivated and programming while being unemployed because I feel bad after not
01:25:03program anything for weeks.
01:25:05Well, obviously a horrible situation regarding the motivation part.
01:25:12I think the only thing you can do if you don't want to leave the programming sector of course
01:25:18is build projects for your resume.
01:25:21Take the time to dive into new technologies, build stuff with AI, with help of AI, learn
01:25:26how to get good at using AI like cursor, cloud code, whatever it is.
01:25:32Because these are skills that ultimately will probably be important for, for finding a job.
01:25:37That's all I can say for that, I guess.
01:25:45If you had to use only one between cursor and cloud code for a production grade project,
01:25:49which one would it be?
01:25:51I think it would be cursor because I prefer having an IDE, but it's super, super close.
01:26:00Yeah.
01:26:01But probably cursor then.
01:26:07I have a new project.
01:26:08What should I use next JS or tan stack?
01:26:10I already have a Golang backend.
01:26:12If you already have a backend and you just need a front end, I would probably just build
01:26:15a single page application with react and wheat, for example, and then add routing with react
01:26:20router or 10 stick router.
01:26:22Having a full stick app with next JS or 10 stick start does not make a lot of sense if
01:26:27you already have a backend rest API, I would say.
01:26:32Just want to say thank you for the reactful course helped me a lot build my foundation
01:26:36front end web.
01:26:38Thank you so much.
01:26:39Thank you so much.
01:26:40I'm super, super happy the react course was helpful.
01:26:42It means a lot to me.
01:26:43Thank you so very much.
01:26:46Your course was insanely helpful.
01:26:48Yeah.
01:26:49And thank you too, Mirko Masa and Buzzy.
01:26:52Thank you both so, so much.
01:26:54Do you feel dumb since starting AI?
01:26:56No, but I will say it's gotten better.
01:27:01I used to be in a situation where I tended to use AI too much to the point where I had
01:27:09entire projects where I didn't really understand the code base.
01:27:12And that's the part where, yeah, you could feel dumb.
01:27:16You don't understand the code base and you feel your skills kind of disappear slowly.
01:27:21And now I think I got a good mixture of steering AI, letting it do its thing, but planning ahead,
01:27:28reviewing the code, writing some snippets myself.
01:27:31And I think that is, there's a good path that works out pretty well for me.
01:27:35So yeah, thank you so much everybody for, for the nice messages.
01:27:38Okay, let's take a look at the, the plan.
01:27:42This is the next application here.
01:27:47I mean, these charts are always nice.
01:27:49I don't spend too much time looking at them, but let's see client component, form action,
01:27:54server action, validate, show an error message if invalid, otherwise SQLite database redirect
01:27:59looks good.
01:28:03Make node function in the libdbts.
01:28:10Okay.
01:28:13Yeah.
01:28:15And then it creates a separate server action in an actions TS file.
01:28:20Okay.
01:28:22And then it plans on using use action state.
01:28:26That's okay.
01:28:27That's good.
01:28:28Yeah.
01:28:29So it's a hook by react.
01:28:30It's handling form submissions and validation.
01:28:36Use action state used to be called use form state but, but it's a hook that's built into
01:28:41react and that you can use with server actions, a server function.
01:28:45So I like that.
01:28:46Yeah, I think that looks good.
01:28:50Let's build it.
01:28:51And now for tan stack no title input.
01:28:56Yes, it's right.
01:28:58We have no title input yet.
01:28:59I didn't check if it is asking for a title in next chess.
01:29:02We'll see.
01:29:04We have a server function, so it will use that.
01:29:07It will store the title separately from a separate input field.
01:29:10That's fine.
01:29:11Error, save button.
01:29:13So a lot of manual state handling here.
01:29:16We could be using 10 stick query here, for example, also for mutations.
01:29:23But then it uses use server function, which is good because that is something you learn
01:29:32in the 10 stick docs, the 10 stick start docs that you can prepare a server function for
01:29:40being called from a component by wrapping it with use server function, which is a hook provided
01:29:45by 10 stick start, so I like that it picked that up.
01:29:55Error handling and redirects.
01:29:59Server functions can throw errors that are handled automatically when called from route
01:30:02lifecycles or components using use server functions.
01:30:06I did not want to highlight that.
01:30:13Okay.
01:30:14So if we can throw a redirect, then that should be picked up automatically.
01:30:18And is it planning to use that?
01:30:21No.
01:30:23It plans on navigating manually.
01:30:27So maybe we should just point it at that.
01:30:31Let's say embrace 10 stick starts built in, built in redirection capabilities, C docs,
01:30:44then I'll paste this and we'll see if it adjusts its plan.
01:30:48But other than that, this is looking good.
01:30:50I think we can definitely do it like this.
01:30:54Handle save managing a bunch of state here and then ultimately redirecting would do the
01:30:59job.
01:31:01But now it's revising the plan.
01:31:04We'll see how it changes it.
01:31:15I think it now plans to redirect in the server function.
01:31:20Yep.
01:31:22Throw redirect.
01:31:25Redirect handled by server function.
01:31:27Okay.
01:31:29So let's build this and let's see if it works.
01:31:32The next JS app is already done, but first some questions and comments.
01:31:41Where was I?
01:31:46TypeScript course was helpful for me.
01:31:47Love from Bangladesh.
01:31:48Thank you so much HasGaming.
01:31:50Super happy to hear the course was helpful.
01:31:53Thank you all so much as always.
01:31:55Should we use junior developers?
01:31:57Should we use as junior developers?
01:32:00Use tools like VS code to enhance our skills instead of wipe coding.
01:32:04You should definitely not wipe code.
01:32:06I think wipe coding is really, really bad, especially if you're in a less experienced
01:32:13developer because you learn nothing about the code.
01:32:16Even if you're not just wipe coding, you're not learning a lot.
01:32:20So you really have to be disciplined to go into the code, to go into the docs, to learn
01:32:25stuff on your own still.
01:32:27And with wipe coding, the danger of not learning anything is definitely high.
01:32:31Greetings from Brazil.
01:32:32Learned a lot from your Angular course in 2020.
01:32:35Thank you so much.
01:32:36Happy to hear you learned a lot from that.
01:32:38I'm starting React now.
01:32:39I have about five months of free time.
01:32:41Should I accept the job in the meantime as a junior web dev?
01:32:45Well, I think if you can get a job right now as a junior web dev, that is a good thing because
01:32:49it's really hard.
01:32:50So if you have an offer, I would definitely consider taking it.
01:32:53Yeah.
01:32:54If I would start learning programming today, where would I go?
01:32:57Maybe DevOps, web dev, cybersecurity, definitely an important topic, especially with all the
01:33:01AI code that's being generated, I would argue.
01:33:09But ultimately you have to go with what's interesting to you.
01:33:11DevOps, strong field, web dev has seen better days for sure.
01:33:16At the same time, web dev is the thing where you can build amazing applications and instantly
01:33:21see something.
01:33:22Now with AI, there are more opportunities there than ever.
01:33:28I would go with what's most interesting to you.
01:33:33The best chances might have cybersecurity, but then again, that's not my strong field.
01:33:37So I might be wrong here.
01:33:39Academy subscription has the same update frequency.
01:33:42What additional things will I get?
01:33:46The update frequency is the same.
01:33:47If we release an update on Udemy, you of course also get it into the subscription.
01:33:51There are some exclusive courses in subscription like the data structure algorithm courses.
01:33:55And of course the subscription gives you instant access to the entire catalog as long as you
01:33:59have the active subscription and you don't have to buy every course you're interested
01:34:02in manually.
01:34:06And of course with all the Udemy developments, there might be more exclusive stuff in the
01:34:09future.
01:34:12So that's definitely also something that might happen.
01:34:20As my mindset is true, Next.js should only be used if you want great SEO.
01:34:25I don't want to use Next.js for full-stack apps.
01:34:28If you want SEO, if you just need SEO for like a marketing page, I would also consider
01:34:33using Astro.js by the way, which is a pretty amazing framework for static sites or for content-heavy
01:34:41sites.
01:34:42I would consider that too.
01:34:43But yeah, if you're building a site that does not need server-side rendering, for example,
01:34:48then there is no reason or then you could definitely consider not using Next.js.
01:34:54You can just use React with React router and so on.
01:34:58Yeah.
01:34:59Okay.
01:35:00Yeah.
01:35:01Let's take a look, shall we?
01:35:03I think Tanstech is also done.
01:35:05Yep.
01:35:06And we'll see if it works.
01:35:07So this is the Next.js application.
01:35:09So this is a test.
01:35:11This is a test.
01:35:18And let's also add some code, some made-up code.
01:35:27And this is a short test article.
01:35:31This is bold and some inline code.
01:35:43Okay.
01:35:47Let's copy that.
01:35:48Let's click save.
01:35:49We're redirected.
01:35:50Here's my note.
01:35:51Viewing it doesn't work yet.
01:35:52We'll handle this later because I haven't implemented the page yet.
01:35:56Now for Tanstech start, test, save.
01:36:04Notes title.
01:36:06Well, this sounds like a job for AI.
01:36:11Getting this error.
01:36:12Is this the Tanstech app?
01:36:13Yeah.
01:36:14Getting this error when trying to save.
01:36:21I think it might already have a note.
01:36:25This is a not null constraint error.
01:36:27It looks like it already has a note with that title.
01:36:37Or not.
01:36:38We'll see.
01:36:40Okay.
01:36:43Now this works.
01:36:47Remove all the dummy notes, please.
01:36:50And of course I want to test if I can also store richer documents.
01:36:58So once it's done removing those dummy documents here, I mean, that's kind of the annoying part
01:37:07that it decided to add some to the database.
01:37:09The good thing is that since it's a SQLite database we can simply go to the database file
01:37:20and delete it.
01:37:23If I find it, where is the notes DB?
01:37:34Where is my, here it is.
01:37:39So we can delete that and just restart the dev server to be safe.
01:37:46And now create a new note test.
01:37:49This is a test.
01:37:51Let's make this a heading.
01:37:53This is bold, some code, script, script const name equals max.
01:38:05Save this.
01:38:06Okay.
01:38:07So that's working.
01:38:08Now of course I want to have the detail pages too.
01:38:09So the way this works is I said it before in Tanstech start, you have dynamic path segments
01:38:16by adding this dollar sign here so that we can have like a note ID as the actual element
01:38:21in the URL.
01:38:22And then this route will get loaded.
01:38:24And in there we now want to fetch the data for that ID.
01:38:28So again, just as before, we can create a server function and then use the loader to load that
01:38:34note.
01:38:36And for Next.js, we have dynamic path segments with those square brackets.
01:38:42And then we can, we're building React server components so we can fetch from right inside
01:38:46of them.
01:38:47So therefore, I'll open a new chat and so we're building, that's the Next.js app now.
01:38:54We're building a note taking app.
01:38:57We now need to implement the note detail page.
01:39:01And that is the, this one, yeah, use the RSC to fetch the note with the loaded ID.
01:39:14Use context seven and web search to explore Next.js docs to learn how to best fetch data.
01:39:22Important, we're using TipTap as a rich editor, look up it's JSON schema, i.e. how user entered
01:39:39content is stored via context seven web search.
01:39:49And you don't need to add that all the time, by the way, this is just increasing the chances
01:39:54that the AI will look it up.
01:39:57And render the content in a nice way using JSX and proper CSS styling tailwind.
01:40:08Okay, so that's my prompt for the AI here.
01:40:19And then here in the TanStack app, I'll paste in the same, but of course, this is now the,
01:40:26this page here.
01:40:28We're building it with TanStack start and then use a server function and the loader to fetch
01:40:40the note C and I wanted to take a look at the other route and the official TanStack start
01:40:49docs for that.
01:40:51So yeah, this we're using TipTap and let's go, okay, questions.
01:41:03I'm creating social media website for past six months, but I didn't choose React since
01:41:06AI said it's heavy.
01:41:08Yeah, React of course, you're always loading in the React library.
01:41:13If you're using something like Next.js, you're loading that library in addition.
01:41:17And that's why I meant something like Astor.js, for example, gives you way more lightweight
01:41:22pages and therefore might be worth a look.
01:41:26How did I learn TanStack?
01:41:28Did you practice with projects manually first then use AI?
01:41:31Yeah, I practiced manually with documentation and projects and then brought AI into the mix
01:41:36essentially.
01:41:38And even when using AI, I mean here I'm kind of speeding it up a bit, but when using AI,
01:41:43what I often do is I go to the documentation, find the relevant context, the relevant articles
01:41:48myself, and paste them into the prompts.
01:41:51I'm just not doing this here to save some time since it should be able to do that with web
01:41:55search and context seven.
01:41:57But that also helps you with learning, of course, because when you find the right documentation
01:42:01yourself, you of course kind of read it or at least skim over it.
01:42:05And that also is better than nothing, I guess.
01:42:09Would you choose Go for any kind of coming new projects?
01:42:12I would choose it.
01:42:13I just don't have any projects where I will use it right now because for most of them it's
01:42:20easier for me to just build a full stack app with TanStack or Next.js since I use React.
01:42:27I can't just be very productive with that stack.
01:42:31If I had like a super performance critical application, I would absolutely consider Go
01:42:35for that too.
01:42:37Do you know about the state of QA with AI?
01:42:42Is it hot or is it cold?
01:42:45Quality assurance, that is, I guess.
01:42:49I can generate tests and be non-prod that's more acceptable.
01:42:55It's definitely an important thing.
01:42:57I mean, code reviewing is a super important skill also for the future, I guess.
01:43:03Writing good tests is in theory a good skill.
01:43:06I don't know how much it will be valued by employers because AI can generate tests and
01:43:11you have to be super careful with that.
01:43:13AI is good at writing tests.
01:43:15It's also good at writing tests that are fine-tuned for the code it wrote, which kind of defeats
01:43:21the purpose.
01:43:22Actually, writing good tests would be a very valuable skill, but I definitely see companies
01:43:29saying, "We don't need that.
01:43:31AI can do it."
01:43:32So that's why I'm not sure what the right answer there is, to be honest.
01:43:37What's the difference between Node and BUN?
01:43:39Both are runtimes that allow you to run JavaScript anywhere, including on the server.
01:43:44BUN tends to have better performance.
01:43:47They claim they do and benchmarks show it too.
01:43:50BUN has certain nice extra features built in, like the SQL client, the SQLite client I'm
01:43:57using here.
01:43:58I don't need to bring in an extra package.
01:44:00But Node.js got much better over the years, has many features like TypeScript support built
01:44:05in too, and of course has been around for longer, is not owned by Anthropic.
01:44:10So that might give you more stability or safety regarding the future.
01:44:17But yeah, I like using BUN a lot.
01:44:22Cloud Code Stream.
01:44:23Yeah, why not?
01:44:24Which plan purchase from Cursor?
01:44:26I have the $200 one because I'm using it a lot.
01:44:30And I recently, for example, released a big update for this AI for devs course I mentioned
01:44:36before.
01:44:40Or did I mention it?
01:44:41So this course here, which covers Cursor and GitHub Copilot.
01:44:44So I really need those tokens, so I have the $200 course.
01:44:50Why do you use the best but also most expensive model in this project?
01:44:54Because I wanted the best results, decreased the chances of messing up.
01:44:59And simply to be honest, because it's selected and between reading and planning ahead and
01:45:04trying to not mess things up, I just didn't look which model.
01:45:07But I probably would use it anyways, because it's a great model.
01:45:11I want great results.
01:45:15So saves content.
01:45:16We got a question.
01:45:17Saves content using get, you mentioned, tip tips.
01:45:20Oh, yeah, we're getting HTML.
01:45:29Let's go, Jason.
01:45:32And same.
01:45:35Let's do that.
01:45:36Maybe I'll regret it because now it'll mess up everything, but we'll see.
01:45:43How is the stream going?
01:45:44We had a rough start, I'd say, with some weird 10-stick start errors, which I of course didn't
01:45:49have before, but on stream we have them.
01:45:51But now I hope it's going well.
01:45:54I hope it's interesting.
01:45:55We're making progress.
01:45:56Almost done with the app and got a nice comparison going here, which hopefully is helpful and
01:46:01hopefully I was able to answer some questions.
01:46:02So yeah, I hope you're all liking the stream.
01:46:07I often use tests as kind of a documentation for the LLM.
01:46:09Yeah, and that is actually a pretty good way of using tests.
01:46:13I mean, test-driven development, where you write the tests first, can make even more sense
01:46:19with AI.
01:46:20Not saying that I'm doing it, to be very honest, because I never was into test-driven development,
01:46:26but mostly probably because I never properly learned it or used it, but in theory that of
01:46:34course is great.
01:46:35Because the more helpful context you can give AI, the more you can steer it, the better.
01:46:39Because AI definitely got better at writing code, but it also is pretty good at picking
01:46:46up what it already sees.
01:46:47And that's also why if you have some bad code in your project, if AI maybe went down a bad
01:46:54route, it can be hard to get out of that with just AI, because it keeps on seeing that bad
01:46:59code.
01:47:00And even if it tells you, "Oh, we should fix that," still in my experience at least, it
01:47:04kind of keeps on picking up that code.
01:47:07So the more context you can give it by adding your own code first, by adding functions, by
01:47:11providing good documentation links or snippets from the documentation, the higher the chances
01:47:17are of producing good results.
01:47:19That is my experience.
01:47:20Okay, so here it's still planning moves.
01:47:24Here it's also still planning moves.
01:47:26So we'll see what we get here.
01:47:28What about this comparison?
01:47:29Is there anything I should add?
01:47:33Data fetching, data mutations, ease of learning, the ecosystem.
01:47:36Oh, that one is wrong here.
01:47:38I explained why it's worse, but I didn't update it.
01:47:42Probably someone wrote this in the chat, but yeah, the ecosystem is absolutely better in
01:47:46Next.js of course.
01:47:51Maybe something like the stability could be interesting.
01:47:56That's kind of hard to judge, but in my experience, Next.js is relatively stable.
01:48:02It can just be pretty slow, but it's established.
01:48:06Yeah, I mean, with the app router, it's been quite buggy.
01:48:11It's gotten better.
01:48:12Maybe that's two pluses here.
01:48:14And for TanStack, it's difficult because obviously we had this huge weird error at the beginning.
01:48:22Not sure if it was TanStack or better auth or the combination or maybe me messing something
01:48:27up.
01:48:28It has been pretty stable for me, but I definitely had a bit more bugs with TanStack over the
01:48:35last weeks and months.
01:48:37But to be very fair, and I said it initially, TanStack's start is also still in release candidate
01:48:46phase.
01:48:47So it's not stable yet.
01:48:49So it's allowed to have bugs and that's important.
01:48:52I don't want to be unfair here.
01:48:55But I would probably say it's a bit less stable, but it's definitely not super unstable.
01:49:01And I have worked a lot with it over the last weeks, essentially without major problems.
01:49:06So yeah, maybe that's two pluses.
01:49:09This is three pluses here.
01:49:11I don't know.
01:49:13As I said before, this is all subjective here, but yeah, that's probably how I would judge
01:49:19it.
01:49:20Okay, so is my internet gone here or is cursor having some problems?
01:49:26Let's say, let's switch the model here maybe.
01:49:29Let's try continue or maybe I shouldn't use another anthropic model then.
01:49:39Let's try a GPT-5.2 and force.
01:49:43Now it's continuing.
01:49:44Okay, good.
01:49:49Have you tried asking to create technical implementation documentation, which includes all the codes?
01:49:53I'm working with a lot of technical implementation documentation and spec files.
01:49:59Not in this project arguably, but what I like to do is like brainstorm on them together
01:50:04with other tools like chatgpt or gemini so that I don't waste my tokens here.
01:50:09And then once I have a finished draft and I'm happy with it, I will put it into a project
01:50:14and let AI use that as an additional source.
01:50:17And these are all things I plan on sharing in future courses, whatever.
01:50:26So I want to use JSON and render that.
01:50:34And how about Next.js?
01:50:40Here I want to say switch from HTML to JSON just to make sure that it picked that up because
01:50:46I didn't see it here.
01:50:51Now it's updating the plan.
01:50:55Yeah, get JSON.
01:50:56That's what I want.
01:51:01Okay.
01:51:07It's doing a lot of updates here.
01:51:11It's doing more lookups.
01:51:16Do you think software quality will improve?
01:51:18Well, no, actually I created a video about that today inspired by a post by the cursor
01:51:27CEO.
01:51:28And I think software quality is really endangered to become worse now with LLMs because it definitely
01:51:39seems like less people care about it.
01:51:42And I mean, the trend has been downwards for the last 15 years, so I don't see it get better
01:51:47with large language models.
01:51:49Next.js image component was the simplest.
01:51:51Yeah, that is definitely an asset.
01:51:53Makes rendering responsive images definitely easy or easier.
01:51:58Okay.
01:52:00So are we getting done here?
01:52:02Yeah, okay.
01:52:05So now I will try using Opus again.
01:52:08Let's see if that works, if we can build it.
01:52:12And I also will quickly delete my database here in the next.js app again because I stored
01:52:23the data as HTML.
01:52:25Let's also get started here.
01:52:28I stored the data as HTML and now I'm switching.
01:52:31So I'll delete the old database.
01:52:33That's the good thing about SQLite.
01:52:34You can just delete it and it'll be recreated.
01:52:37So yeah, it wants to install the dependency.
01:52:39Won't work in the sandbox.
01:52:40You need to do it outside of the sandbox.
01:52:45No, what?
01:52:52It showed sandbox here.
01:52:54Don't get it.
01:52:56Yeah, it also will need to install it here, I guess.
01:53:02We'll see if it wants to.
01:53:06And then we'll see if that works.
01:53:12Yeah, and I agree.
01:53:16Using like technical specification documents and so on can vastly improve the output and
01:53:22the quality of the output you get from AI, 100%.
01:53:28Interesting that it didn't install that extra tool here in the next.js application.
01:53:36I'll ask it.
01:53:39Don't you need...
01:53:52My implementation uses a custom renderer.
01:53:56Well, we'll see.
01:54:00I guess we'll see.
01:54:01So, let's restart both dev servers and let's reload next.js.
01:54:09No note, of course, because I cleared the database.
01:54:11So this is a test H1 testing.
01:54:16This is bold, bold, and some code.
01:54:24So let's use some inline code here.
01:54:29And then also a code block.
01:54:35Okay, copy that.
01:54:41Save it.
01:54:43Go to it.
01:54:44Looks good.
01:54:45Being rendered.
01:54:46Looks good.
01:54:47So next.js looks decent.
01:54:48I mean, obviously the preview here is not looking good with the JSON.
01:54:52We would have to do something about this, but it works.
01:54:55Now for 10-stack start, test note, paste this in, save this, go there.
01:55:05Also looks good.
01:55:06So let's check for errors.
01:55:09No errors here.
01:55:12No errors here and on this page.
01:55:14Also no errors.
01:55:15So that is working.
01:55:17And I guess pretty good.
01:55:19Five minutes, seven minutes left.
01:55:20We got the note-taking app done with the rich text editor, with some AI usage and hopefully
01:55:29helpful when it comes to understanding some of the differences, obviously you could talk
01:55:36about this forever.
01:55:38The main differences in the end are, or the main thing that comes to my mind or that come
01:55:44to my mind are the ecosystem, the ease of learning obviously matters, maybe a bit less so in the
01:55:48age of AI, but I would say it matters, data fetching and the general idea.
01:55:53And I think one important takeaway is that Next.js of course is the older framework and
01:55:57it's the one that is more, that's using all these React features, which you could argue
01:56:03were added because of Next.js like React server functions, like React server components.
01:56:08And you don't have that in 10-stack start.
01:56:11You have server functions there, but they're not the official React server functions.
01:56:14They're their own version.
01:56:16You don't have React server components there yet.
01:56:19They will be added.
01:56:21So it depends on if you need that, if you want that, or maybe it's an argument for you that
01:56:25they don't have it because of all the security vulnerabilities and you want to use 10-stack
01:56:29start for that reason.
01:56:32Both frameworks are great in my opinion.
01:56:34I've worked heavily with both.
01:56:36I liked them both.
01:56:37I know Next.js can be slow.
01:56:40The caching can be super confusing.
01:56:42I mentioned it in the beginning, but it's well established.
01:56:46You can build amazing apps with it.
01:56:48There are tons of production apps out there powered by Next.js.
01:56:5110-stack start is a release candidate will hopefully be stable soon.
01:56:56And I like working with it.
01:56:58It feels a bit leaner, a bit more, a bit fresher.
01:57:02I would say it could just be the shiny thing of course.
01:57:04I don't know, but I really enjoy working with it.
01:57:10Everything or for me, everything seems to make sense there.
01:57:13There is no complex caching logic.
01:57:16The docs can be a bit intimidating.
01:57:19They gotten better as I mentioned, but still feels a bit like a brain dump.
01:57:23But it all to me feels a bit simpler with 10-stack start than with Next.js.
01:57:30With Next.js, you have to know these different directives.
01:57:33With Next.js, you have these other special instructions that you can add to your files.
01:57:55Are these special instructions you can add to certain files?
01:58:10What's it called?
01:58:11Revalidate is one of them I think.
01:58:15Yeah, like these instructions.
01:58:18So that can be confusing and it's all related to the caching in the end.
01:58:22Knowing when to add what with which value.
01:58:26That's just something you don't really have here with 10-stack start.
01:58:31And I think that's one of the main reasons why it feels a bit more, a bit easier to me.
01:58:39The inconsistency.
01:58:46You mean between the editor and the custom rendering here?
01:58:48I think overall the results look good.
01:58:51The sides look different, of course, because we have different styling.
01:58:57If you use SQLite, does it work with Vercel?
01:59:00I'm guessing not.
01:59:01I also guess it's not working because my understanding, and it's been some time since I last hosted
01:59:06something on Vercel, my understanding is that they are essentially pushing your code into
01:59:12functions, edge functions, like AWS Lambda-like functions, and you have no data persistence
01:59:19in there.
01:59:20And SQLite is really just a file in your project.
01:59:23I don't imagine that works there.
01:59:25I could be wrong though, but I don't think it works there.
01:59:28I would have to look it up though.
01:59:31Which language, TypeScript or Golang, for a solo dev?
01:59:35I want to create backend spots.
01:59:36I think TypeScript is the better choice for the main reason that there are, especially
01:59:41now if you're looking into building bots and so on and you maybe want to use AI and maybe
01:59:46you need full-stack applications.
01:59:49I mean, it's my ecosystem.
01:59:51I'm working with TypeScript all the time, but for me it feels like a bit easier to work in
01:59:56that space.
01:59:57AI knows a lot about it.
01:59:58You find plenty of resources, plenty of packages.
02:00:01So that's why my recommendation would be TypeScript.
02:00:05You should give Convex a try.
02:00:06I will.
02:00:07I will.
02:00:10I've heard a lot of amazing things about it.
02:00:12I will definitely give it a try.
02:00:14AI told me that my AI code is better than 95% of agency coding.
02:00:20Well, if AI says it, what would advise juniors that most companies are hiring seniors and
02:00:28give them AI subscriptions?
02:00:43Well, I basically have to wrap it up now.
02:00:58Just maybe as the final words related to AI coding.
02:01:01I've said it in essentially all my other videos.
02:01:03I said it in last week's stream, which by the way is also still off online on the site.
02:01:09I think as a developer, there is no way around AI and you should use it because you can be
02:01:15vastly more productive with it and AI can produce good code, especially if you steer
02:01:21it in the right direction.
02:01:22That's in a nutshell, my take on that.
02:01:27When you do pure wipe coding and you hope that AI gets it right, that can absolutely be fine
02:01:32if you're building your own utility script, stuff like that.
02:01:36But anything that you plan on running in production, where you plan on charging people, not just
02:01:41developers, I wouldn't feel confident in if I wouldn't see the code, if I wouldn't understand
02:01:46the code.
02:01:47You can decide differently, but you'll have to deal with potential bugs or problems or
02:01:51security issues and whatever.
02:01:54Anyways, I enjoyed the stream.
02:01:56I hope you did too.
02:01:57I got to go.
02:01:59A rough start, but we got there in the end and I hope it was helpful.
02:02:04I hope it was interesting and I wish you all a great day, evening, morning, whatever is
02:02:10for you and hopefully see you in future streams and videos and yeah, thanks for joining.
02:02:16Bye bye.

Key Takeaway

Next.js and TanStack Start are both capable full-stack React frameworks with different philosophies: Next.js offers maturity and ecosystem richness with added complexity, while TanStack Start provides simplicity and modern patterns despite being newer and less established.

Highlights

Next.js has a richer ecosystem and more resources, but TanStack Start offers a simpler, more straightforward development experience without complex caching logic

Data fetching differs significantly: Next.js uses React Server Components (RSC) while TanStack Start uses a loader pattern with server functions created via createServerFunction

TanStack Start is still in Release Candidate phase and lacks React Server Component support, while Next.js is more mature and production-ready

Both frameworks support full-stack React development with TypeScript and Tailwind, but have different approaches to server-side code execution

The learning curve for Next.js is easier initially but becomes more complex, while TanStack Start is harder to start with but simpler once understood

Next.js deployment is optimized for Vercel but can be expensive, while TanStack Start offers more flexibility in deployment options

Both frameworks successfully implemented a note-taking app with Tiptap rich text editor, storing content as JSON in SQLite database

Timeline

Introduction and Framework Overview

The stream begins with an introduction to comparing Next.js and TanStack Start by building the same note-taking application with both frameworks. The host explains that both are full-stack React frameworks, not suitable for simple single-page applications where React Router or TanStack Router alone would suffice. Key differences are outlined: TanStack Start includes TanStack Router and can also work with Solid.js, while Next.js is React-specific. The host emphasizes that from an ecosystem perspective, Next.js has advantages due to being more mature with more tutorials, courses, and better AI model knowledge, though tools like Context7 MCP and web search can bridge this gap for TanStack Start.

Learning Curve and Documentation Comparison

The host discusses the ease of learning and mastering both frameworks, noting that Next.js is easier to get started with but harder to master due to hidden complexity around caching and directives like 'use server', 'use client', and 'use cache'. TanStack Start has a steeper initial learning curve with documentation that used to be problematic but has improved significantly. The speaker mentions their Next.js course available at academind.com and explains that TanStack Start documentation can still feel chaotic like a 'brain dump' but is much better than before. The discussion covers how Next.js caching behavior differs between development and production environments, which can be frustrating for developers.

Project Setup and Initial Configuration

Both projects are initialized using their respective CLI commands: 'bun create next-app' for Next.js and 'bun create @tanstack/start' for TanStack Start. The host sets up SQLite databases using Bun's built-in SQLite capabilities and attempts to configure BetterAuth for authentication in both projects. However, unexpected errors occur with TanStack Start related to BetterAuth integration, something the host hadn't encountered before despite using TanStack Start extensively in recent weeks. After troubleshooting, the decision is made to proceed without authentication to keep the stream moving forward. The host also needs to manually add Tailwind CSS to the TanStack Start project as it wasn't included by default in this particular setup.

Routing Structure and File Organization

The host sets up routing for the note-taking application in both frameworks, highlighting key differences in their routing conventions. In Next.js, routes use page.tsx files with dynamic segments wrapped in square brackets like [noteId], while TanStack Start uses index.tsx files with dollar signs for dynamic segments like $noteId. The speaker explains that TanStack Start auto-populates route files with createFileRoute code including hooks for loaders and beforeLoad functions. In Next.js, route components are React Server Components (RSC) by default, allowing direct data fetching inside components, whereas TanStack Start uses a loader pattern where data fetching must happen in designated loader functions that run on both server and client.

Server Functions and Data Fetching Patterns

The host demonstrates the fundamental difference in data fetching between the frameworks. TanStack Start uses createServerFunction to wrap database code, ensuring it only runs server-side even when called from loaders that execute on both client and server. This is paired with Zod validation schemas passed to inputValidator for automatic validation. Next.js uses React Server Components, allowing developers to write database queries directly in component bodies since components are guaranteed to run only on the server. For mutations, Next.js uses React server actions with 'use server' directive, while TanStack Start uses its own server functions wrapped with useServerFunction hook when called from components. The host uses AI (Cursor with Claude Opus) to help implement these patterns, providing context from official documentation.

Integrating Tiptap Rich Text Editor

The stream proceeds to integrate Tiptap, a rich text editor library, into both applications. Tiptap provides a WYSIWYG editing experience while outputting JSON that can be stored in the database and rendered programmatically. The host installs @tiptap/react, @tiptap/pm, and @tiptap/starter-kit packages in both projects, then uses AI to set up the editor components with features like bold, italic, strikethrough, headings, and code blocks. In Next.js, the Tiptap component must be marked with 'use client' since it uses hooks and handles user interaction. The editor is configured with immediatelyRender: false for proper server-side rendering compatibility. The host demonstrates saving notes with formatted content including headings, bold text, inline code, and code blocks in both applications.

Data Persistence and Note Display

The final segment covers saving and displaying notes in both frameworks. The host implements save functionality using server functions in TanStack Start with Zod validation and throw redirect for navigation, and React server actions with useActionState hook in Next.js for handling form submissions with validation errors. Notes are stored as JSON in SQLite and retrieved for the detail pages. AI helps create custom renderers to display the Tiptap JSON content as properly styled JSX with Tailwind classes. The host addresses questions about deployment, explaining that SQLite likely won't work on Vercel due to serverless function architecture lacking persistent file storage. The stream concludes with working note-taking applications in both frameworks, emphasizing that while Next.js offers more ecosystem support and maturity, TanStack Start provides a simpler mental model without complex caching directives.

Community Posts

View all posts