Giter Club home page Giter Club logo

multi-tenant-user-role-base-app's Introduction

Multi Tenant Role Based Access Control (RBAC) Authentication API

Multi-Tenant User-Role-Based Application

This is a multi-tenant user-role-based application written in Node.js, TypeScript, Fastify, PostgreSQL, and JWT. It allows you to create and manage multiple tenants, users, and roles. Each tenant is isolated from the others, and users can only access the resources of the tenant to which they belong.

Data structure

"data structure"

App structure

"app structure"

Features

  • Multi-tenancy: Each tenant has its own database schema and data.
  • User roles: Users can be assigned to different roles, each with its own permissions.
  • JWT authentication: Users are authenticated using JWT tokens.
  • Fastify: Fastify is a high-performance web framework for Node.js.
  • TypeScript: TypeScript is a superset of JavaScript that adds type safety and other features.
  • PostgreSQL: PostgreSQL is a powerful and reliable relational database management system.

Technology used

  • Dizzle ORM
  • Fastify
  • PostgresSQL
  • TypeScript

How to use

  1. Clone the repository.
  2. Install the dependencies:
    npm install
  1. Create a .env file with the following contents:
    DATABASE_CONNECTION=postgres://********:*********8*@ep-fragrant-dream-75256343-pooler.us-east-1.aws.neon.tech/neondb
    JWT_SECRET=secret
  1. Start the server:
    npm run dev

The server will be running on port 3000.

Conclusion

This multi-tenant user-role-based application is a powerful and flexible tool for managing multiple tenants, users, and roles. It is built using modern technologies and is easy to use.

multi-tenant-user-role-base-app's People

Contributors

morka17 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.