initial commit: project completion with proper gitignore

This commit is contained in:
AyrisAI
2026-05-16 00:43:22 +03:00
commit e708ba2156
84 changed files with 11035 additions and 0 deletions

36
check_db.mjs Normal file
View File

@@ -0,0 +1,36 @@
import postgres from 'postgres';
const DATABASE_URL = "postgres://postgres:xGhPj4IuE5VocaxUoYAj1dSr2xf6M3hh3c2C6YbnB7ZOeVJLRvmL0mzCbhvf14dh@65.109.236.58:8392/postgres";
const sql = postgres(DATABASE_URL);
async function checkDb() {
try {
console.log('Connecting to database...');
const settings = await sql`SELECT * FROM settings LIMIT 1`;
const servicesCount = await sql`SELECT COUNT(*) FROM services`;
const projectsCount = await sql`SELECT COUNT(*) FROM projects`;
const leadsCount = await sql`SELECT COUNT(*) FROM leads`;
console.log('\n--- Database Connection Successful ---');
console.log('Settings:', settings[0]);
console.log('Services Count:', servicesCount[0].count);
console.log('Projects Count:', projectsCount[0].count);
console.log('Leads Count:', leadsCount[0].count);
if (parseInt(projectsCount[0].count) > 0) {
const projects = await sql`SELECT title, category FROM projects LIMIT 5`;
console.log('\n--- Recent Projects ---');
console.table(projects);
}
await sql.end();
process.exit(0);
} catch (error) {
console.error('Database connection error:', error);
process.exit(1);
}
}
checkDb();