# Pokedex Online A modern React + Vite web application for exploring comprehensive PokΓ©mon data with advanced search, filtering, and comparison tools. ## 🌟 Status **βœ… Production Ready** - All 106 tests passing, fully functional. See [PROGRESS.md](PROGRESS.md) for detailed development status. ## Features - **Advanced Search** - Find PokΓ©mon by name with autocomplete (optimized with Web Workers) - **Detailed Info Cards** - Complete stats, moves, abilities, and evolution chains - **Type Effectiveness** - Interactive matrix showing type matchups - **Comparison Tool** - Compare multiple PokΓ©mon side-by-side - **Smart Filtering** - Filter by type, generation, stats, and abilities - **Dark Mode** - Full theme support with system preference detection - **Bookmarks** - Save favorite PokΓ©mon for quick access - **Responsive Design** - Optimized for mobile, tablet, and desktop - **Fast Performance** - Lazy loading, code splitting, and efficient caching - **Accessible** - WCAG 2.1 Level AA compliance, keyboard navigation ## πŸš€ Quick Start ### Prerequisites - Node.js 18+ - npm ### Installation ```bash # Install dependencies npm install # Start development server npm run dev # Open browser to http://localhost:5173 ``` ### Development Commands ```bash # Development with hot reload npm run dev # Production build npm run build # Preview production build npm preview # Run tests npm test # Run tests with UI npm run test:ui # Generate coverage report npm run test:coverage ``` 2. **Option 2: Environment-based** - Create `.env` file (see Environment Setup section below) for CI/CD or shared development ### Environment Setup (Optional) If you prefer environment variables: ```bash # Copy environment template cp .env.example .env # Edit .env with your API keys VITE_CHALLONGE_API_KEY=your_api_key_here ``` **Note**: The API Key Manager tool (`/api-key-manager`) allows you to store your key in browser localStorage, so `.env` configuration is now optional. ```bash # Build the app npm run build # Preview production build npm run preview ``` ## 🐳 Docker Deployment ### Build and Run Locally ```bash # Build the image docker build -t pokedex-online . # Run the container docker run -d -p 8080:80 --name pokedex-online pokedex-online # View in browser open http://localhost:8080 ``` ### Using Docker Compose ```bash # Start the service docker-compose up -d # Stop the service docker-compose down # View logs docker-compose logs -f ``` ## πŸ“¦ Automated Deployment Deploy to Synology NAS using the deployment script: ```bash # Deploy to internal network (10.0.0.81) npm run deploy:pokedex:internal # Deploy to external network (home.gregrjacobs.com) npm run deploy:pokedex:external # Deploy with custom ports npm run deploy:pokedex -- --target internal --port 8080 --ssl-port 8443 ``` ## πŸ“ Project Structure ``` pokedex.online/ β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ main.js # Application entry point β”‚ β”œβ”€β”€ App.vue # Root component with transitions β”‚ β”œβ”€β”€ style.css # Global styles β”‚ β”œβ”€β”€ router/ β”‚ β”‚ └── index.js # Vue Router configuration (4 routes) β”‚ β”œβ”€β”€ views/ β”‚ β”‚ β”œβ”€β”€ Home.vue # Landing page with tool cards β”‚ β”‚ β”œβ”€β”€ ApiKeyManager.vue # API key storage and management β”‚ β”‚ β”œβ”€β”€ GamemasterManager.vue # Gamemaster fetch/process/download β”‚ β”‚ └── ChallongeTest.vue # API testing and validation β”‚ β”œβ”€β”€ components/ β”‚ β”‚ └── shared/ β”‚ β”‚ └── ProfessorPokeball.vue # Animated logo component β”‚ β”œβ”€β”€ services/ β”‚ β”‚ └── challonge.service.js # Challonge API client (20+ methods) β”‚ β”œβ”€β”€ utilities/ β”‚ β”‚ β”œβ”€β”€ constants.js # API config, types, CSV headers β”‚ β”‚ β”œβ”€β”€ string-utils.js # String utilities β”‚ β”‚ β”œβ”€β”€ csv-utils.js # CSV parsing and validation β”‚ β”‚ β”œβ”€β”€ participant-utils.js # Participant management β”‚ β”‚ β”œβ”€β”€ gamemaster-utils.js # Gamemaster processing β”‚ β”‚ └── models/ # Data models (Tournament, Participant, Pokemon) β”‚ └── composables/ β”‚ └── useChallongeApiKey.js # API key storage composable β”œβ”€β”€ .env.example # Environment template (optional) β”œβ”€β”€ index.html # HTML entry point β”œβ”€β”€ vite.config.js # Vite config with dev proxy β”œβ”€β”€ nginx.conf # Production nginx proxy config β”œβ”€β”€ package.json # Dependencies (Vue 3, Vue Router) β”œβ”€β”€ Dockerfile # Docker build (nginx:alpine) β”œβ”€β”€ docker-compose.yml # Docker Compose config β”œβ”€β”€ PROJECT_PLAN.md # Implementation roadmap β”œβ”€β”€ API_KEY_STORAGE.md # API key storage documentation └── README.md # This file ``` ## 🎯 Available Tools ### API Key Manager (`/api-key-manager`) - Store your Challonge API key locally in browser localStorage - Works across all devices and browsers (mobile, tablet, desktop) - Masked display for security (shows "xxxxβ€’β€’β€’β€’β€’β€’β€’xxxx") - Update or clear your key anytime - No need to edit .env files - Secure browser-native storage ### Gamemaster Manager (`/gamemaster`) - Fetch latest Pokemon GO gamemaster from PokeMiners - Process and break up into separate files - Download pokemon.json, moves.json, and allFormsCostumes.json - View statistics about downloaded data ### Challonge API Test (`/challonge-test`) - Test your Challonge API connection - Enter API key (or load from stored key) - List your tournaments - View tournament details and participants - Verify API configuration is working ### Printing Tool (Coming Soon) - Import RK9 player CSV files - Generate team sheets - Create player badges - Print tournament materials ### Tournament Manager (Coming Soon) - Manage Challonge tournaments - Add/remove participants - Submit match scores - Track tournament progress ## πŸ”‘ API Keys & Configuration ### Challonge API 1. Create account at https://challonge.com 2. Get API key from https://challonge.com/settings/developer 3. Add to `.env`: ``` VITE_CHALLONGE_API_KEY=your_key_here ``` ### Environment Variables All environment variables must be prefixed with `VITE_` to be available in the browser: ```bash # βœ… Correct - Available in browser VITE_CHALLONGE_API_KEY=abc123 # ❌ Wrong - Not accessible CHALLONGE_API_KEY=abc123 ``` Access in code: ```javascript const apiKey = import.meta.env.VITE_CHALLONGE_API_KEY; ``` ## πŸ› οΈ Tech Stack - **Vue 3.4** - Progressive JavaScript framework with Composition API - **Vue Router 4** - Official routing library - **Vite 5** - Next generation frontend tooling - **Docker** - Containerization - **nginx** - Web server for production ## πŸ“š Documentation - [PROJECT_PLAN.md](./PROJECT_PLAN.md) - Complete implementation roadmap - [GAMEMASTER_IMPLEMENTATION.md](./GAMEMASTER_IMPLEMENTATION.md) - Gamemaster feature details - [Vue 3 Docs](https://vuejs.org/) - [Challonge API](https://api.challonge.com/v1) ## πŸ”’ Security Notes - **Never commit `.env`** - Contains sensitive API keys - **Use environment variables** - All configs in `.env` - **Prefix with VITE_** - Required for browser access - **Keep API keys private** - Don't share in public repos ## πŸ”— Related Apps - **apps/** - Additional apps accessible at app.pokedex.online ## πŸ“ Development Notes This project uses: - Vue 3 Composition API with `