* health check

* Update Dockerfile

* simplifying the deployment

* Update Bot.js

makes the find team command public

* test (#9)

* Dev (#7)

* health check

* Update Dockerfile

* simplifying the deployment

* Dev (#8)

* health check

* Update Dockerfile

* simplifying the deployment

* Update Bot.js

makes the find team command public

* Update PlayerService.js

* massive update????

could break stuff

* Update Bot.js

update
This commit is contained in:
VinceC
2025-07-07 21:38:19 -05:00
committed by GitHub
parent 0c86148835
commit 3453be6947
1742 changed files with 28844 additions and 67711 deletions

View File

@@ -0,0 +1,92 @@
require('dotenv').config();
const { createClient } = require('@supabase/supabase-js');
async function testConnection() {
const supabaseUrl = process.env.SUPABASE_URL;
const supabaseKey = process.env.SUPABASE_KEY;
console.log('🔍 Testing Supabase Connection...\n');
console.log('URL:', supabaseUrl);
console.log('Key (first 20 chars):', supabaseKey?.substring(0, 20) + '...\n');
if (!supabaseUrl || !supabaseKey) {
console.error('❌ Missing Supabase configuration in .env file');
return;
}
// Create client
const supabase = createClient(supabaseUrl, supabaseKey, {
auth: {
autoRefreshToken: false,
persistSession: false
},
global: {
headers: {
'apikey': supabaseKey
}
}
});
console.log('✅ Supabase client created');
// Test 1: Simple connection test
console.log('\n📡 Test 1: Basic connection...');
try {
const { data, error } = await supabase
.from('games')
.select('count');
if (error) {
console.error('❌ Connection failed:', error.message);
return false;
} else {
console.log('✅ Connection successful!');
}
} catch (err) {
console.error('❌ Exception during connection:', err.message);
return false;
}
// Test 2: Check if tables exist
console.log('\n📡 Test 2: Checking tables...');
const tables = ['games', 'servers', 'server_game_preferences'];
for (const table of tables) {
try {
const { data, error } = await supabase
.from(table)
.select('count')
.limit(1);
if (error) {
console.error(`❌ Table '${table}' not accessible:`, error.message);
} else {
console.log(`✅ Table '${table}' exists and accessible`);
}
} catch (err) {
console.error(`❌ Exception checking table '${table}':`, err.message);
}
}
// Test 3: Check current data
console.log('\n📡 Test 3: Checking existing data...');
try {
const { data: games, error } = await supabase
.from('games')
.select('name, active');
if (error) {
console.error('❌ Could not fetch games:', error.message);
} else {
console.log(`✅ Found ${games.length} existing games:`);
games.forEach(game => console.log(` - ${game.name} (active: ${game.active})`));
}
} catch (err) {
console.error('❌ Exception fetching games:', err.message);
}
console.log('\n🎉 Connection test completed!');
return true;
}
testConnection().catch(console.error);

63
src/tests/testSupabase.js Normal file
View File

@@ -0,0 +1,63 @@
require('dotenv').config();
const { createClient } = require('@supabase/supabase-js');
async function testSupabase() {
const supabaseUrl = process.env.SUPABASE_URL;
const supabaseKey = process.env.SUPABASE_KEY;
console.log('🔍 Debug Info:');
console.log('URL:', supabaseUrl);
console.log('Key (first 50 chars):', supabaseKey?.substring(0, 50) + '...');
console.log('Full Key:', supabaseKey);
console.log('');
// Test 1: Basic connection
console.log('📡 Test 1: Basic client creation...');
const supabase = createClient(supabaseUrl, supabaseKey, {
auth: {
autoRefreshToken: false,
persistSession: false
},
global: {
headers: {
'apikey': supabaseKey
}
}
});
// Test 2: Simple query
console.log('📡 Test 2: Simple query...');
try {
const { data, error } = await supabase
.from('games')
.select('count');
if (error) {
console.error('❌ Query Error:', error);
} else {
console.log('✅ Query Success:', data);
}
} catch (err) {
console.error('❌ Exception:', err.message);
}
// Test 3: Try with different URL format
console.log('📡 Test 3: Try with /rest/v1 URL...');
const supabase2 = createClient(supabaseUrl + '/rest/v1', supabaseKey);
try {
const { data, error } = await supabase2
.from('games')
.select('count');
if (error) {
console.error('❌ Query Error (with /rest/v1):', error);
} else {
console.log('✅ Query Success (with /rest/v1):', data);
}
} catch (err) {
console.error('❌ Exception (with /rest/v1):', err.message);
}
}
testSupabase().catch(console.error);