Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alyssonbarrera/next-saas-rbac
Projeto SaaS Next.js RBAC
https://github.com/alyssonbarrera/next-saas-rbac
casl fastify monorepo multitenancy nextjs nodejs postgresql prisma rbac react-query shadcn-ui tailwindcss turborepo
Last synced: 2 months ago
JSON representation
Projeto SaaS Next.js RBAC
- Host: GitHub
- URL: https://github.com/alyssonbarrera/next-saas-rbac
- Owner: alyssonbarrera
- Created: 2024-09-14T12:02:37.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-09-26T13:27:01.000Z (3 months ago)
- Last Synced: 2024-09-29T07:20:57.028Z (3 months ago)
- Topics: casl, fastify, monorepo, multitenancy, nextjs, nodejs, postgresql, prisma, rbac, react-query, shadcn-ui, tailwindcss, turborepo
- Language: TypeScript
- Homepage:
- Size: 2.36 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Next.js SaaS + RBAC
This project contains all the necessary boilerplate to setup a multi-tenant SaaS with Next.js including authentication and RBAC authorization.
## Features
### Authentication
- [x] It should be able to authenticate using e-mail & password;
- [x] It should be able to authenticate using Github account;
- [x] It should be able to recover password using e-mail;
- [x] It should be able to create an account (e-mail, name and password);### Organizations
- [x] It should be able to create a new organization;
- [x] It should be able to get organizations to which the user belongs;
- [x] It should be able to update an organization;
- [x] It should be able to shutdown an organization;
- [x] It should be able to transfer organization ownership;### Invites
- [x] It should be able to invite a new member (e-mail, role);
- [x] It should be able to accept an invite;
- [x] It should be able to revoke a pending invite;### Members
- [x] It should be able to get organization members;
- [x] It should be able to update a member role;### Projects
- [x] It should be able to get projects within a organization;
- [x] It should be able to create a new project (name, url, description);
- [x] It should be able to update a project (name, url, description);
- [x] It should be able to get project details;
- [x] It should be able to delete a project;### Billing
- [x] It should be able to get billing details for organization ($20 per project / $10 per member excluding billing role);
## RBAC
Roles & permissions.
### Roles
- Owner (count as administrator)
- Administrator
- Member
- Billing (one per organization)
- Anonymous### Permissions table
| | Administrator | Member | Billing | Anonymous |
| ------------------------ | ------------- | ------ | ------- | --------- |
| Update organization | ✅ | ❌ | ❌ | ❌ |
| Delete organization | ✅ | ❌ | ❌ | ❌ |
| Invite a member | ✅ | ❌ | ❌ | ❌ |
| Revoke an invite | ✅ | ❌ | ❌ | ❌ |
| List members | ✅ | ✅ | ✅ | ❌ |
| Transfer ownership | ⚠️ | ❌ | ❌ | ❌ |
| Update member role | ✅ | ❌ | ❌ | ❌ |
| Delete member | ✅ | ⚠️ | ❌ | ❌ |
| List projects | ✅ | ✅ | ✅ | ❌ |
| Create a new project | ✅ | ✅ | ❌ | ❌ |
| Update a project | ✅ | ⚠️ | ❌ | ❌ |
| Delete a project | ✅ | ⚠️ | ❌ | ❌ |
| Get billing details | ✅ | ❌ | ✅ | ❌ |
| Export billing details | ✅ | ❌ | ✅ | ❌ |> ✅ = allowed
> ❌ = not allowed
> ⚠️ = allowed w/ conditions#### Conditions
- Only owners may transfer organization ownership;
- Only administrators and project authors may update/delete the project;
- Members can leave their own organization.## Screenshots
## Video
https://github.com/user-attachments/assets/db1b600d-e86c-46fc-8d21-243f069691f0