Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A working template with auth using nextjs, nextauth, prisma, tailwindcss and react query
Next.js Fullstack Template is a boilerplate starter that combines Next.js, Tailwind CSS, Prisma, NextAuth, React Hook Form, Zod, React Toastify, and React Query into a single working fullstack authentication template. The repository is a personal starter created by its owner to accelerate project bootstrapping, but it is publicly available for anyone to clone and adapt.
The template is a pre-configured Next.js application that ships with authentication and database integration already wired together. As input, it takes environment variables defined in an .env file (modeled on env.example) and a Prisma schema; as output, it produces a Next.js app with role-based access control, multiple login methods, and a queryable database layer. It runs on any Node.js host that supports Next.js, and uses Prisma to connect to a database — the author uses Supabase for hosting, but any database supported by Prisma can be configured by editing schema.prisma.
schema.prisma; tables are created with npx prisma migrate dev --name init, and the client is generated with npx prisma generate.The setup process is documented in the readme. You install dependencies with yarn install, create an .env file (the author notes that Prisma in this template reads .env rather than .env.local), and then populate .env using the values from env.example. Next, you run npx prisma migrate dev --name init to create the database tables defined in schema.prisma, and finally npx prisma generate to create the Prisma client so the ORM can query the database.
The readme includes additional guidance for working with Prisma: set the DATABASE_URL in .env to point to an existing database; if the database has no tables, follow the Prisma getting-started guide; use prisma db pull to turn an existing database schema into a Prisma schema; and run prisma generate to generate the Prisma Client for querying. This makes the template adaptable to existing data models as well as greenfield projects.