Тёмный

Next.js + Postgres Setup Walkthrough: Dev/Production 

Kevin Wade
Подписаться 2,9 тыс.
Просмотров 18 тыс.
50% 1

Complete walkthrough of how to set up Next.js with Postgres for both local development (with Docker Compose) and production (with Vercel Postgres). We'll set up Prisma as our ORM and Knex for migrations. We'll even hit a touch on React Server Components and the brand new Server Actions.
By the end of this video, you'll have a complete dev and prod Next.js with database set up and ready to go!
0:00 - Intro
0:33 - Initialize Next.js Project
1:11 - Switch NPM to PNPM
1:48 - Postgres in Docker Compose for Development
3:50 - Prisma ORM Setup
9:07 - Knex Migrations Setup
15:33 - Next.js page to load data
18:12 - Generate data with Server Action
28:38 - Vercel Postgres Setup for Production
35:45 - Outro
---
Resources:
GitHub repo for this video:
github.com/mrwade/next-starte...
Ultimate Node Stack 2023 blog post:
kevinwwwade.medium.com/the-ul...

Наука

Опубликовано:

 

6 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 19   
@bejaysus23
@bejaysus23 10 месяцев назад
Another great tutorial. Keep these coming 🙂
@vaniad555
@vaniad555 5 месяцев назад
Glad I came across your channel, thank you!
@pablotexeira7579
@pablotexeira7579 Год назад
that's amazing, great explanation. Keep up the good workm Kevin!!!!
@yogawithaaron
@yogawithaaron Месяц назад
Literally answered my exact question. I.e. how to deploy Vercel Postgres DB to production in a Next.js app. Ty ty ty!
@VincentFulco
@VincentFulco 7 месяцев назад
Great clear and practical teaching style.
@kevinwwwade
@kevinwwwade 5 месяцев назад
Thank you! ❤️
@dylancunningham4308
@dylancunningham4308 6 месяцев назад
Very concise tutorial! Thanks for that. I did have an issue where we started up the nextjs app with database collection. Something about `public.posts` is undefined in the postgres console. Solution for me was to run `pnpx prisma generate`.
@ths871
@ths871 9 месяцев назад
thank you man !
@berenjor
@berenjor 8 месяцев назад
This is a great tutorial! What I find confusing is that you're declaring the schema with Prisma but then you are running a migration with Knex, which seems rather a manual process. A small bit of feedback for future videos. The editor font size looks very small on YT, bigger would be easier to read.
@jalbers3150
@jalbers3150 9 месяцев назад
excellent tutorial
@kevinwwwade
@kevinwwwade 8 месяцев назад
Thank you! ☺️
@Null-ky4gx
@Null-ky4gx Месяц назад
hi what theme you use?
@myrez_
@myrez_ 9 месяцев назад
11:44 When I try to run this command, i get 'TS_NODE_COMPILER_OPTIONS' not recognized as an internal or external command, operable program or batch file
@kevinwwwade
@kevinwwwade 8 месяцев назад
Hmmm... sounds like you are on Windows. `TS_NODE_COMPILER_OPTIONS=...` prefixed to a command is a way to quickly set that environment variable for the life of a command on Mac/linux. Not sure off the top of my head how to do that on Windows, but maybe that gives you something to search for.
@milordmariusz
@milordmariusz 8 месяцев назад
"db:migrate:make": "set TS_NODE_COMPILER_OPTIONS={ \"module\": \"commonjs\" } && knex migrate:make"
@RealEstateandTechnology
@RealEstateandTechnology Месяц назад
every thing was going good, but buddy you should write a disclaimer for window's user :( .
@kevinwwwade
@kevinwwwade Месяц назад
I haven’t used windows in forever, so I don’t know what the issues would be. What did you experience? That would be helpful. Thanks!
@aaronbegy9857
@aaronbegy9857 Месяц назад
@@kevinwwwade windows gets the 'TS_NODE_COMPILER_OPTIONS' not recognized as an internal or external command. but as someone stated in the above comment you can change the package.json to "db:migrate:make": "set TS_NODE_COMPILER_OPTIONS={ \"module\": \"commonjs\" } && knex migrate:make" and it works :)
@ashimov1970
@ashimov1970 9 месяцев назад
I find Drizzle ORM much better than Prisma
Далее
10 common mistakes with the Next.js App Router
20:37
Просмотров 189 тыс.
Conquering fears and slippery slops on two wheels!
00:18
How to set up Prisma with Next.js and Postgres!
17:40
How to connect Next.js to a database (in 5 minutes)
5:04
Сложная распаковка iPhone 15
1:01
Просмотров 13 тыс.
Сложная распаковка iPhone 15
1:01
Просмотров 13 тыс.