This is a quick reference guide for populating your SkillSwap app with test data before a presentation.
Windows:
.\clear-uploads.ps1Linux/Mac:
chmod +x clear-uploads.sh populate-photos.sh
./clear-uploads.shOption A: Use Helper Script
# Windows
.\populate-photos.ps1 -SourceDir "path/to/your/photos"# Linux/Mac
./populate-photos.sh "path/to/your/photos"Option B: Manually Add Photos
- Copy 8 photos to the
uploads/directory - Rename them to:
alice-profile.jpgbob-profile.jpgcharlie-profile.jpgdiana-profile.jpgemma-profile.jpgfrank-profile.jpggrace-profile.jpghenry-profile.jpg
Windows (PowerShell):
.\run-test-data.ps1Linux/Mac:
docker exec -i skillswap-db psql -U postgres -d skillswap < src/main/resources/test-data.sqlOr manually (PowerShell):
Get-Content src/main/resources/test-data.sql | docker exec -i skillswap-db psql -U postgres -d skillswapAfter running the SQL script, you'll have:
- 8 Test Users with emails like
alice.johnson@university.edu - 8 Complete Profiles with bios, majors, locations
- 24 Skills (3 per user - offering/seeking)
- 24 Interests (3 per user)
- 16 Organizations (2 per user)
- 8 Profile Photos (linked to profiles)
All test users have password hash hashed123. You'll need to update this with actual password hashes if you want to log in as these users.
Test Users:
- Alice Johnson - Computer Science, Junior
- Bob Smith - Business Administration, Senior
- Charlie Brown - Graphic Design, Sophomore
- Diana Prince - Mechanical Engineering, Freshman
- Emma Watson - Computer Science, Junior
- Frank Miller - Business Administration, Senior
- Grace Hopper - Graphic Design, Sophomore
- Henry Ford - Mechanical Engineering, Freshman
To start fresh:
# 1. Clear uploads
./clear-uploads.sh # or .\clear-uploads.ps1
# 2. Drop and recreate database (if needed)
docker exec -it skillswap-db psql -U postgres -d skillswap -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public;"
docker exec -i skillswap-db psql -U postgres -d skillswap < src/main/resources/schema.sql
# 3. Populate test data
# Windows:
.\run-test-data.ps1
# Linux/Mac:
docker exec -i skillswap-db psql -U postgres -d skillswap < src/main/resources/test-data.sqlSee populate-test-data.md for detailed instructions and all available options.