Staging Database Setup
Single Script Approachโ
We now have one consolidated script that seeds the entire staging database with all required entities.
๐ Script Locationโ
src/app/api/init-staging-complete/route.ts
๐ฏ What It Seedsโ
The consolidated script automatically seeds:
-
๐ฅ Users (27 total)
- 3 Admin users (with permissions, departments)
- 6 Guardian users (with rescue experience, specialties)
- 12 Regular users (with donation stats)
- 3 Investor users
- 3 Partner users
- 4 Waitlist users
- 2 Waitlist guardians
-
๐ Cases (10 total)
- Pet rescue cases with Firebase Storage images
- Complete case details (medical needs, adoption status, etc.)
- Linked to guardian users
-
๐ฅ Follows (User subscriptions to cases)
- Each user follows 2-5 cases
- Realistic follow relationships
-
๐ฐ Donations (36 total)
- Stellar wallet integration with MoonPay
- ARS and USD currencies with conversion to XLM
- Case-based and direct guardian donations
- Automatic user stats calculation
๐ Usageโ
Start the development server:
npm run dev
Seed the staging database:
# PowerShell
Invoke-WebRequest -Uri "http://localhost:5000/api/init-staging-complete" -Method POST -ContentType "application/json"
# cURL
curl -X POST http://localhost:5000/api/init-staging-complete -H "Content-Type: application/json"
๐ Expected Resultsโ
After running the script, you should see:
- โ 27 users with complete profiles and donation stats
- โ 10 cases with Firebase Storage images
- โ 36 donations with Stellar wallet integration
- โ Follow relationships between users and cases
- โ All user fields populated (donationCount, totalDonated, lastActive, location)
๐ง Featuresโ
- Firebase Storage Images: All cases have proper Firebase Storage image URLs
- Stellar Wallet Integration: Donations use MoonPay with ARS/USD to XLM conversion
- Realistic Data: All data is realistic and follows the platform's business logic
- Complete User Profiles: All users have all required fields for proper UI display
- Automatic Stats: User donation stats are calculated automatically from donations
๐งน Cleanupโ
The old individual scripts have been removed:
- โ
init-staging - โ
init-comprehensive-staging - โ
init-staging-with-images - โ
init-donations-staging
Only use the consolidated script: /api/init-staging-complete