|
|
#!/bin/bash |
|
|
|
|
|
echo "π± Seeding Deployed Database" |
|
|
echo "==============================" |
|
|
echo "" |
|
|
echo "This script will help you seed your deployed backend database with initial data." |
|
|
echo "" |
|
|
|
|
|
|
|
|
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. Then run this command in your backend Space's terminal:" |
|
|
echo " npm run seed" |
|
|
echo "" |
|
|
echo "5. Or manually run:" |
|
|
echo " node seed-data.js" |
|
|
echo "" |
|
|
echo "π This will create:" |
|
|
echo " - Admin user: admin@example.com / admin123" |
|
|
echo " - Student user: student@example.com / student123" |
|
|
echo " - Tutorial tasks for Week 1" |
|
|
echo " - Weekly practice tasks for all 6 weeks" |
|
|
echo "" |
|
|
echo "π After seeding, you can:" |
|
|
echo " - Log in with the test accounts" |
|
|
echo " - See tutorial tasks and weekly practice content" |
|
|
echo " - Create submissions and test the voting system" |
|
|
echo "" |
|
|
echo "Would you like to proceed with the seeding instructions above?" |