Skip to content

shivansh02/usernest

Repository files navigation

Usernest

A multi-tenant user management system built with Next.js and NextAuth.js, featuring role-based access control, email authentication, and tenant management.

Features

User Authentication

  • User registration with email verification.
  • Email and password login.
  • Forgot and reset password.
  • Social Login (Github).

Tenant Management

  • 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).

Role-Based Access Control (RBAC)

  • 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.

Technical Stack

  • Frontend: Next.js, ShadCN, TailwindCSS
  • Authentication: Auth.js
  • Database: PostgreSQL (Supabase), Prisma ORM
  • Deployment: Vercel

Deployment

How to Run

  1. Clone the repository:

    git clone github.com/shivansh02/usernest
    cd usernest
    
  2. Install dependencies:

    npm install
    
  3. Create .env:

    • Copy shared environment veriables to .env in /usernest
  4. 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).

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published