Skip to content

KK-9684/nextjs-auth-postgres-template

Repository files navigation

This is a starter project for using ZenStack with Next.js and Next Auth.

It's extended from Prisma's Next.js Starter.

Getting Started

First create a project from this starter:

npx create-next-app [project-name] --use-npm -e https://github.com/zenstackhq/nextjs-auth-postgres-template

cd [project-name]

Run ZenStack generator:

npm run generate

Set a postgres connection string to DATABASE_URL in .env:

DATABASE_URL="postgres://postgres:[YOUR-PASSWORD]@[YOUR-URL]/postgres"

Sync schema with database

npm run db:push

Finally it's time to run your app locally:

npm run dev

Code Structure

Data Model

The data model is located at /zenstack/schema.zmodel.

Next-Auth Integration

You can find integration with Next-Auth at /pages/api/auth/[...nextauth].ts.

Mounted Data Services

The generated RESTful data access services are mounted at: /pages/api/zenstack/[...path].ts.

Learn More

To learn more about ZenStack, take a look at the following resources:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published