Based on the understanding, Thrymr Team created a Technical Architecture & Database Schema for the User management.
Version 1.0
Description
Following points regarding JWT+Redis
JSON Web Tokens (JWT) :
...
Send User Credentials and Request for token
Verify Request URL
It connects to the Database and verifies the user credentials
Generate jwt token and return
Request for the resource (API) with jwt token in the header
Validate the token and Check the block list
Return the response
Save the token into a block list when the user logout
Database Schema V1.0
...
Database Schema V1.1
...
Table description
user Table: Table contains information about all users who has access to the platform
organisationorganization: This table stores information about all the organisationsorganizations
user_organization: This is a mapping table, It shows the user's organisationorganization/central. it's a many-to-one relation from the user table.
policy: This table contains the policies attached by the organisationorganization.
It's one-to-many relation from the organisation tableorganization 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
...
org_theam: It contains the organization brand color codes which will use for front-end page design.
Table & Reference
// 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
}
...