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.
- 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.
- Dizzle ORM
- Fastify
- PostgresSQL
- TypeScript
- Clone the repository.
- Install the dependencies:
npm install
- 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
- Start the server:
npm run dev
The server will be running on port 3000.
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.