A robust starter template for Next.js 13, integrated with Drizzle ORM and PlanetScale. This template provides a quick and seamless option to get up and running quickly.
nextjsserveractionshq.mp4
- Next.js App Router: The latest version of the popular React framework for server-rendered applications.
- Drizzle ORM: A modern and efficient ORM to manage database operations.
- PlanetScale: A scalable and serverless relational database.
- TailwindCSS: A utility-first CSS framework for rapid UI development.
- Server Actions: Utilize the experimental features of Next.js for better server-side operations.
- UseFormStatus: An experimental hook to manage form states.
- Node.js (v14 or newer)
- npm or Yarn
See the accompanying blog post for a more detail overview.
-
Clone the Repository
git clone https://github.com/tuffstuff9/nextjs-serveraction-drizzle-starter.git cd nextjs-serveraction-drizzle-starter
-
Install Dependencies
yarn install # or npm install
-
Setup Environment Variables
- Create a .env file
- Set up your PlanetScale database and add the
DATABASE_URL
to the.env
file. See here for further details on how to setup PlanetScale integration. - Modify the copied connection string by replacing
?sslaccept=strict
with?ssl={"rejectUnauthorized":true}
-
Run Migrations
yarn drizzle-kit push:mysql # or npm run drizzle-kit push:mysql
-
Start Development Server
yarn dev # or npm run dev
Now, you can open http://localhost:3000 in your browser to see your app in action!
This project is MIT licensed.