GithubHelp home page GithubHelp logo

mahisat / multi-tenant-node-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from daniccan/multi-tenant-node-app

0.0 1.0 0.0 422 KB

POC of Multi-Tenant REST Application Built on top of NodeJS

JavaScript 100.00%

multi-tenant-node-app's Introduction

multi-tenant-node-app

What is this?

This is a proof-of-concept (POC), multi-tenant RESTful Web Services application built on top of NodeJS.

Get Started

  • Install dependencies.
npm install
  • Verify the Database configuration in config/config.json.
  • Run migrations on the main database.
npx sequelize-cli db:migrate
  • Start the application.
npm start
  • Perform API requests.

APIs

HTTP Headers

  • For APIs other than Signup and Authentication, pass the JWT Token in the Authorization header of the request.
Authorization: Bearer <JWT Token>
  • For APIs other than Signup, pass the Tenant ID in the X-TENANT-ID custom header of the request.
X-TENANT-ID: <Tenant ID>

Signup

  • POST /api/v1/accounts/signup
{
  "name": "Alphabet",
  "domain": "alphabet.com",
  "firstName": "John",
  "lastName": "Doe",
  "email": "[email protected]",
  "password": "5f4dcc3b5aa765d61d8327deb882cf99"
}

Authentication

  • POST /api/v1/auth/login
{
  "email": "[email protected]",
  "password": "5f4dcc3b5aa765d61d8327deb882cf99"
}

Organizations

  • GET /api/v1/organizations

  • GET /api/v1/organizations/:organizationId

  • POST /api/v1/organizations

{
  "name": "Google",
  "domain": "google.com"
}
  • DELETE /api/v1/organizations/:organizationId

Users

  • GET /api/v1/users

  • GET /api/v1/users/:userId

  • POST /api/v1/users

{
  "firstName": "John",
  "lastName": "Doe",
  "email": "[email protected]",
  "password": "5f4dcc3b5aa765d61d8327deb882cf99"
}
  • DELETE /api/v1/users/:userId

Libraries

multi-tenant-node-app's People

Contributors

daniccan avatar dependabot[bot] avatar mccp-dssc avatar

Watchers

James Cloos 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.