#!/bin/bash echo "🌱 Database Seeding Helper" echo "==========================" echo "" echo "This script will help you seed your deployed backend database." echo "" # Check if backend is responding BACKEND_URL="https://linguabot-transcreation-backend.hf.space" echo "🔍 Testing backend connection..." if curl -s "$BACKEND_URL/health" > /dev/null; then echo "✅ Backend is responding" else echo "❌ Backend is not responding. Please check your backend URL." exit 1 fi echo "" echo "📋 To seed your deployed database, you need to:" echo "" echo "1. Go to your Hugging Face Space: https://huggingface.co/spaces/linguabot/transcreation-backend" echo "2. Go to Settings → Repository secrets" echo "3. Make sure you have MONGODB_URI set with your MongoDB Atlas connection string" echo "" echo "4. Upload the seed-database.js file to your backend Space" echo "5. Go to the Space's terminal and run:" echo " npm run seed" echo "" echo "5. Or if you prefer, you can run it directly:" echo " node seed-database.js" echo "" echo "📊 This will create:" echo " 👤 Admin user: admin@example.com / admin123" echo " 👤 Student user: student@example.com / student123" echo " 📚 Tutorial tasks: 3 tasks for Week 1" echo " 📝 Weekly practice: 6 tasks for Week 1" echo " 📖 Practice examples: 4 examples" echo "" echo "🔗 After seeding, you can:" echo " 1. Log in with admin@example.com / admin123" echo " 2. Log in with student@example.com / student123" echo " 3. View tutorial tasks and weekly practice" echo " 4. Create submissions and test the voting system" echo "" echo "⚠️ Note: Make sure your MONGODB_URI environment variable is set correctly in your Space settings."