Giter Site home page Giter Site logo

developeramarish / multitenancy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codeprefect/multitenancy

0.0 0.0 0.0 82 KB

Proof of Concept for Database Per Tenant MultiTenant Architecture in ASP.NET Core

C# 87.61% CSS 2.63% JavaScript 0.43% HTML 9.33%

multitenancy's Introduction

ANNOUNCEMENT: This repo has been improved into a stand-alone library at TinySaas

MultiTenant Architecture in .NET Core (Database per Tenant)

This is a proof of concept for multi-tenant application architrecture in ASP.NET Core. The following features has been completed

  • Database instance per tenant
  • Entity framework code-first migration (must set-up default tenant on development)
  • Automatic migration on start-up
  • Custom themes
  • Missing Tenant Handler (redirects to default tenant)

How to install

git clone [email protected]:codeprefect/multitenancy.git multitenancy
cd multitenancy

# cd to src/multitenant or use VS Code tasks to restore and build

Dependencies

  • Default Tenant

Create a tenancy.json file in src/Multitenant based off sample-tenancy.json. The default tenant must be provided both in src/Multitenant/appsettings.json and src/Multitenant/Config/tenancy.json, In the appsettings.json case

"DefaultDatabase": {
      "ConnectionString": "DataSource=default.db",
      "Provider": "SQLITE"
  },
"DefaultTenantUrl": "https://default.tenancy.localhost",

ConnectionStrings.DefaultConnection must match a valid tenant ConnectionString and the DefaultTenantUrl must match the Host address of an existing tenant.

  • Test Tenants

Within the directory src/Multitenant/Config, you will find the sample tenancy.json file with a list of tenants with each sample defined like:

{
    "Id": 1,
    "Name": "Default",
    "Host": "default.tenancy.localhost",
    "ConnectionString": "db\\default.db",
    "Theme": "blue"
}

NOTE: The tenant Host url must resolve to a valid IP address, in my case localhost, For more information on the setup, see here.

With ๐Ÿ’“ from @codeprefect

multitenancy's People

Contributors

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