From 6a28e72c6ca49f51b7ea947550fea4b0d6b3b34c Mon Sep 17 00:00:00 2001 From: FragginWagon Date: Wed, 28 Jan 2026 23:01:12 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Simplify=20Docker=20deployment?= =?UTF-8?q?=20instructions=20and=20update=20project=20structure,=20testing?= =?UTF-8?q?,=20and=20coverage=20documentation=20in=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/websites/pokedex.online/README.md | 146 +++++++++---------------- 1 file changed, 53 insertions(+), 93 deletions(-) diff --git a/code/websites/pokedex.online/README.md b/code/websites/pokedex.online/README.md index a0d62cc..333f23a 100644 --- a/code/websites/pokedex.online/README.md +++ b/code/websites/pokedex.online/README.md @@ -87,116 +87,76 @@ 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 +# Build and run with Docker Compose 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 +# Stop services +docker-compose down ``` ## ๐Ÿ“ 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 +src/ +โ”œโ”€โ”€ components/ # React components +โ”‚ โ”œโ”€โ”€ PokemonCard.jsx +โ”‚ โ”œโ”€โ”€ SearchBar.jsx +โ”‚ โ”œโ”€โ”€ TypeMatrix.jsx +โ”‚ โ””โ”€โ”€ ... +โ”œโ”€โ”€ hooks/ # Custom React hooks +โ”‚ โ”œโ”€โ”€ usePokemon.js +โ”‚ โ”œโ”€โ”€ useSearch.js +โ”‚ โ””โ”€โ”€ ... +โ”œโ”€โ”€ services/ # API & data services +โ”‚ โ”œโ”€โ”€ pokemonService.js +โ”‚ โ”œโ”€โ”€ typeService.js +โ”‚ โ””โ”€โ”€ ... +โ”œโ”€โ”€ utils/ # Helper functions +โ”‚ โ”œโ”€โ”€ formatters.js +โ”‚ โ”œโ”€โ”€ validators.js +โ”‚ โ””โ”€โ”€ ... +โ”œโ”€โ”€ types/ # TypeScript type definitions +โ”‚ โ””โ”€โ”€ pokemon.ts +โ”œโ”€โ”€ styles/ # Global styles +โ”‚ โ””โ”€โ”€ index.css +โ”œโ”€โ”€ workers/ # Web Workers +โ”‚ โ””โ”€โ”€ search.worker.js +โ”œโ”€โ”€ App.jsx +โ””โ”€โ”€ main.jsx + +test/ +โ”œโ”€โ”€ unit/ # Unit tests +โ”œโ”€โ”€ integration/ # Integration tests +โ””โ”€โ”€ e2e/ # End-to-end tests ``` -## ๐ŸŽฏ Available Tools +## ๐Ÿงช Testing -### 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 +Comprehensive test coverage with Vitest: -### 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 +```bash +# Run tests once +npm run test:run -### 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 +# Run tests in watch mode +npm test -### Printing Tool (Coming Soon) -- Import RK9 player CSV files -- Generate team sheets -- Create player badges -- Print tournament materials +# Open test UI +npm run test:ui + +# Generate coverage report +npm run test:coverage +``` + +**106 tests** covering: +- Services and utilities (unit tests) +- Component integration +- User workflows +- Edge cases and error handling ### Tournament Manager (Coming Soon) - Manage Challonge tournaments