Files
TurboTrades/QUICK_START_FIXES.md
2026-01-10 04:57:43 +00:00

5.6 KiB

Quick Start Guide - Testing Market & Sell Fixes

🚀 Get Started in 5 Minutes

Step 1: Set Up Steam API Key (2 minutes)

  1. Get your API key from SteamAPIs.com:

  2. Add to your .env file:

    # Open .env file in TurboTrades root directory
    # Add this line:
    STEAM_API_KEY=your_api_key_here
    

Step 2: Restart Backend (30 seconds)

# Stop current backend (Ctrl+C)
# Start again:
npm run dev

You should see in the logs:

✅ Server running on http://localhost:3000

Step 3: Restart Frontend (30 seconds)

# In frontend directory
cd frontend
npm run dev

You should see:

  ➜  Local:   http://localhost:5173/

Step 4: Test Market Page (1 minute)

  1. Open browser: http://localhost:5173/market
  2. Items should load from database
  3. Try filtering by game (CS2/Rust)
  4. Try searching for items
  5. Try sorting options

If you see infinite loading:

  • Check browser console for errors
  • Check backend logs
  • Make sure backend is running on port 3000

Step 5: Test Sell Page (2 minutes)

  1. Login with Steam:

    • Click "Login" button
    • Authenticate via Steam
    • You'll be redirected back
  2. Make your Steam inventory public:

    • Open Steam client
    • Profile → Edit Profile → Privacy Settings
    • Set "Game details" and "Inventory" to Public
  3. Set your Trade URL (optional for testing):

  4. Navigate to Sell page:

    • Go to http://localhost:5173/sell
    • Should load your CS2 inventory automatically
    • Items should appear with images and prices
  5. Test selling:

    • Click items to select them
    • Click "Sell Selected Items"
    • Confirm in the modal
    • Balance should update
    • Items removed from inventory

🐛 Troubleshooting

Market Page Not Loading

Problem: Infinite loading spinner

Check:

  1. Browser console - any errors?
  2. Backend logs - is it receiving requests?
  3. Database - are there items in the database?

Fix:

# Seed some items to the database
node seed.js

Sell Page Shows Error

Error: "STEAM_API_KEY not configured"

  • Make sure you added STEAM_API_KEY to .env
  • Restart the backend server

Error: "Steam inventory is private"

  • Go to Steam → Profile → Privacy Settings
  • Make inventory Public

Error: "Failed to fetch Steam inventory"

  • Check if SteamAPIs.com is working
  • Verify your API key is correct
  • Check backend logs for detailed error

No Items in Inventory

If your real inventory is empty:

  1. Switch game (CS2 ↔ Rust)
  2. Or use a test Steam account with items

What Should Work Now

Market Page

  • Loads items from database
  • Shows game, price, rarity, wear
  • Filtering by game, rarity, wear, price
  • Search functionality
  • Sorting (price, name, date)
  • Pagination
  • Click to view item details

Sell Page

  • Fetches real Steam inventory
  • Shows CS2 and Rust items
  • Automatic price calculation
  • Item selection system
  • Game filter (CS2/Rust)
  • Search items
  • Sort by price/name
  • Pagination
  • Trade URL validation
  • Sell confirmation modal
  • Balance updates after sale
  • WebSocket notifications

📝 Quick Test Script

Run this to verify everything is working:

# 1. Check if backend is running
curl http://localhost:3000/api/health

# 2. Check if market items endpoint works
curl http://localhost:3000/api/market/items

# 3. Check Steam inventory endpoint (need to be logged in)
# Open browser console on http://localhost:5173 after login:
fetch('/api/inventory/steam?game=cs2', {
  credentials: 'include'
}).then(r => r.json()).then(console.log)

🎯 Expected Results

Market Page

✅ Loads in < 2 seconds
✅ Shows items with images
✅ Filters work instantly
✅ Pagination works

Sell Page

✅ Loads inventory in 3-5 seconds
✅ Shows item images and prices
✅ Can select multiple items
✅ Shows total value
✅ Selling updates balance
✅ Items disappear after sale

🔧 Configuration Check

Run this checklist:

  • .env has STEAM_API_KEY
  • Backend running on port 3000
  • Frontend running on port 5173
  • MongoDB is running
  • Logged in via Steam
  • Steam inventory is public
  • Have items in CS2 or Rust inventory

📞 Still Having Issues?

Check Backend Logs

Look for these messages:

✅ All plugins registered
✅ All routes registered
✅ Server running on http://localhost:3000

Check Browser Console

Press F12 → Console tab

Look for:

  • API errors (red text)
  • Network requests (Network tab)
  • Cookie issues

Verify API Calls

Network tab should show:

GET /api/market/items → 200 OK
GET /api/inventory/steam?game=cs2 → 200 OK
POST /api/inventory/price → 200 OK
POST /api/inventory/sell → 200 OK

🎉 Success Indicators

You'll know it's working when:

  1. Market page:

    • Shows items immediately
    • No infinite loading
    • Items have images and prices
  2. Sell page:

    • Loads your inventory
    • Shows estimated prices
    • Can select items
    • Selling updates balance

📚 More Info

  • Full setup: STEAM_API_SETUP.md
  • Detailed fixes: MARKET_SELL_FIXES.md
  • API docs: API_ENDPOINTS.md

Last Updated: 2024
Estimated Time: 5-10 minutes
Difficulty: Easy