DEV Community

miljan
miljan

Posted on

Drizzle ORM, NextAuth and Supabase

In my last Drizzle article, I wrote about some performance problems related to Prisma and explained why Drizzle ORM might be a better solution for you. In that article, I also provided a step-by-step guide on how to set up Drizzle ORM with NextAuth and the PlanetScale database.

At that time, we didn't have an official Drizzle adapter for NextAuth, so things were a little bit tricky. However, since we now have an official Drizzle adapter for NextAuth, there's no need to create it manually.

In this article I will show you how to set up Drizzle ORM, NextAuth, and Supabase (also tRPC if you want it) with the next-kickstart CLI in just a couple of seconds!

Next Kickstart

Next-Kickstart is an opinionated Next.js 13 (App Router) CLI toolkit that contains everything you need for developing full-stack applications.

next-kickstart cli

With just one CLI command, you can add libraries like NextAuth, Drizzle, or tRPC to your Next.js project in seconds, with zero configuration. And yes, it's also ready for the edge!

It includes:

  • Next.js
  • TypeScript
  • tRPC
  • Drizzle ORM
  • NextAuth.js
  • Supabase
  • T3 Env
  • Tailwind CSS
  • ShadCN/ui
  • Zod
  • ESLint
  • Prettier

Init new app

To initialize a new next-kickstart application, run any of the following commands and respond to the command prompts:

npm

npx next-kickstart <folder name>
Enter fullscreen mode Exit fullscreen mode

pnpm

pnpm dlx next-kickstart <folder name>
Enter fullscreen mode Exit fullscreen mode

Add library

There is also an 'add' command. Let's say you have initialized a new next-kickstart project and initially selected to install Drizzle and NextAuth libraries. However, later on, you realize that you also need tRPC. There's no need for manual installation; all you have to do is run the following command:

npm

# npx next-kickstart add <library name>
# libraries available in add command are 
# shadcn, trpc, drizzle, nextauth

npx next-kickstart add trpc
Enter fullscreen mode Exit fullscreen mode

pnpm

# pnpm dlx next-kickstart add <library name>
# libraries available in add command are
# shadcn, trpc, drizzle, nextauth

pnpm dlx next-kickstart add trpc
Enter fullscreen mode Exit fullscreen mode

The documentation will be available soon. This project is being developed in public and is still in beta, so there may be some bugs. Feel free to test it if you like, and perhaps give it a star on GitHub. Contributions and pull requests are also welcome.

Happy hacking!

Top comments (0)