> ## Documentation Index
> Fetch the complete documentation index at: https://docs.staging.supersync.com.au/llms.txt
> Use this file to discover all available pages before exploring further.

# ERD ST-CORE

> Entity relationships

```mermaid
erDiagram                                                                                                                  
    %% ===== Core Tables Your App Uses =====                                                                               
    ALL_AUTH_RECIPE_USERS {                                                                                                
        string app_id PK                                                                                                   
        string tenant_id PK                                                                                                
        string user_id PK                                                                                                  
        string email                                                                                                       
        string phone                                                                                                       
        string recipe_id                                                                                                   
    }                                                                                                                      
                                                                                                                           
    PASSWORDLESS_USERS {                                                                                                   
        string app_id PK                                                                                                   
        string user_id PK                                                                                                  
        string email                                                                                                       
        string phone_number                                                                                                
    }                                                                                                                      
                                                                                                                           
    PASSWORDLESS_DEVICES {                                                                                                 
        string app_id PK                                                                                                   
        string tenant_id PK                                                                                                
        string device_id_hash PK                                                                                           
        string email                                                                                                       
    }                                                                                                                      
                                                                                                                           
    PASSWORDLESS_CODES {                                                                                                   
        string app_id PK                                                                                                   
        string tenant_id PK                                                                                                
        string code_id PK                                                                                                  
        string link_code_hash                                                                                              
    }                                                                                                                      
                                                                                                                           
    USER_ROLES {                                                                                                           
        string app_id PK                                                                                                   
        string tenant_id PK                                                                                                
        string user_id PK                                                                                                  
        string role PK                                                                                                     
    }                                                                                                                      
                                                                                                                           
    USER_METADATA {                                                                                                        
        string app_id PK                                                                                                   
        string user_id PK                                                                                                  
        string user_metadata                                                                                               
    }                                                                                                                      
                                                                                                                           
    SESSION_INFO {                                                                                                         
        string app_id PK                                                                                                   
        string tenant_id PK                                                                                                
        string session_handle PK                                                                                           
        string user_id                                                                                                     
    }                                                                                                                      
                                                                                                                           
    TENANTS {                                                                                                              
        string app_id PK                                                                                                   
        string tenant_id PK                                                                                                
    }                                                                                                                      
                                                                                                                           
    %% ===== Relationships Your App Uses =====                                                                             
    ALL_AUTH_RECIPE_USERS ||--o{ PASSWORDLESS_USERS : "passwordless_login"                                                 
    ALL_AUTH_RECIPE_USERS ||--o{ USER_ROLES : "has"                                                                        
    ALL_AUTH_RECIPE_USERS ||--o{ USER_METADATA : "stores_data"                                                             
    ALL_AUTH_RECIPE_USERS ||--o{ SESSION_INFO : "maintains_session"                                                        
    PASSWORDLESS_DEVICES ||--o{ PASSWORDLESS_CODES : "generates"                                                           
    TENANTS ||--o{ ALL_AUTH_RECIPE_USERS : "scopes"                                                                        
                                                                                                                    
```
