This is a Next.js project bootstrapped with create-next-app
.
Next.js - RBAC (Role Based Access Control) helps to setup a application, with roles and permissions. This boilerplate ships with RBAC database schema, utility functions for RBAC and very minimal or no components and styles.
Main functionalities are as follows,
- Setup Teams
- Setup Roles & Permissions for teams
- Assign roles to users
- prisma
- next-auth
next-auth is used login and session management in the project. This boilerplate ships with Google provider. But you can add more providers, refer next-auth docs for more info.
This boilerplate comes with prisma as the database Adapter. Refer to the prisma docs to connect to your database.
Following is an example for Postgres. Once you have a Database setup, add DATABASE_URL
to your env file.
DATABASE_URL"postgresql://mydbuser:123@localhost:5432/mydb?schema=public"
Once database setup is done, you can run the migration using prisma command.
npx prisma migrate dev
npm run dev
# or
yarn dev
# or
pnpm dev
Open http://localhost:3000 with your browser to see the result.
- Integrate next-auth
- Setup teams, roles and permissions
- Create guard (something like
can(user, 'PERMISSION_NAME')
) - Ability to invite users, accept/decline invites
- Switch teams
- Unit tests