This example is based on Forms with Next.js and Server Actions published by Next.js, with the following additions:
- Using shadcn/ui
- Some components
- Dark mode
- Using Tailwind CSS
- Implementing form reset
First, create .env.local
in the root and set your Vercel Postgres secrets to it:
POSTGRES_URL="************"
POSTGRES_PRISMA_URL="************"
POSTGRES_URL_NON_POOLING="************"
POSTGRES_USER="************"
POSTGRES_HOST="************"
POSTGRES_PASSWORD="************"
POSTGRES_DATABASE="************"
Then, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.