This is a nextjs starter preconfigured with next-auth, prisma db, tailwind css. It uses the new nextjs src/app directory project structure.
- We have used two route groups
(account)&(markeing)to group account/dashboard and general website pages in to different groups, so they can use diffrent layout.ts files. - All the account related pages are inside
(account)/appdirectory, which prefix those urls with/app. - All the authentication related pages are inside the
/authdirectory and they can use a seperate layout.ts file as well if needed. - We use Next.js middleware to prevent unauthenticated users from visting
/app/...urls. - Resouce creating actions will go in to services files (
lib/services/user.service.tsetc.).
- Rename .env.sample to .env
- Change DATABASE_URL value in .env to point it to the correct database
- Run
npx prisma db pushto migrate the database - Run
npx prisma db seedto seed the database with initial users. See prisma/seed.ts file for more info. - Run
yarn devto run the local server.