# Phase F1 Visual Guide - What You Can See **Frontend URL**: `http://localhost:3000` (after running `npm run dev`) --- ## 🎨 Pages Available ### 1. **Home Page** - `/` **File**: `pages/index.vue` **Guest View** (not logged in): ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ SBA Stratomatic Baseball Association β”‚ ← Header (blue) β”‚ [Login] β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ Welcome to SBA Experience real-time multiplayer baseball simulation powered by Strat-O-Matic ⚾ 🎲 πŸ‘₯ Real-Time Strategic Multiplayer Gameplay Decisions & Spectator [Get Started Button] β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Β© 2025 Stratomatic Baseball Association β”‚ ← Footer β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` **Authenticated View** (logged in): ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ SBA Stratomatic Baseball [usernameβ–Ύ] β”‚ β”‚ [Games] [Logout] β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ Welcome back, [username]! Ready to play some baseball? β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ + Create β”‚ β”‚ πŸ“‹ My β”‚ β”‚ πŸ‘₯ My β”‚ β”‚ Game β”‚ β”‚ Games β”‚ β”‚ Teams β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ Recent Activity β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ No recent activity yet... β”‚ β”‚ Create your first game to get started! β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` --- ### 2. **Login Page** - `/auth/login` **File**: `pages/auth/login.vue` ``` ╔═════════════════════════╗ β•‘ β•‘ β•‘ SBA β•‘ ← Large logo β•‘ β•‘ β•‘ Welcome Back β•‘ β•‘ Sign in to access β•‘ β•‘ your games β•‘ β•‘ β•‘ β•‘ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β•‘ β•‘ β”‚ [Discord Logo] β”‚ β•‘ ← Discord button β•‘ β”‚ Continue with β”‚ β•‘ (purple #5865F2) β•‘ β”‚ Discord β”‚ β•‘ β•‘ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β•‘ β•‘ β•‘ β•‘ Terms β€’ Privacy Policy β•‘ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• ← Back to Home ``` **Features**: - Beautiful gradient background (blue) - Discord branding (official color) - Loading spinner when clicked - Error messages display if OAuth fails --- ### 3. **OAuth Callback** - `/auth/callback` **File**: `pages/auth/callback.vue` **While Processing**: ``` ╔═════════════════════════╗ β•‘ β•‘ β•‘ ⟳ Spinning β•‘ ← Animated spinner β•‘ β•‘ β•‘ Authenticating... β•‘ β•‘ Please wait while we β•‘ β•‘ complete your sign in β•‘ β•‘ β•‘ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• ``` **On Success**: ``` ╔═════════════════════════╗ β•‘ β•‘ β•‘ βœ“ Checkmark β•‘ ← Green checkmark β•‘ β•‘ β•‘ Sign In Successful! β•‘ β•‘ Redirecting you now... β•‘ β•‘ β•‘ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• ``` **On Error**: ``` ╔═════════════════════════╗ β•‘ β•‘ β•‘ βœ— X Icon β•‘ ← Red X β•‘ β•‘ β•‘ Authentication Failed β•‘ β•‘ [Error message here] β•‘ β•‘ β•‘ β•‘ [Try Again Button] β•‘ β•‘ β•‘ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• ``` --- ### 4. **Games List** - `/games` **File**: `pages/games/index.vue` **Protected**: Requires login ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ SBA Stratomatic Baseball [usernameβ–Ύ] β”‚ β”‚ [Games] [Logout] β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ My Games [Create New Game] View and manage your active and completed games [Active Games] [Completed] ════════════ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ πŸ“‹ β”‚ β”‚ No Active Games β”‚ β”‚ β”‚ β”‚ You don't have any active games right β”‚ β”‚ now. Create a new game to get started! β”‚ β”‚ β”‚ β”‚ [Create Your First Game] β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` --- ### 5. **Create Game** - `/games/create` **File**: `pages/games/create.vue` **Protected**: Requires login ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ SBA Stratomatic Baseball [usernameβ–Ύ] β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ Create New Game Set up a new game to play with friends ╔═══════════════════════════════════════════╗ β•‘ Game Name β•‘ β•‘ [Enter a name for this game............ ]β•‘ β•‘ β•‘ β•‘ Home Team β•‘ β•‘ [Select home team β–Ύ] β•‘ β•‘ β•‘ β•‘ Away Team β•‘ β•‘ [Select away team β–Ύ] β•‘ β•‘ β•‘ β•‘ Game Mode β•‘ β•‘ β—‹ Human vs Human β•‘ β•‘ Play against another player β•‘ β•‘ β—‹ Human vs AI β•‘ β•‘ Play against the computer β•‘ β•‘ β•‘ β•‘ [Cancel] [Create Game] β•‘ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• ℹ️ Coming in Phase F6 This is a placeholder form. Full game creation will be implemented in Phase F6. ``` --- ### 6. **Game View** - `/games/[id]` **File**: `pages/games/[id].vue` **Protected**: Requires login **Layout**: Uses `game.vue` layout (dark theme) ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ ← Back to Games SBA 🟒 Connected β”‚ ← Dark header β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ Game game-123 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Away β”‚ β”‚ Inning β”‚ β”‚ Home β”‚ β”‚ 0 β”‚ β”‚ 1 β”‚ β”‚ 0 β”‚ β”‚ β”‚ β”‚ Top β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Game State β”‚ β”‚ Play-by-Play β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ Outs: 0 β”‚ β”‚ No plays yet β”‚ β”‚ Balls: 0 β”‚ β”‚ Game will β”‚ β”‚ Strikes: 0 β”‚ β”‚ start soon β”‚ β”‚ Runners: βšͺβšͺβšͺβ”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ Actions [Roll Dice] [Set Defense] [Set Offense] ℹ️ Phase F2 Coming Soon Full game interface will be implemented in Phase F2 with real-time updates. ``` --- ## 🎨 Design Features You Can See ### Color Scheme (SBA) - **Primary Blue**: `#1e40af` (header, buttons, links) - **Secondary**: Grays for text and backgrounds - **Success**: Green for positive actions - **Error**: Red for errors - **Warning**: Yellow/orange for warnings ### Responsive Breakpoints - **Mobile**: 375px+ (default) - **Tablet**: 768px+ (md:) - **Desktop**: 1024px+ (lg:) ### Interactive Elements - βœ… Hover effects on all buttons and links - βœ… Loading spinners for async operations - βœ… Smooth transitions (0.3s) - βœ… Shadow effects on cards - βœ… Discord button with official branding ### Typography - **Headings**: Bold, clear hierarchy - **Body**: Gray-600 for secondary text - **Buttons**: Semibold, clear labels --- ## πŸ”„ State Management You Can Test ### Authentication Flow 1. Visit `/auth/login` 2. Click "Continue with Discord" 3. (Will redirect to Discord OAuth - requires Discord app setup) 4. After auth, redirected back with user data 5. User data stored in localStorage 6. Navigation shows username 7. Protected routes accessible ### Route Protection 1. Try to access `/games` while logged out 2. Should redirect to `/auth/login?redirect=/games` 3. After login, should redirect back to `/games` ### Layout Switching 1. Visit `/` or `/games` β†’ Uses `default.vue` layout 2. Visit `/games/123` β†’ Uses `game.vue` layout (dark theme) --- ## πŸ§ͺ How to Test Locally ### 1. Start Dev Server ```bash cd /mnt/NV2/Development/strat-gameplay-webapp/frontend-sba npm run dev ``` Visit: `http://localhost:3000` ### 2. Test Navigation - βœ… Home page loads - βœ… Click "Login" β†’ Goes to `/auth/login` - βœ… Click "Back to Home" β†’ Returns to `/` - βœ… Try accessing `/games` β†’ Redirects to login ### 3. Test Store (Dev Tools) Open browser console: ```javascript // Access Pinia stores const authStore = useAuthStore() const gameStore = useGameStore() const uiStore = useUiStore() // Check state console.log(authStore.isAuthenticated) console.log(gameStore.gameState) console.log(uiStore.toasts) ``` ### 4. Test Responsive Design - Open browser dev tools - Toggle device toolbar - Test at 375px (iPhone), 768px (iPad), 1024px (Desktop) - All pages should be fully responsive --- ## πŸ“Έ What to Screenshot 1. **Home page** (guest view) 2. **Login page** with Discord button 3. **Home page** (mocked auth view - you'd need to mock auth store) 4. **Games list** with empty state 5. **Create game form** 6. **Game view** placeholder 7. **Mobile view** of any page (375px width) --- ## ⚠️ Current Limitations ### Backend Not Connected - Discord OAuth requires backend setup - Can mock auth by setting localStorage: ```javascript localStorage.setItem('auth_token', 'mock-token') localStorage.setItem('user', JSON.stringify({ id: '123', username: 'TestUser', discriminator: '0001', avatar: null, email: 'test@example.com' })) ``` ### Placeholder Data - Games list is empty (Phase F6 will add API) - Game view is placeholder (Phase F2 will implement) - Create game doesn't save (Phase F6) ### What Works - βœ… All page routing - βœ… Layout switching - βœ… Auth middleware redirects - βœ… Store state management - βœ… Responsive design - βœ… UI components render --- ## 🎯 To Fully Test Auth Flow You'll need to: 1. Set up Discord OAuth app (get client ID) 2. Configure backend OAuth endpoint 3. Update `nuxt.config.ts` with Discord credentials 4. Start backend server 5. Then full OAuth flow works **OR** mock it for testing: ```javascript // In browser console after loading app const authStore = useAuthStore() authStore.setAuth({ access_token: 'mock-token', refresh_token: 'mock-refresh', expires_in: 3600, user: { id: '123456789', username: 'TestUser', discriminator: '0001', avatar: null, email: 'test@example.com' } }) ``` --- **Summary**: Phase F1 provides a complete, navigable frontend with 8 pages, 2 layouts, full routing, auth middleware, and beautiful UI. Everything renders and works - it just needs backend integration (Phases F6-F9) to have real data!