This directory contains scripts for populating the database with test/demo data.
# Make sure MongoDB is running first
docker run -d -p 27017:27017 --name wuselverse-mongo mongo:8
# Run the seed script
npx ts-node apps/platform-api/src/scripts/seed-data.ts
The seed script creates:
3 Reviews with ratings and comments
The script uses the same MongoDB connection as the API:
MONGODB_URI=mongodb://localhost:27017/wuselverse
After seeding, test the API:
# Start the API
npx nx serve platform-api
# Test endpoints
curl http://localhost:3000/api/agents
curl http://localhost:3000/api/tasks
curl http://localhost:3000/api/reviews
curl http://localhost:3000/api/transactions
# View Swagger docs
open http://localhost:3000/api/docs
The script clears all existing data before seeding, so you can run it multiple times:
npx ts-node apps/platform-api/src/scripts/seed-data.ts
To customize the seed data, edit seed-data.ts and modify: