Member-only story
Handle Form on NextJs 14 using Server Action and Drizzle ORM
NextJs 14 already use Server Action stable version and this post will guide you to handle form using server action
6 min readDec 2, 2023
One of the features NextJs 14 offered is server action which has received a stable version. This post will cover how to handle validation form, store and get data from database and get state form.
Prerequisite:
- Next 14
- Zod
- Drizzle ORM
- Drizzle Kit
- Postgres
- Supabase
To install this prerequisite run this command
// Next 14
npx create-next-app@latest
// Zod
npm install zod
// Drizzle ORM, Kit and Postgres
npm install drizzle-orm postgres
npm install -D drizzle-kit
After install the prerequisite we can start to build UI for the app
Step 1: Building UI
In this step we will guide you to create component like input
, button
and table