feat: enhance Navbar with user profile and configuration links

- Updated Navbar component to include a link to the configuration page.
- Added a new Settings icon and link for user configuration.
- Improved user session handling and UI updates based on authentication state.

feat: implement OnboardingDialog for user setup

- Created OnboardingDialog component to guide users through initial setup.
- Added functionality to collect additional email addresses during onboarding.
- Integrated toast notifications for error handling during email addition.

feat: extend Supabase admin functions for user management

- Added functions to retrieve user IDs and full user information by email.
- Implemented error handling and logging for database operations.

feat: update Supabase schema with new user features

- Created new tables: user_profiles, additional_emails, and email_processing_usage.
- Enabled Row Level Security (RLS) on new tables with appropriate policies.
- Added triggers and functions for automatic user profile creation and email usage tracking.

feat: create public users table for simplified access

- Established a public.users table to mirror relevant auth.users data.
- Implemented triggers to automatically populate public.users upon user creation.
- Set up RLS policies to restrict access to user data.

chore: add configuration files for Supabase local development

- Included .gitignore and config.toml for local Supabase setup.
- Configured email testing server and other development settings.

feat: add configuration page for user settings

- Created configuration.astro page to manage user settings.
- Integrated AuthGuard to protect the configuration route.
This commit is contained in:
2025-06-07 04:37:03 -03:00
parent d37509338e
commit 0d2ab87519
17 changed files with 1584 additions and 101 deletions

View File

@@ -9,6 +9,12 @@ if (!supabaseUrl || !supabaseAnonKey) {
export const supabase = createClient(supabaseUrl, supabaseAnonKey);
export type User = {
id: string;
email: string;
created_at: string;
};
export type Debt = {
id: string;
created_at: string;
@@ -19,6 +25,10 @@ export type Debt = {
status: 'received' | 'negotiating' | 'settled' | 'failed' | 'opted_out';
negotiated_plan: string | null;
projected_savings: number;
user_id: string;
description?: string | null;
due_date?: string | null;
metadata?: Record<string, any> | null;
};
export type AuditLog = {
@@ -27,4 +37,33 @@ export type AuditLog = {
debt_id: string;
action: string;
details: Record<string, any>;
};
export type UserProfile = {
id: string;
user_id: string;
created_at: string;
updated_at: string;
onboarding_completed: boolean;
first_login_at: string | null;
email_processing_limit: number;
};
export type AdditionalEmail = {
id: string;
user_id: string;
email_address: string;
verified: boolean;
verification_token: string | null;
created_at: string;
updated_at: string;
};
export type EmailProcessingUsage = {
id: string;
user_id: string;
month_year: string;
emails_processed: number;
created_at: string;
updated_at: string;
};