A multi-tenant user management system built with Next.js and NextAuth.js, featuring role-based access control, email authentication, and tenant management.
- User registration with email verification.
- Email and password login.
- Forgot and reset password.
- Social Login (Github).
- Multi-tenant support: Users belong to one or more organisation(tenant).
- Everyone can create an organisation (of which they will be an Admin).
- Organisations can be joined using invite codes, which can be generated by Admins (or other roles if the permission is granted).
- Predefined roles: Admin, Manager, and User.
- Powers granted to a role(Manager/User) can be changed by Admins.
- Admins can restrict certain parts of application from certain Roles.
- Admins (or other roles with powers) can invite, remove or change roles of users in the Organisation.
- Frontend: Next.js, ShadCN, TailwindCSS
- Authentication: Auth.js
- Database: PostgreSQL (Supabase), Prisma ORM
- Deployment: Vercel
- Deployed to Vercel: https://usernest-7lca.vercel.app/
-
Clone the repository:
git clone github.com/shivansh02/usernest cd usernest
-
Install dependencies:
npm install
-
Create .env:
- Copy shared environment veriables to .env in /usernest
-
Start dev server and head to http://localhost:3000
npm run dev
Note: You might notice slow speeds on localhost, but not on the deployed website. This latency is because of the Supabase DB location in US-East (set to decrease latency on deployment).