Moving to github

This commit is contained in:
2026-03-28 19:24:29 -04:00
commit 036fa7ab33
302 changed files with 17838 additions and 0 deletions

238
docs/DEMO_ACCOUNT.md Normal file
View File

@@ -0,0 +1,238 @@
# Demo Account for Development 🎮
## Quick Login
**Development Demo Account:**
```
Email: demo@turbovault.com
Password: password123
```
Visit: http://localhost:3000/login
## What's Included
The demo account is automatically created when you run `task setup` or `task db:seed` in development mode.
### Sample Data
**12 Games** across multiple platforms:
- Nintendo 64: Ocarina of Time, Super Mario 64, GoldenEye 007
- SNES: Super Metroid
- Nintendo Switch: Breath of the Wild, Hades, Stardew Valley
- PlayStation 5: Elden Ring, Cyberpunk 2077
- PlayStation 2: Final Fantasy VII
- PC: Hollow Knight, Portal 2
**4 Collections:**
- **Nintendo Games** - All Nintendo platform games (root collection)
- **N64 Classics** - Best N64 games (subcollection)
- **All-Time Favorites** - Top-rated games
- **To Play** - Backlog games
**Various Data:**
- ✅ Different completion statuses (Completed, Playing, Backlog, On Hold)
- ✅ Physical games with conditions (CIB, Loose, Sealed)
- ✅ Digital games with store info (Steam, PlayStation Store, eShop)
- ✅ User ratings (1-5 stars)
- ✅ Storage locations (Shelf A, Shelf B)
- ✅ Purchase prices ($9.99 - $85.00)
- ✅ Notes and descriptions
- ✅ Games organized in multiple collections
## When to Use Demo Account
### Good For:
- ✅ Quick testing during development
- ✅ Demonstrating features
- ✅ Testing bulk operations (already has games to select)
- ✅ Verifying collection organization
- ✅ Testing filters and search (has varied data)
- ✅ Screenshot/documentation creation
### Create Your Own Account For:
- Testing registration flow
- Testing empty state UI
- Testing first-time user experience
- Building your actual collection
## How It Works
### First Time Setup
```bash
task setup
```
This runs `rails db:seed` which creates:
1. Platforms (31 gaming platforms)
2. Genres (30 game genres)
3. Demo user
4. Demo collections
5. Sample games
### Subsequent Runs
The seed file is smart:
- Won't duplicate the demo user if it exists
- Won't duplicate games if demo user has any
- Safe to run `rails db:seed` multiple times
### Reset Demo Data
If you want to reset the demo account:
```bash
# Option 1: Reset entire database
task db:reset
# This drops, creates, migrates, and re-seeds everything
# Option 2: Delete just the demo user
rails console
> User.find_by(email: 'demo@turbovault.com')&.destroy
> exit
rails db:seed
```
## Credentials Shown
The demo credentials are displayed:
1. **In the terminal** when you run `task dev`
2. **On the login page** (development only - green box)
3. **After seeding** - shows confirmation
## Security Note
**Development Only:**
- The demo account is ONLY created in development mode
- Will NOT be created in production
- Safe to commit seed file to git
**Production:**
```ruby
if Rails.env.development?
# Demo user only created here
end
```
## API Testing
The demo user can also be used for API testing:
```bash
# 1. Create an API token via the web UI
# Login as demo@turbovault.com → Settings → API Tokens
# 2. Or create via console
rails console
> user = User.find_by(email: 'demo@turbovault.com')
> token = user.api_tokens.create!(name: "Testing")
> puts token.token
```
## Tips
### View All Demo Data
```ruby
rails console
> demo = User.find_by(email: 'demo@turbovault.com')
> puts "Games: #{demo.games.count}"
> puts "Collections: #{demo.collections.count}"
> demo.games.each { |g| puts "- #{g.title} (#{g.platform.name})" }
```
### Quick Links After Login
- Dashboard: http://localhost:3000/dashboard
- All Games: http://localhost:3000/games
- Collections: http://localhost:3000/collections
- Settings: http://localhost:3000/settings
### Test Bulk Operations
1. Login as demo user
2. Go to Games list
3. Select multiple games (checkboxes appear)
4. Click "Bulk Edit" button
5. Update collections, status, location, etc.
### Test Filters
The demo data includes games with:
- Multiple platforms (N64, SNES, Switch, PS5, PS2, PC)
- Multiple genres (Action, Adventure, RPG, Platformer, etc.)
- All completion statuses
- Both physical and digital formats
- Various ratings
Perfect for testing search and filter functionality!
## Troubleshooting
### Demo user not created?
```bash
# Check environment
rails console
> Rails.env
=> "development" # Should be development
# Re-run seeds
rails db:seed
```
### Demo user exists but no games?
```bash
rails console
> demo = User.find_by(email: 'demo@turbovault.com')
> demo.games.destroy_all # Clear existing
> exit
rails db:seed # Re-create sample games
```
### Can't login?
- Email: `demo@turbovault.com` (exact spelling)
- Password: `password123` (all lowercase)
- Make sure database is migrated: `rails db:migrate`
### Want fresh demo data?
```bash
task db:reset
# Drops DB, recreates, migrates, seeds everything fresh
```
## Sample Collection Structure
```
Nintendo Games (5 games)
├─ N64 Classics (3 games)
│ ├─ The Legend of Zelda: Ocarina of Time
│ ├─ Super Mario 64
│ └─ GoldenEye 007
├─ Breath of the Wild
├─ Hades
├─ Stardew Valley
└─ Super Metroid
All-Time Favorites (9 games)
├─ Ocarina of Time
├─ Super Mario 64
├─ Elden Ring
├─ Breath of the Wild
├─ Super Metroid
├─ Hollow Knight
├─ Portal 2
├─ Hades
└─ Stardew Valley
To Play (2 games)
├─ Final Fantasy VII
└─ Cyberpunk 2077
```
## Summary
The demo account gives you a fully populated TurboVault instance instantly:
- ✅ 12 diverse games
- ✅ 4 collections with relationships
- ✅ Realistic data (prices, locations, notes)
- ✅ All completion statuses represented
- ✅ Both physical and digital games
- ✅ Perfect for testing and demos
Just run `task dev` and login! 🚀