UPDATES: - create-t3-app now uses latest Next, which should fix some bugs with hot reloading on parallel routes - MAKE SURE YOU USE THE DEFAULT PREFIX WHEN SETTING UP VERCEL POSTGRES - Clerk Core 2 is no longer in beta! If you just `pnpm install @clerk/nextjs` you will have this version now :) Oh also - GITHUB REPO IS HERE: github.com/t3dotgg/t3gallery
Thanks Theo, amazing tutorial as always ❤Recently you are bringing back the vibes of the time when pokemon roundest was around 😁would be amazing bringing new updated version of it tho'. UPLOADTHING is a game changer, finally something more about it too
Heya!!!! Thank you for the video!!! it was super helpful. You said at the start you would explain why no TRPC. Are you able to? Also, a follow on for this where you show how to for production state management / the zustand setup would be really cool:) Thank you for your content and the effort you put in!! your contributions to the community are never ending and appreciated greatly by me and so many others!!!!
@@t3dotgg It'd be nice if this was also a playlist with shorter videos. It's easier to consume that way. Personally, I won't be watching this in one go. While having chapters help, it's still one video. Haven't started yet, but I'm curious how beginner friendly this is. While I'm good at JS, I haven't tried any front-end library/framework (although, I keep tabs on them). So I think it requires some kind of leap from plain JS to front-end libraries. I currently have that mental gap. Hope this helps a little.
@@akinoreh As someone who makes programming tutorials (JavaScript gamedev tutorials), there are big negatives with publishing in multiple parts. Here are the main two : - Next parts will always make progressively less views than the first part giving the impression that your channel is dying. - It clutters your channel and makes it hard to find content.
Yo, I want to appreciate for the amount of work and effort you put into this also by not putting up a paywall and choosing not to take the easy path. Making this available (for free) to the community is truly commendable. Your work is worth so much more than those who charge for courses however are much less informative than this. A million thanks!
Wow nice, I have been looking forward to a video that isn't you reading an article or documentation. It's nice to see some actual programming 😁 Thank you for the vid!
Honestly, this is the kind of content I subscribed for. Really respect Theo for putting out content like this for free that's extremely useful and especially targeted towards intermediate devs. A lot of the content is only for beginners.
Amazing content. I don't usually watch that many tutorials anymore, but this feels exactly what i needed to hone my skills with all the new stuff. Thanks Theo!
Quick tip using as a modal. To style the backdrop, just use the ::backdrop pseudo-class. In tailwind it would be className="backdrop:bg-zinc-900/50". This way you dont have to worry about the margins and having it cover the entire screen etc. The backdrop is already there for you
Just finished tutorial. Gotta say, gallery app was, in my opinion, an amazing choice for a project to showcase RSCs. For me, handling file uploads, storage, all the authentication that comes with it, was always a stressful experience and seamless integration this project provides is an amazing resource. 10/10. Keep up the amazing work, Theo!
6:23 right! so let's build a todo-list app first! haha Great video, I was actually considering asking somewhere if there were plans for a tutorial after the recent changes in so many technologies and platforms. Thanks a ton for videos like this. Introductory tutorials are nice, but at some point people start needing next level content, and this is about it!
Love it! Was needing this a lot 🙏🙏 Most tutorials out there tend to leave important stuff out that's needed for any decent production application like the error monitoring, event tracking and rate limiting so it was super useful to see how you're tackling this
"From 0 to Production - The Modern React Tutorial" - Video Summary This tutorial shows how to build a full-stack image gallery app with authentication, image uploading, and other production-ready features. *Project Setup & Deployment* * *3:30**:* Scaffolds the project using `create-t3-app` with Next.js, TypeScript, TailwindCSS, Shadcn/UI, Drizzle ORM, and Vercel Postgres. * *8:39**:* Initializes a GitHub repository and links it to Vercel for automatic deployments. * *13:32**:* Uses UploadThing for image hosting and retrieves initial mock image URLs. *Basic UI & Database Integration* * *15:40**:* Creates a basic UI with a top navigation bar and displays the mock images. * *17:35**:* Explains Next.js layout system and implements nested layouts for the app. * *24:18**:* Sets up a Postgres database on Vercel and connects it to the app using Drizzle. * *35:14**:* Populates the database with the mock images and displays them dynamically on the homepage. * *35:14**:* Implements dynamic routes to ensure the page content updates when the database changes. *Authentication & Image Uploading* * *43:00**:* Adds authentication using Clerk with GitHub and Google sign-in options. * *54:04**:* Restricts image viewing on the homepage to authenticated users. * *54:04**:* Integrates UploadThing for image uploading with client-side and server-side components. * *1:04:10**:* Persists uploaded images to the database and associates them with the logged-in user. * *1:09:41**:* Explains and implements the "taint" concept to prevent sensitive data from reaching the client. *Production-Ready Features* * *1:17:18**:* Replaces standard image tags with `next/image` for automatic image optimization. * *1:22:58**:* Integrates Sentry for error monitoring and demonstrates how to capture and view errors. * *1:32:07**:* Implements an image details page with parallel routes for a better user experience. * *2:04:15**:* Styles the upload button using Shadcn/UI components and adds a loading spinner. * *2:26:40**:* Integrates PostHog for analytics and tracks user actions like image uploads and deletions. * *2:38:21**:* Implements a delete button using server actions to remove images from the database. * *2:49:52**:* Adds rate limiting using Upstash to prevent abuse of the upload functionality. * *2:56:44**:* Restricts image uploads to users with specific permissions set in Clerk metadata. *Challenges for Viewers:* * Fix the page layout for images with different resolutions. * Implement image selection on the gallery page with state management (using Zustand). * Add infinite scroll to the gallery page. * Implement folders or albums to organize images. i used gemini 1.5 pro
What was the exact prompt you used? it only gave me below summary. This video is a tutorial on how to build a production-ready React application using the T3 stack. The video is divided into the following sections: Introduction (0:00 - 2:02) Tech Stack Overview (2:02 - 10:22) Sponsors (10:22 - 12:12) Setting up the project (12:12 - 14:47) Installing Dependencies (14:47 - 19:17) Setting up PostHog (19:17 - 25:22) Data Model (25:22 - 27:22) Conclusion and Challenges (27:22 - 3:03:12) I hope this is helpful!
@@continuouslearner i can't find the exact prompt now. but typically i use two prompts in sequence, something like: (1) "i don't want to watch the video. create a bullet list summary: ". (2) "add starting (not stopping) timestamps"
@@continuouslearner yes, I just copy paste the transcript. You can find a link in most UA-cam descriptions. but keep in mind that a three hour transcript hits the boundary of what is possible with Gemini 1.5 pro. In my experiments Gpt4 was even worse and typically gave bad summaries for more than 1 hour videos
@@wolpumba4099 thank you, its so much clear now. For some reason i thought/was expecting gemini 1.5 pro to do both the transcription and then the summarization and was wondering why its output was so poor (not detailed enough) compared to your original comment above. A bit disappointed that 1.5 pro cant pull the transcription straight from youtube and we have to explicitly, manually, provide it ... but at least now i know how to get the detail. Much appreciated.
0 to Production with Full Test Coverage. That would be such an interesting follow up. Breaking down how each of the best practices and starting points your tutorial covers would fit into a CI testing stack (end to end and unit). That said, so far, so really really helpful. Thanks a bunch.
Theo doesn't really do TDD iirc - he thinks shipping code fast >>> maintaining both the codebase & tests (his mindset is very "move fast and disrupt this is sillicon valley let's make money" so he values good analytics and deploying a fix quickly more than deploying tested code; if he had a background in banking, medical or other sensitive software he might think differently) A good start is keeping your UI code decoupled from business logic (the new server actions seem useful for this) and have some Jest unit tests for each action. The better you are at separation of concerns the easier it is to test logic. There are libraries to test UI renders how you want or mock interactions and test a user journey end to end, but I find those very easy to break and a lot of overhead. With UI I think easily doing "prototype -> get feedback -> redesign" is very valuable so you have to balance if UI tests are adding value or it's just a development burden
This was really helpful, thank you so much 🙏 Been sleeping on TypeScript, but now a fully signed up convert. Dropped a paid subscription to uploadthing, truly a thing of beauty. You Sir are a gentleman and a scholar.
Just finished watching the whole video and doing almost all things. As a noob it felt like this is so advanced code for me but now I got introduced to the analytics and ratelimiting
Keeping it short; for anyone running into a build problem near 27:00 and you followed instructions not to rename POSTGRES_URL (and you might be paused wondering if it's fine to just replace all instances of "DATABASE_URL" to "POSTGRES_URL" in your project). He does go and fix that at around 30:00. Still useful for anyone who might pause vid after running into issue trying to fix it themselves before it's presented 3min later.
just finished this awesome tutorial, the modal is not closing when deleting the image from the photo modal, but it works from the photo page. very valuable content to kickstart nextjs learning.
1:00:34 i could get the generic upload buttons only to work when i added "use client" at the top of the utils/uploadthing.ts file. alternatively, importing the Buttons directly from the library worked as well. Generally, i'd recommend doing this tutorial without --turbo, since it produced a lot of errors for me while more and more features were added. Thank you for this amazing tutorial. I learned a lot about how things work together
Effin missed this, I really loved your beginnings with Pokemon app. In fact I claim that you sparked the Poimandres revolution in VSCode setups. I wish you'd do these videos more often!
Watching this, i realize how much influence Theo has. I use most of these technologies in my production apps. And the startups i build for might keep using them for a long time too. I hope they are paying you a lot of money for the market you bring.
Thanks again for the tutorial. Finally made it through and I feel I have learned a lot. Appreciate your time and the sponsors' willingness to partner with you to make it happen.
YESSS, if you or anyone fixed this error, PLEASE comment here and let me know EDIT: It deploys just fine and the upload works on vercel after disabling the authentication on vercel but on my local, I still cannot upload
in "api/uploadting/route.ts" you need to set the isDev config flag export const { GET, POST } = createRouteHandler({ router: ourFileRouter, config: { isDev: process.env.NODE_ENV === "development", } });
Thank you Theo for this video. Thanks for showing us how we should manage and succeed in every project. Y'all dev brothers, never forget to-do lists. They are crucial
thanks Theo, great vid! at 1:40:45 - another approach that I like for breaking down changes into smaller commits is using VSCode Source Control tab to stage changes file by file (or line by line) for each commit
Not sure if anyone has come across this issue but: Whenever I delete and image and I redirect back to the root path redirect("/"); and then I want to click on another image to open it in the "modal" I can see the url change but nothing happens in the UI (i..e I am trying to open image on @modal/(.)image/[id]/ again, the screen just stays the same (homepage screen). I have to do a full page reload for it to work... not sure what I did wrong but struggling to debug this.
Came to comment cause I had a similar issue, I imagine it was the same cause but you noticed a different behaviour due to different versions. The root problem is that redirect("/") does not cause the modal to dismiss itself properly, even though the path has changed and it should not stay up. I had this problem in 2 versions. In Next 14.2.4 the modal completely stays up even though redirect was called and the path is changed. So it's not dismissed at all. In Next 14.2.3 what you're describing happens: the modal is dismissed, but something breaks and we cannot open other images to see their modals. I downgraded to 14.1.4, I think this is what Theo had in the video. It works. So it's a Next bug. For others having problems with deleting, try another Next version until it works. Easiest fix, unless you need specific Next versions. And a side note. Though I can't remember what the issue was, something from an earlier part of the video forced me to downgrade from 14.2.4 to 14.2.3. A rule of thumb: if the code is the same as in the video but yours doesn't work, your Next version has a bug. Hope this helps
@@cosminvoinopol705 I was having the exact same issue with redirect("/") not dismissing the modal. Whenever I would delete an image, the app would crash because FullPageImageView would try to render the deleted image and throw an "Image not found" error. By downgrading Next to 14.1.4, it works perfectly now. Hopefully Next can fix this bug in the modal. It's such a cool feature.
@31:50 hit a roadblock here. You need to change the line at the top of app/page.tsx from import { db } from "@vercel/postgres"; to import { db } from "../server/db"; (which does the vercel import)
Great tutorial btw, I'm starting to branch out towards next.js and react coming from Java and PHP (not together but from my last two jobs) so is extremely exciting to see how powerful all these tools are!
1:33:11 Funnily enough, I just implemented something similar with HTMX, using the HX-Request header to determine if it should return a full page or just the page element that got updated 1:40:45 Lol, glad I did not forget. I was already confused that you didn't show the commit part, but at first I thought you just cut it from the video :D
@@sirklattjust finishes now, really great tutorial. one of the best we have here at youtube. really cool stuff, very well explained and would totally recommend
Hey, I just wanted to thank you for this video. I've been working with react for almost 5 years, next for 3. I know a lot of what you've covered in this video already but it was really nice having such a thorough and comprehensive refresher. I was laid off about a year ago and I became really skeptical of the value of my React skillset after not being able to find a job for sometime and have been somewhat a drift in my personal projects and coding. I just want you to know you reignited a bit of my spark and love for React/Next and that I genuinely appreciate you content. Side note... from boston... can kickflip... but does he hardcore?
at 29:00 i have my index.ts set up exactly like yours but the sql parameter is complaining... Argument of type 'VercelPool & ((strings: TemplateStringsArray, ...values: Primitive[]) => Promise)' is not assignable to parameter of type 'Sql'. Type 'VercelPool & ((strings: TemplateStringsArray, ...values: Primitive[]) => Promise)' is missing the following properties from type 'Sql': CLOSE, END, PostgresError, options, and 13 more.ts(2345) ive tried restarting the TS server incase, and its weird because it seems fine, i may ts-ignore it for the moment unless something bad happens but yeah
@@evangroneman5408 yeah im now just getting an issue with production not uploading the image to db, at 1:09:00, getting a 401 reflected on uploadThing that im trying to debug, my middleware file is the same as his which is what it suggests it could be
1:36:40 (Parallel Routes section) If your page changes when clicking the link instead of printing the ID on the page -Make sure you have the default.tsx file -Restart the dev server (what worked for me)
28:44 - I am getting the same thing and cant' seem to fix the error message. When I follow the steps and run dev I get "TypeError: Cannot set properties of undefined (setting '1184')" from that line. Anyone have the same issue, ideas?
For those having an issue with it trying to getImage of the image you just deleted: check whether it only applies to parallel routes or also after hard navigating to that image. Ask yourself why that is. Search "next 14.2 parallel routes redirect workaround". The default.tsx just needs a page.tsx also returning a null. This has to do with how Next handles soft navigation. A few behaviors must have changed since this video was made, and the docs show a slightly different setup for the slot.
if any of you having issues with parallel routing - firstly make sure you have the default in the @modal folder , then the page in the [id] folder. secondly , you will need to restart your dev server.
@@sovapid no that is well established in every major programming language in contrast to this implicit type conversion going on in your original code...
I had a warning after adding the @apply rule at 17:02 - VSCode said "Unknown at rule @apply". The fix is to install the PostCSS Language support extension. I kinda wish Leo would have gone over the VSCode extensions he uses.
Just started using Drizzle, gets a thumbs up from me. Of course the typing's are a real +, but what I really like is that you can use composition to build your query's. eg. lets assume you have a complex sub query you want to say do an `inArray` with, you can then create a function and re-use in other query's, you could say it's a bit like Views but been able to use props, and of course still have strong typing's. Nice!!!!
hey, thanks for the vid! i ran into a bug where when i delete in item, it redirects me normally.. but when i am trying to click on another item the modal wont open, the URL gets updated but i am still seeing the main page, even when i spam ping. if i refresh i get normally to the specific image page. anyone encountered this? i have tried to move the server action into its own .ts file and i have tried to play around with the modal components and the router.back() (switched to router push("/")) but nothing seems to make it work.
Fantastic tutorial! For someone who has never used TS/TW/analytics/ratelimiting....I managed to follow along just fine, and even understand, (i think) what was going on! Either way it works so thank you @t3dogg for such a great walkthrough
HELP! Has anyone run into an error when running the pnpm run db:push in the cli. It's at 30:59, I am getting a TypeError for some class in the nodemods for the drizzle-kit/bin.cjs file. Its pointing out "Request2 = class extends GlobalRequest {" I'm not really sure how to fix this? Here is the error: TypeError: Class extends value undefined is not a constructor or null at node_modules/.pnpm/@hono+node-server@1.9.0/node_modules/@hono/node-server/dist/index.mjs Anything helps
More of this! More tutorials. More projects. More ShadcnUI component modifications. More interacting with databases and fetching different content. More State management tutorials (Zustand?). More Github Actions....
UPDATES:
- create-t3-app now uses latest Next, which should fix some bugs with hot reloading on parallel routes
- MAKE SURE YOU USE THE DEFAULT PREFIX WHEN SETTING UP VERCEL POSTGRES
- Clerk Core 2 is no longer in beta! If you just `pnpm install @clerk/nextjs` you will have this version now :)
Oh also - GITHUB REPO IS HERE: github.com/t3dotgg/t3gallery
Should I use dependency injection with posthog? if in case I want to migrate to something like mixpanel?
💜
when will the t3 stack updated
Thanks Theo, amazing tutorial as always ❤Recently you are bringing back the vibes of the time when pokemon roundest was around 😁would be amazing bringing new updated version of it tho'. UPLOADTHING is a game changer, finally something more about it too
Heya!!!! Thank you for the video!!! it was super helpful. You said at the start you would explain why no TRPC. Are you able to? Also, a follow on for this where you show how to for production state management / the zustand setup would be really cool:) Thank you for your content and the effort you put in!! your contributions to the community are never ending and appreciated greatly by me and so many others!!!!
Timestamps
00:00 - Intro
00:47 - Who, What & Why
03:30 - Scaffolding the project
06:12 - Creating our todo list
08:39 - Creating repo & pushing to GitHub
10:23 - Linking our repo to Vercel
11:00 - Fixing the Environment Variables
12:07 - Deploying to Vercel
13:32 - Setting up uploadthing for images
15:40 - Displaying our mock data
17:35 - Next.js Layouts Explained
19:45 - Scaffolding our UI
21:47 - Tidying up builds & enabling turbo
24:18 - Setting up our Database
35:14 - Dynamic Routes
37:40 - Changing our database schema
43:00 - Adding authentication
54:04 - Setting up image uploading
01:04:10 - Connecting users to images
1:09:07 - What's next (Take break here)
1:09:41 - server-only & React Taint
1:17:18 - The next/image Component
1:22:58 - Error management w/ Sentry
1:32:07 - Image page w/ Parallel Routes
2:04:15 - Fixing the upload button
2:11:05 - Setting up toaster w/ shadcn/ui
2:26:40 - Adding analytics w/ PostHog
2:38:21 - Delete button w/ Server Actions
2:49:52 - Adding rate limits w/ Upstash
2:55:05 - Redeploying to Vercel
2:56:44 - Locking down uploads
3:00:59 - Challenges for the Viewer
3:02:35 - Outro
THANK YOU
@@t3dotgg It'd be nice if this was also a playlist with shorter videos. It's easier to consume that way. Personally, I won't be watching this in one go. While having chapters help, it's still one video.
Haven't started yet, but I'm curious how beginner friendly this is. While I'm good at JS, I haven't tried any front-end library/framework (although, I keep tabs on them). So I think it requires some kind of leap from plain JS to front-end libraries. I currently have that mental gap. Hope this helps a little.
@@akinorehI’d be so sad if this was broken up into a playlist.
@@RogueTravel Notice the "also". Besides, what's the advantage of a single video (contrary to a playlist)?
@@akinoreh As someone who makes programming tutorials (JavaScript gamedev tutorials), there are big negatives with publishing in multiple parts. Here are the main two :
- Next parts will always make progressively less views than the first part giving the impression that your channel is dying.
- It clutters your channel and makes it hard to find content.
Yo, I want to appreciate for the amount of work and effort you put into this also by not putting up a paywall and choosing not to take the easy path. Making this available (for free) to the community is truly commendable. Your work is worth so much more than those who charge for courses however are much less informative than this. A million thanks!
Yes and yes. I completely agree with you. I feel that we are very lucky to have such incredible people in the JS community with such background..
"primeagen still had a job"🤣
Wow nice, I have been looking forward to a video that isn't you reading an article or documentation. It's nice to see some actual programming 😁 Thank you for the vid!
Honestly, this is the kind of content I subscribed for. Really respect Theo for putting out content like this for free that's extremely useful and especially targeted towards intermediate devs. A lot of the content is only for beginners.
Indeed, only came across Theo a little while back and only ever seen him as a talking head. Not an actual coder, so this was quite informative
Watch his lives
Amazing comment !!!!!
I agree
Finally, a video where you're not just reading from an article.
Amazing content. I don't usually watch that many tutorials anymore, but this feels exactly what i needed to hone my skills with all the new stuff. Thanks Theo!
Crazy that a master software engineer such as Theo has infra this accessible and simple.
Theo, please keep making tutorials like this! This is extremely helpful as a learning dev.
Quick tip using as a modal. To style the backdrop, just use the ::backdrop pseudo-class. In tailwind it would be className="backdrop:bg-zinc-900/50". This way you dont have to worry about the margins and having it cover the entire screen etc. The backdrop is already there for you
Just finished tutorial. Gotta say, gallery app was, in my opinion, an amazing choice for a project to showcase RSCs. For me, handling file uploads, storage, all the authentication that comes with it, was always a stressful experience and seamless integration this project provides is an amazing resource.
10/10. Keep up the amazing work, Theo!
bro my drizzle sudio is not opening at 4983 instead its showing 404 error , can you help ?
Incredible tutorial, maybe the best overview I"ve ever seen to build and deploy a webapp. Thanks Theo for showing the rest of us the way
Lets goooooooooo
I think you released 20 tutorials since I started planning this one 🙃
Thanks to both of you, I was able to learn coding because of you guys, thanks my real teachers🙇🏻♂️
haven't watched it yet, but the fact that you've put this out for free is incredible
The hair covering your face is giving me OG roundest Pokémon theo vibes
This was semi intentional
Keeping it real for the nerds
damn the roundest pokemon nostalgia hit me with this comment
Amazing tutorial! As a next.js noob this is honestly gold, and I learned a ton. Thank you!
6:23 right! so let's build a todo-list app first! haha Great video, I was actually considering asking somewhere if there were plans for a tutorial after the recent changes in so many technologies and platforms. Thanks a ton for videos like this. Introductory tutorials are nice, but at some point people start needing next level content, and this is about it!
Love it! Was needing this a lot 🙏🙏 Most tutorials out there tend to leave important stuff out that's needed for any decent production application like the error monitoring, event tracking and rate limiting so it was super useful to see how you're tackling this
"From 0 to Production - The Modern React Tutorial" - Video Summary
This tutorial shows how to build a full-stack image gallery app with authentication, image uploading, and other production-ready features.
*Project Setup & Deployment*
* *3:30**:* Scaffolds the project using `create-t3-app` with Next.js, TypeScript, TailwindCSS, Shadcn/UI, Drizzle ORM, and Vercel Postgres.
* *8:39**:* Initializes a GitHub repository and links it to Vercel for automatic deployments.
* *13:32**:* Uses UploadThing for image hosting and retrieves initial mock image URLs.
*Basic UI & Database Integration*
* *15:40**:* Creates a basic UI with a top navigation bar and displays the mock images.
* *17:35**:* Explains Next.js layout system and implements nested layouts for the app.
* *24:18**:* Sets up a Postgres database on Vercel and connects it to the app using Drizzle.
* *35:14**:* Populates the database with the mock images and displays them dynamically on the homepage.
* *35:14**:* Implements dynamic routes to ensure the page content updates when the database changes.
*Authentication & Image Uploading*
* *43:00**:* Adds authentication using Clerk with GitHub and Google sign-in options.
* *54:04**:* Restricts image viewing on the homepage to authenticated users.
* *54:04**:* Integrates UploadThing for image uploading with client-side and server-side components.
* *1:04:10**:* Persists uploaded images to the database and associates them with the logged-in user.
* *1:09:41**:* Explains and implements the "taint" concept to prevent sensitive data from reaching the client.
*Production-Ready Features*
* *1:17:18**:* Replaces standard image tags with `next/image` for automatic image optimization.
* *1:22:58**:* Integrates Sentry for error monitoring and demonstrates how to capture and view errors.
* *1:32:07**:* Implements an image details page with parallel routes for a better user experience.
* *2:04:15**:* Styles the upload button using Shadcn/UI components and adds a loading spinner.
* *2:26:40**:* Integrates PostHog for analytics and tracks user actions like image uploads and deletions.
* *2:38:21**:* Implements a delete button using server actions to remove images from the database.
* *2:49:52**:* Adds rate limiting using Upstash to prevent abuse of the upload functionality.
* *2:56:44**:* Restricts image uploads to users with specific permissions set in Clerk metadata.
*Challenges for Viewers:*
* Fix the page layout for images with different resolutions.
* Implement image selection on the gallery page with state management (using Zustand).
* Add infinite scroll to the gallery page.
* Implement folders or albums to organize images.
i used gemini 1.5 pro
What was the exact prompt you used?
it only gave me below summary.
This video is a tutorial on how to build a production-ready React application using the T3 stack.
The video is divided into the following sections:
Introduction (0:00 - 2:02)
Tech Stack Overview (2:02 - 10:22)
Sponsors (10:22 - 12:12)
Setting up the project (12:12 - 14:47)
Installing Dependencies (14:47 - 19:17)
Setting up PostHog (19:17 - 25:22)
Data Model (25:22 - 27:22)
Conclusion and Challenges (27:22 - 3:03:12)
I hope this is helpful!
@@continuouslearner i can't find the exact prompt now. but typically i use two prompts in sequence, something like: (1) "i don't want to watch the video. create a bullet list summary: ". (2) "add starting (not stopping) timestamps"
@@wolpumba4099 thanks, where you say , what does that mean? i.e are you uploading the transcript along with asking the prompt?
@@continuouslearner yes, I just copy paste the transcript. You can find a link in most UA-cam descriptions. but keep in mind that a three hour transcript hits the boundary of what is possible with Gemini 1.5 pro. In my experiments Gpt4 was even worse and typically gave bad summaries for more than 1 hour videos
@@wolpumba4099 thank you, its so much clear now. For some reason i thought/was expecting gemini 1.5 pro to do both the transcription and then the summarization and was wondering why its output was so poor (not detailed enough) compared to your original comment above. A bit disappointed that 1.5 pro cant pull the transcription straight from youtube and we have to explicitly, manually, provide it ... but at least now i know how to get the detail. Much appreciated.
0 to Production with Full Test Coverage. That would be such an interesting follow up. Breaking down how each of the best practices and starting points your tutorial covers would fit into a CI testing stack (end to end and unit). That said, so far, so really really helpful. Thanks a bunch.
Theo doesn't really do TDD iirc - he thinks shipping code fast >>> maintaining both the codebase & tests (his mindset is very "move fast and disrupt this is sillicon valley let's make money" so he values good analytics and deploying a fix quickly more than deploying tested code; if he had a background in banking, medical or other sensitive software he might think differently)
A good start is keeping your UI code decoupled from business logic (the new server actions seem useful for this) and have some Jest unit tests for each action. The better you are at separation of concerns the easier it is to test logic. There are libraries to test UI renders how you want or mock interactions and test a user journey end to end, but I find those very easy to break and a lot of overhead. With UI I think easily doing "prototype -> get feedback -> redesign" is very valuable so you have to balance if UI tests are adding value or it's just a development burden
This was really helpful, thank you so much 🙏 Been sleeping on TypeScript, but now a fully signed up convert. Dropped a paid subscription to uploadthing, truly a thing of beauty. You Sir are a gentleman and a scholar.
Thank you. I dont use any of this stack except for typescript and it is nice to see the start to finish...
Just finished watching the whole video and doing almost all things. As a noob it felt like this is so advanced code for me but now I got introduced to the analytics and ratelimiting
Keeping it short; for anyone running into a build problem near 27:00 and you followed instructions not to rename POSTGRES_URL (and you might be paused wondering if it's fine to just replace all instances of "DATABASE_URL" to "POSTGRES_URL" in your project). He does go and fix that at around 30:00. Still useful for anyone who might pause vid after running into issue trying to fix it themselves before it's presented 3min later.
just finished this awesome tutorial, the modal is not closing when deleting the image from the photo modal, but it works from the photo page. very valuable content to kickstart nextjs learning.
This video is just amazing! Thank you so much!! I appreciate that we can all see you coding and facing real-life errors and being honest about them. 👏
one of the biggest ad turorial i have seen so far. i learn nothinh i would expect from this video.
1:00:34 i could get the generic upload buttons only to work when i added "use client" at the top of the utils/uploadthing.ts file.
alternatively, importing the Buttons directly from the library worked as well.
Generally, i'd recommend doing this tutorial without --turbo, since it produced a lot of errors for me while more and more features were added.
Thank you for this amazing tutorial. I learned a lot about how things work together
Thanks, you solved my problem.
This fixed one error but the button just became stuck on loading indefinitely for me, I followed the tutorial to a T. I guess thats it.
solved my problem as well thank you!
Jesus christ. Thank you so much I was being unable to understand the reason for this error. People like you rock. Don't ever stop being you.
@@mangoherpson Did you every find a fix for this?
Theo, just four words: you made amazing tutorial!!! Thank you
YESSS BEEN WAITING FOR THIS!! Can’t wait to watch and follow along!
Effin missed this, I really loved your beginnings with Pokemon app. In fact I claim that you sparked the Poimandres revolution in VSCode setups. I wish you'd do these videos more often!
Watching this, i realize how much influence Theo has. I use most of these technologies in my production apps. And the startups i build for might keep using them for a long time too. I hope they are paying you a lot of money for the market you bring.
Thanks again for the tutorial. Finally made it through and I feel I have learned a lot. Appreciate your time and the sponsors' willingness to partner with you to make it happen.
Great video! Love it! Would love to see a video on how you manage DEV to PROD in Vercel and any lessons learned you have experienced.
1:00:57 onUploadComplete callback is not triggering, on uploadthing files section it's showing "Callback Failed" status
YESSS, if you or anyone fixed this error, PLEASE comment here and let me know
EDIT: It deploys just fine and the upload works on vercel after disabling the authentication on vercel but on my local, I still cannot upload
in "api/uploadting/route.ts" you need to set the isDev config flag
export const { GET, POST } = createRouteHandler({
router: ourFileRouter,
config: {
isDev: process.env.NODE_ENV === "development",
}
});
@@utsavpatel7954 left a reply
@@megamind-h8rThank you so much
@@megamind-h8r this is not working for me
even in prod
I forget your name and searched mustache man reactjs funny part is it showed your video in third 😂😂
This was so awesome, thanks so much for pouring all the time, blood and syntax into it for us ^^
idk what it is but theos videos make me so ready & awake & never give up never back down
Literally started learning this stuff yesterday, seems made for me
I learn an incredible amount from these videos - thank you for everything you do!
Congrats on the React Status Cooperpress newsletter headline mention. Love your channel and the work you do
Damn bro, i learned a lot with this, now i have a greater overlook of how js works and the ecosystem around this language , ty so much
What a legend. Thank you sir for all the work you put into this. Something to learn here for any dev of any skill level!
Thanks!
Thank you Theo for this video.
Thanks for showing us how we should manage and succeed in every project. Y'all dev brothers, never forget to-do lists. They are crucial
Built a blog app with the help of this tutorial. Great vid, Theo.
thanks Theo, great vid!
at 1:40:45 - another approach that I like for breaking down changes into smaller commits is using VSCode Source Control tab to stage changes file by file (or line by line) for each commit
yeah you can use terminal for that but I also use vscode interface for that, super useful and a lot easier to visualize
Amazing guide. always learn a thing or 2 by walking through this
Theo you are a ROCKSTAR! I can barely contain my excitement to work through this tutorial. Thank you!
Not sure if anyone has come across this issue but: Whenever I delete and image and I redirect back to the root path redirect("/"); and then I want to click on another image to open it in the "modal" I can see the url change but nothing happens in the UI (i..e I am trying to open image on @modal/(.)image/[id]/ again, the screen just stays the same (homepage screen). I have to do a full page reload for it to work... not sure what I did wrong but struggling to debug this.
Came to comment cause I had a similar issue, I imagine it was the same cause but you noticed a different behaviour due to different versions.
The root problem is that redirect("/") does not cause the modal to dismiss itself properly, even though the path has changed and it should not stay up. I had this problem in 2 versions. In Next 14.2.4 the modal completely stays up even though redirect was called and the path is changed. So it's not dismissed at all. In Next 14.2.3 what you're describing happens: the modal is dismissed, but something breaks and we cannot open other images to see their modals.
I downgraded to 14.1.4, I think this is what Theo had in the video. It works. So it's a Next bug. For others having problems with deleting, try another Next version until it works. Easiest fix, unless you need specific Next versions.
And a side note. Though I can't remember what the issue was, something from an earlier part of the video forced me to downgrade from 14.2.4 to 14.2.3. A rule of thumb: if the code is the same as in the video but yours doesn't work, your Next version has a bug. Hope this helps
@@cosminvoinopol705 I ran into this issue too and this helped! Thank you so much
@@cosminvoinopol705 I was having the exact same issue with redirect("/") not dismissing the modal. Whenever I would delete an image, the app would crash because FullPageImageView would try to render the deleted image and throw an "Image not found" error.
By downgrading Next to 14.1.4, it works perfectly now. Hopefully Next can fix this bug in the modal. It's such a cool feature.
@@cosminvoinopol705 Thanks, this worked for me, I got really confused trying to debug this.
@@xmontarox85 This is it. Thanks for the comment :)
2mins 57 secs in and I already know this is going to be crazy. One time for Theo. U re the man. ❤
Thank you so much this is incredibly useful content!! Just as i decided like a week ago to take the plunge to learn a bit about next hahah ❤
@31:50 hit a roadblock here. You need to change the line at the top of app/page.tsx from import { db } from "@vercel/postgres";
to import { db } from "../server/db";
(which does the vercel import)
Thanks.
Far away our best tutorial since
Great tutorial btw, I'm starting to branch out towards next.js and react coming from Java and PHP (not together but from my last two jobs) so is extremely exciting to see how powerful all these tools are!
Wow, just started learning t3, very timely update! Thank you so much!
I rarely comment on any videos at all, but felt the need to say: "Thank you". Thank you :)
1:33:11 Funnily enough, I just implemented something similar with HTMX, using the HX-Request header to determine if it should return a full page or just the page element that got updated
1:40:45 Lol, glad I did not forget. I was already confused that you didn't show the commit part, but at first I thought you just cut it from the video :D
Oh wow! This is crazy, thank you for putting this out.
It was all worth it for the biscuits at the very end
This is a blessing fr
I’m so thankful that this exists
thats amazing. im doing it tomorrow and will come back here when i finish
Have you started yet
@@sirklattjust finishes now, really great tutorial. one of the best we have here at youtube.
really cool stuff, very well explained and would totally recommend
@@ustav_o I found it to be pretty ass but okay
Wow, you are providing a ton of useful advice! This is awesome. Thanks a lot Mr T3 :-)
Hey, I just wanted to thank you for this video. I've been working with react for almost 5 years, next for 3. I know a lot of what you've covered in this video already but it was really nice having such a thorough and comprehensive refresher. I was laid off about a year ago and I became really skeptical of the value of my React skillset after not being able to find a job for sometime and have been somewhat a drift in my personal projects and coding. I just want you to know you reignited a bit of my spark and love for React/Next and that I genuinely appreciate you content. Side note... from boston... can kickflip... but does he hardcore?
Thanks Theo. You are a gift.
00:25:00 Postgres supports multiple 'schema'. Similar to a prefix but more like a folder. Is this supported by t3 + drizzle?
I bet it's supported by drizzle. But maybe there's a limitation on the free vercel postgres.
at 29:00 i have my index.ts set up exactly like yours but the sql parameter is complaining...
Argument of type 'VercelPool & ((strings: TemplateStringsArray, ...values: Primitive[]) => Promise)' is not assignable to parameter of type 'Sql'.
Type 'VercelPool & ((strings: TemplateStringsArray, ...values: Primitive[]) => Promise)' is missing the following properties from type 'Sql': CLOSE, END, PostgresError, options, and 13 more.ts(2345)
ive tried restarting the TS server incase, and its weird because it seems fine, i may ts-ignore it for the moment unless something bad happens but yeah
nevermind im an idiot, the top line was not drizzle from vercel-postgres (it was postgres-js), changing it fixed it
@@TEHSOULREAPER you're not an idiot, it's a small difference that also took me a hot minute to spot!
@@evangroneman5408 yeah im now just getting an issue with production not uploading the image to db, at 1:09:00, getting a 401 reflected on uploadThing that im trying to debug, my middleware file is the same as his which is what it suggests it could be
so seems as though i was going to the build link of the site which didnt work, but going to the actual latest site one did, weird
1:36:40 (Parallel Routes section)
If your page changes when clicking the link instead of printing the ID on the page
-Make sure you have the default.tsx file
-Restart the dev server (what worked for me)
Damn I was actually watching the old tutorial, this came just at the right time :D Great content!
28:44 - I am getting the same thing and cant' seem to fix the error message. When I follow the steps and run dev I get "TypeError: Cannot set properties of undefined (setting '1184')" from that line. Anyone have the same issue, ideas?
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";
import { posts } from "./schema";
import * as schema from "./schema";
const sql = postgres({
host: process.env.POSTGRES_HOST,
port: 5432,
user: process.env.POSTGRES_USER,
password: process.env.POSTGRES_PASSWORD,
database: process.env.POSTGRES_DATABASE,
ssl: 'require'
});
export const db = drizzle(sql, { schema });
@@wabi3958 Hey thanks a lot man - I'll give that a bash 💪
Amazing walkthrough!!
learned a lot, disagreed with some of your strong opinions but they are appreciated.
Thanks
The sponsor stack
This is so cool, for someone getting started... Thank you.
I love when Theo teach, i just follow and finish it
amazing content
drizzle seems truly awesome
I'm happy you made this video, thank you
For those having an issue with it trying to getImage of the image you just deleted: check whether it only applies to parallel routes or also after hard navigating to that image. Ask yourself why that is. Search "next 14.2 parallel routes redirect workaround". The default.tsx just needs a page.tsx also returning a null. This has to do with how Next handles soft navigation. A few behaviors must have changed since this video was made, and the docs show a slightly different setup for the slot.
hero
Appreciate the solution!
Fantastic, cant wait to get stuck in !!!
For people struggling with posthog - just turn off adblock if you get cors error
Thank you! I was using Opera and was wondering what went wrong.
Looking great! Can't wait to see the next upload
Thanks Theo, it's a great tutorial!
if any of you having issues with parallel routing - firstly make sure you have the default in the @modal folder , then the page in the [id] folder. secondly , you will need to restart your dev server.
restarting did it for me! thanks! spent hours trying to figure this out.
Thank you! It works now
Mucho gusto good sir, didn't think to restart the dev server.
At the 1 hour 40 minute mark, you can do this:
const image = await getImage(+photoId);
with the plus sign to convert the photoId string into a number.
bad practice. make it easy to understand and readable, this is junior code
@@OnePercentAhead you confused by i++ ?
@@sovapid no that is well established in every major programming language in contrast to this implicit type conversion going on in your original code...
This is great, thanks for making it!
I had a warning after adding the @apply rule at 17:02 - VSCode said "Unknown at rule @apply". The fix is to install the PostCSS Language support extension. I kinda wish Leo would have gone over the VSCode extensions he uses.
Just started using Drizzle, gets a thumbs up from me.
Of course the typing's are a real +, but what I really like is that you can use composition to build your query's. eg. lets assume you have a complex sub query you want to say do an `inArray` with, you can then create a function and re-use in other query's, you could say it's a bit like Views but been able to use props, and of course still have strong typing's. Nice!!!!
Is it possible to disable the delete button while the action is being executed?
Was waiting for this, tyvm :D
hey, thanks for the vid!
i ran into a bug where when i delete in item, it redirects me normally.. but when i am trying to click on another item the modal wont open, the URL gets updated but i am still seeing the main page, even when i spam ping.
if i refresh i get normally to the specific image page.
anyone encountered this? i have tried to move the server action into its own .ts file and i have tried to play around with the modal components and the router.back() (switched to router push("/")) but nothing seems to make it work.
it seems like the server isn`t registering the "Get request" assisiated with the url change... why deleteing an image may cause that?
Fantastic tutorial! For someone who has never used TS/TW/analytics/ratelimiting....I managed to follow along just fine, and even understand, (i think) what was going on! Either way it works so thank you @t3dogg for such a great walkthrough
THE TUTORIAL WE ALL NEEDED !!!!
you really have to give Remix a try!
less overhead and feels like a simple express middleware.
32:43 my console log shows in the console when I do this, why would that be?
2:33:27 Hello, how does it break lines of code automatically
HELP! Has anyone run into an error when running the pnpm run db:push in the cli. It's at 30:59, I am getting a TypeError for some class in the nodemods for the drizzle-kit/bin.cjs file. Its pointing out "Request2 = class extends GlobalRequest {" I'm not really sure how to fix this? Here is the error: TypeError: Class extends value undefined is not a constructor or null
at node_modules/.pnpm/@hono+node-server@1.9.0/node_modules/@hono/node-server/dist/index.mjs Anything helps
figured it out had to change to node 18.17
Theo during copilot cli: I don't want AI anywhere near my terminal
Also Theo: *uses warp*
Awesome Tutorial! Thank you so much. Going to build a full blown recipe - App with that
Quality tutorial. Added this to my knowledge base.
More of this! More tutorials. More projects. More ShadcnUI component modifications. More interacting with databases and fetching different content. More State management tutorials (Zustand?). More Github Actions....
Get out of tutorial hell…
Hey theo. This is such a great video thank you :)