Enhance application structure: Add runtime configuration for environment variables, integrate new dependencies for Cloudinary and UI components, and refactor member management features including improved forms and member dashboard. Update styles and layout for better user experience.
This commit is contained in:
parent
6e7e27ac4e
commit
e4a0a9ab0f
61 changed files with 7902 additions and 950 deletions
44
scripts/seed-all.js
Normal file
44
scripts/seed-all.js
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import mongoose from 'mongoose'
|
||||
import { connectDB } from '../server/utils/mongoose.js'
|
||||
import dotenv from 'dotenv'
|
||||
|
||||
// Load environment variables
|
||||
dotenv.config()
|
||||
|
||||
// Import seed functions
|
||||
import { execSync } from 'child_process'
|
||||
|
||||
async function seedAll() {
|
||||
try {
|
||||
console.log('🌱 Starting database seeding...\n')
|
||||
|
||||
// Seed members
|
||||
console.log('👥 Seeding members...')
|
||||
execSync('node scripts/seed-members.js', { stdio: 'inherit' })
|
||||
|
||||
console.log('\n🎉 Seeding events...')
|
||||
execSync('node scripts/seed-events.js', { stdio: 'inherit' })
|
||||
|
||||
console.log('\n✅ All data seeded successfully!')
|
||||
console.log('\n📊 Database Summary:')
|
||||
|
||||
// Connect and show final counts
|
||||
await connectDB()
|
||||
|
||||
const Member = (await import('../server/models/member.js')).default
|
||||
const Event = (await import('../server/models/event.js')).default
|
||||
|
||||
const memberCount = await Member.countDocuments()
|
||||
const eventCount = await Event.countDocuments()
|
||||
|
||||
console.log(` Members: ${memberCount}`)
|
||||
console.log(` Events: ${eventCount}`)
|
||||
|
||||
process.exit(0)
|
||||
} catch (error) {
|
||||
console.error('❌ Error seeding database:', error)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
seedAll()
|
||||
Loading…
Add table
Add a link
Reference in a new issue