feat: Add stale process monitor, users route, landing page, archive old scripts
- Add backend stale process monitoring API (/api/stale-processes) - Add users management route - Add frontend landing page and stale process monitor UI on /scraper-tools - Move old development scripts to backend/archive/ - Update frontend build with new features 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
74
backend/archive/add-sol-flower-stores.ts
Normal file
74
backend/archive/add-sol-flower-stores.ts
Normal file
@@ -0,0 +1,74 @@
|
||||
import { pool } from './src/db/migrate';
|
||||
|
||||
const solFlowerStores = [
|
||||
{
|
||||
name: 'Sol Flower - Sun City',
|
||||
slug: 'sol-flower-sun-city',
|
||||
dutchie_url: 'https://dutchie.com/dispensary/sol-flower-dispensary',
|
||||
},
|
||||
{
|
||||
name: 'Sol Flower - South Tucson',
|
||||
slug: 'sol-flower-south-tucson',
|
||||
dutchie_url: 'https://dutchie.com/dispensary/sol-flower-dispensary-south-tucson',
|
||||
},
|
||||
{
|
||||
name: 'Sol Flower - North Tucson',
|
||||
slug: 'sol-flower-north-tucson',
|
||||
dutchie_url: 'https://dutchie.com/dispensary/sol-flower-dispensary-north-tucson',
|
||||
},
|
||||
{
|
||||
name: 'Sol Flower - McClintock (Tempe)',
|
||||
slug: 'sol-flower-mcclintock',
|
||||
dutchie_url: 'https://dutchie.com/dispensary/sol-flower-dispensary-mcclintock',
|
||||
},
|
||||
{
|
||||
name: 'Sol Flower - Deer Valley (Phoenix)',
|
||||
slug: 'sol-flower-deer-valley',
|
||||
dutchie_url: 'https://dutchie.com/dispensary/sol-flower-dispensary-deer-valley',
|
||||
},
|
||||
];
|
||||
|
||||
async function addSolFlowerStores() {
|
||||
console.log('🌻 Adding Sol Flower stores to database...\n');
|
||||
|
||||
try {
|
||||
for (const store of solFlowerStores) {
|
||||
// Check if store already exists
|
||||
const existing = await pool.query(
|
||||
'SELECT id FROM stores WHERE slug = $1',
|
||||
[store.slug]
|
||||
);
|
||||
|
||||
if (existing.rows.length > 0) {
|
||||
console.log(`⏭️ Skipping ${store.name} - already exists (ID: ${existing.rows[0].id})`);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Insert store
|
||||
const result = await pool.query(
|
||||
`INSERT INTO stores (name, slug, dutchie_url, active, scrape_enabled, logo_url)
|
||||
VALUES ($1, $2, $3, true, true, $4)
|
||||
RETURNING id`,
|
||||
[store.name, store.slug, store.dutchie_url, 'https://dutchie.com/favicon.ico']
|
||||
);
|
||||
|
||||
console.log(`✅ Added ${store.name} (ID: ${result.rows[0].id})`);
|
||||
}
|
||||
|
||||
console.log('\n✅ All Sol Flower stores added successfully!');
|
||||
|
||||
// Show all stores
|
||||
console.log('\n📊 All stores in database:');
|
||||
const allStores = await pool.query(
|
||||
'SELECT id, name, dutchie_url FROM stores ORDER BY id'
|
||||
);
|
||||
console.table(allStores.rows);
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ Error:', error);
|
||||
} finally {
|
||||
await pool.end();
|
||||
}
|
||||
}
|
||||
|
||||
addSolFlowerStores();
|
||||
Reference in New Issue
Block a user