Skip to content

Serve multiple tenants using the same Adonis installation while keeping tenant specific data separated for fully independent multi-domain setups.

License

Notifications You must be signed in to change notification settings

brainnit/adonisjs-feud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AdonisJs Feud

Adonis Feud allows you to serve multiple tenants within the same Adonis application while keeping tenant specific data logically separated for fully independent multi-domain/SaaS setups.

Instalation

Use npm or yarn to install the package:

npm -i @brainnit/adonisjs-feud
# or
yarn add @brainnit/adonisjs-feud

Add Feud to the list of service providers at start/app.js:

const providers = [
  // ...
  '@brainnit/adonisjs-feud/providers/FeudProvider'
];

Setup

Copy config/index.js to your app config folder and name it feud.js. Don't forget to setup your environment variables.

Usage

Add @provider:Feud trait to your models and define only the methods you want to override to change default behaviour:

/** @type {typeof import('@adonisjs/lucid/src/Lucid/Model')} */
const Model = use('Model');

class User extends Model {
  static get traits () {
    return ['@provider:TenantAware']
  }
}

module.exports = Users

About

Serve multiple tenants using the same Adonis installation while keeping tenant specific data separated for fully independent multi-domain setups.

Resources

License

Stars

Watchers

Forks

Packages

No packages published