mirror of
https://github.com/FranP-code/inbox-negotiator.git
synced 2025-10-13 00:42:26 +00:00
0d2ab87519f47cb2617dad4a311e305a0c9e716b
- 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.
Inbox Negotiator
An AI-powered system that automatically negotiates debt collections and billing disputes through email processing.
Features
- AI Email Processing: Automatically parses incoming emails to extract debt information using Google's Gemini AI
- Automated Negotiation: Triggers negotiation workflows for legitimate debt collection notices
- Webhook Integration: Seamlessly processes emails through Postmark webhook integration
- Row Level Security: Secure database operations with proper authentication handling
Environment Setup
Copy .env.example to .env and configure the following variables:
# Supabase Configuration
SUPABASE_URL=your_supabase_url_here
SUPABASE_ANON_KEY=your_supabase_anon_key_here
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key_here
# Google Generative AI API Key for Gemini model
GOOGLE_GENERATIVE_AI_API_KEY=your_google_api_key_here
Required Environment Variables
SUPABASE_URL: Your Supabase project URLSUPABASE_ANON_KEY: Supabase anonymous key for client-side operationsSUPABASE_SERVICE_ROLE_KEY: Supabase service role key for server-side operations (bypasses RLS)GOOGLE_GENERATIVE_AI_API_KEY: Google API key for AI processing
Webhook Configuration
The /api/postmark endpoint handles incoming email webhooks from Postmark. It:
- Validates incoming email data
- Processes opt-out requests
- Uses AI to extract debt information
- Stores processed data in Supabase
- Triggers automated negotiation workflows
RLS (Row Level Security) Handling
The webhook uses a service role client to bypass RLS policies, ensuring server-side operations can write to the database without user authentication. This is essential for webhook operations where no user session exists.
Development
# Install dependencies
pnpm install
# Start development server
pnpm dev
Deployment
Ensure all environment variables are configured in your deployment environment, especially the SUPABASE_SERVICE_ROLE_KEY which is critical for webhook operations.
Description
Languages
TypeScript
90.3%
Astro
3.5%
PLpgSQL
3.3%
Shell
1.9%
JavaScript
0.6%
Other
0.4%