RBAC in place. Tailwind CSS working.

This commit is contained in:
Alireza Vaezi
2025-07-17 12:10:23 -04:00
parent 06c2a7925f
commit b37c3a83bc
11 changed files with 1118 additions and 95 deletions

107
src/lib/supabase.ts Normal file
View File

@@ -0,0 +1,107 @@
import { createClient } from '@supabase/supabase-js'
// Local Supabase instance configuration
const supabaseUrl = 'http://127.0.0.1:54321'
const supabaseAnonKey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0'
export const supabase = createClient(supabaseUrl, supabaseAnonKey)
// Database types for TypeScript
export interface Database {
public: {
Tables: {
roles: {
Row: {
id: number
name: string
description: string | null
created_at: string
updated_at: string
}
Insert: {
id?: number
name: string
description?: string | null
created_at?: string
updated_at?: string
}
Update: {
id?: number
name?: string
description?: string | null
created_at?: string
updated_at?: string
}
}
user_profiles: {
Row: {
id: string
first_name: string | null
last_name: string | null
created_at: string
updated_at: string
}
Insert: {
id: string
first_name?: string | null
last_name?: string | null
created_at?: string
updated_at?: string
}
Update: {
id?: string
first_name?: string | null
last_name?: string | null
created_at?: string
updated_at?: string
}
}
user_roles: {
Row: {
id: number
user_id: string | null
role_id: number | null
created_at: string
updated_at: string
}
Insert: {
id?: number
user_id?: string | null
role_id?: number | null
created_at?: string
updated_at?: string
}
Update: {
id?: number
user_id?: string | null
role_id?: number | null
created_at?: string
updated_at?: string
}
}
}
Views: {
[_ in never]: never
}
Functions: {
get_user_roles: {
Args: {
user_uuid: string
}
Returns: {
role_name: string
}[]
}
user_has_role: {
Args: {
user_uuid: string
role_name: string
}
Returns: boolean
}
}
Enums: {
[_ in never]: never
}
}
}