Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Based on the understanding, Thrymr Team created a Technical Architecture & Database Schema for the User management.

Version 1.0

Image RemovedImage Added

Description

Following points regarding JWT+Redis
JSON Web Tokens (JWT) :

...

Pros and cons

(plus)

Advantages
Why Redis:

(plus)

Disadvantage:

...

SSO Architecture

...

SSO Architecture flow description:

  1. Send User Credentials and Request for token

  2. Verify Request URL

  3. It connects to the Database and verifies the user credentials

  4. Generate jwt token and return

  5. Request for the resource (API) with jwt token in the header

  6. Validate the token and Check the block list

  7. Return the response

  8. Save the token into a block list when the user logout

Database Schema

...

Vineet Singh DB schema added above. Please share your commentsV1.0

...

Database Schema V1.1

...

Table description

  • user Table: Table contains information about all users who has access to the platform

  • organisation: This table stores information about all the organisations

  • user_organization: This is a mapping table, It shows the user's organisation/central. it's a many-to-one relation from the user table.

  • policy: This table contains the policies attached by the organisation.
    It's one-to-many relation from the organisation table.

  • role: Its a master table and it contains all user roles

  • menu: It contains all pages in the application

  • pages: it contain all subpages of a menu(One menu can have multiple submenus)

  • role_permission: This table contains permissions, each role has a collection of page/menu-wise permissions. so that we have added menu and role references to this table.

  • team: it contains team header level information

  • team_memeber: it a mapping of team members and team.

  • signup_info: This table contains the invitation URLs which has been sent for signup into the platform.

Tables and References

//// -- LEVEL 1

// Creating tables

Table user as u {
id long [pk, increment] // auto-increment
first_name varchar
last_name varchar
email varchar [unique]
phone_number int [unique]
password varchar
profile_image_ref varchar //s3 References
role_id long
created_by long
updated_by long
}

Table role as r {
id long [pk]
name varchar
}

Ref: u.role_id > r.id

Table organization as org {
id long [pk]
name varchar
url varchar
logo_ref varchar
}
Table org_theam as theam {
id long [pk]
organization_id long [ref: > org.id]
brand_clr_code_1 varchar
brand_clr_code_2 varchar
}

Table policy as p {
id long [pk]
organization_id long [ref: > org.id]
policyterm varchar
policy_doc_ref varchar
}

table user_organization {
user_id long [ref: > http://u.id ]
organization_id long [ref: > org.id]
}

table menu as m {
id long [pk]
name varchar
action varchar
}

table page as pg {
id long [pk]
menu_id long [ref: > m.id]
name varchar
}

table role_permission {
role_id long [ref: > r.id]
page_id long [ref:> pg.id]
permission varchar
}

table signup_info {
id long [pk]
user_id long [ref: > http://u.id ]
email varchar
url varchar
expire_time timestamp
}

table team as t{
id long [pk]
admin_id long [ref: > http://u.id ]
type varchar
}

table team_member {
team_id long [ref: < t.id]
member_id long [ref: > http://u.id ]
}