mirror of
https://github.com/bitbaum/orangecat.git
synced 2026-12-04 20:28:04 +01:00
- Bump version to 0.1.1 for tracking - Add webpack-bundle-optimizer script for Next.js config - Simplify ESLint configuration to resolve missing dependencies - Prepare for production deployment with proper version control This deployment includes: - Profile update fixes with banner_url support - LN address validation - Auth cookie fixes for profile updates - Various documentation and testing improvements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import 'dotenv/config'
|
|
import { createClient } from '@supabase/supabase-js'
|
|
|
|
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL!
|
|
const supabaseKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
|
|
|
|
const supabase = createClient(supabaseUrl, supabaseKey)
|
|
|
|
async function setupDatabase() {
|
|
try {
|
|
// REMOVED: console.log statement
|
|
|
|
// Sign in
|
|
const { error: signInError } = await supabase.auth.signInWithPassword({
|
|
email: 'butaeff@gmail.com',
|
|
password: process.env.USER_PASSWORD || 'your-password'
|
|
})
|
|
if (signInError) throw signInError
|
|
if (process.env.NODE_ENV === 'development') console.log('✅ Signed in')
|
|
|
|
// Create initial profile
|
|
const { data: { user }, error: userError } = await supabase.auth.getUser()
|
|
if (userError) throw userError
|
|
|
|
if (user) {
|
|
const { error: profileError } = await supabase
|
|
.from('profiles')
|
|
.upsert({
|
|
id: user.id,
|
|
username: user.email?.split('@')[0] || 'user',
|
|
created_at: new Date().toISOString(),
|
|
updated_at: new Date().toISOString()
|
|
})
|
|
if (profileError) throw profileError
|
|
// REMOVED: console.log statement
|
|
}
|
|
|
|
// REMOVED: console.log statement
|
|
} catch (error) {
|
|
console.error('Error setting up database:', error)
|
|
process.exit(1)
|
|
}
|
|
}
|
|
|
|
setupDatabase()
|