# TurboTrades - Quick Start Guide Get your TurboTrades marketplace up and running in minutes! ## 📦 What You'll Need - Node.js 18+ installed - MongoDB 5.0+ installed and running - Steam API Key ([Get one here](https://steamcommunity.com/dev/apikey)) - A code editor (VS Code recommended) ## 🚀 Quick Setup (5 Minutes) ### Step 1: Backend Setup ```bash # Navigate to project root cd TurboTrades # Install backend dependencies npm install # Create environment file cp .env.example .env ``` Edit `.env` with your credentials: ```env MONGODB_URI=mongodb://localhost:27017/turbotrades STEAM_API_KEY=YOUR_STEAM_API_KEY_HERE SESSION_SECRET=your-random-secret-here JWT_ACCESS_SECRET=your-jwt-access-secret JWT_REFRESH_SECRET=your-jwt-refresh-secret PORT=3000 NODE_ENV=development ``` ```bash # Start MongoDB (if not already running) mongod # Start backend server npm run dev ``` Backend will be running at `http://localhost:3000` ✅ ### Step 2: Frontend Setup Open a **new terminal window**: ```bash # Navigate to frontend directory cd TurboTrades/frontend # Install frontend dependencies npm install # Start development server npm run dev ``` Frontend will be running at `http://localhost:5173` ✅ ### Step 3: Open Your Browser Visit `http://localhost:5173` and you're ready to go! 🎉 ## 🔑 First Login 1. Click the **"Sign in through Steam"** button in the navigation bar 2. Authorize with your Steam account 3. You'll be redirected back to the marketplace 4. Your profile will appear in the top-right corner ## 🎯 Quick Feature Tour ### Browse Marketplace - Go to `/market` to see all items - Use filters to narrow down results - Click any item to view details ### Set Up Your Profile 1. Click your avatar → **Profile** 2. Add your **Steam Trade URL** (required for trading) 3. Optionally add your email for notifications ### Deposit Funds (UI Only - Mock) 1. Go to **Profile** → **Deposit** 2. Select amount and payment method 3. Click "Continue to Payment" ### Sell Items (Coming Soon) 1. Go to **Sell** page 2. Select items from your Steam inventory 3. Set prices and list on marketplace ## 🛠️ Project Structure Overview ``` TurboTrades/ ├── backend (Node.js + Fastify) │ ├── index.js # Main server file │ ├── models/ # MongoDB schemas │ ├── routes/ # API endpoints │ ├── middleware/ # Auth & validation │ └── utils/ # WebSocket, JWT, etc. │ └── frontend (Vue 3 + Vite) ├── src/ │ ├── views/ # Page components │ ├── components/ # Reusable components │ ├── stores/ # Pinia state management │ ├── router/ # Vue Router config │ └── assets/ # CSS & images └── index.html # Entry point ``` ## 📡 API Endpoints ### Authentication - `GET /auth/steam` - Initiate Steam login - `GET /auth/me` - Get current user - `POST /auth/logout` - Logout - `POST /auth/refresh` - Refresh access token ### User Management - `GET /user/profile` - Get user profile - `PATCH /user/trade-url` - Update trade URL - `PATCH /user/email` - Update email - `GET /user/balance` - Get balance ### WebSocket - `WS /ws` - WebSocket connection for real-time updates ## 🌐 WebSocket Events The frontend automatically connects to WebSocket for real-time updates: ### Client → Server ```javascript { type: 'ping' } // Keep-alive heartbeat ``` ### Server → Client ```javascript { type: 'connected', data: { userId, timestamp } } { type: 'pong', timestamp } { type: 'notification', data: { message } } { type: 'balance_update', data: { balance } } { type: 'listing_update', data: { itemId, price } } { type: 'price_update', data: { itemId, newPrice } } ``` ## 🎨 Design System ### Colors - **Primary Orange**: `#f58700` - **Dark Background**: `#0f1923` - **Surface**: `#151d28` - **Accent Blue**: `#3b82f6` - **Accent Green**: `#10b981` - **Accent Red**: `#ef4444` ### Component Classes ```html