|
1 | | -# Vue 3 + TypeScript + Vite |
| 1 | +# Sight Words Flashcards |
2 | 2 |
|
3 | | -This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more. |
| 3 | +A Vue 3 Progressive Web App (PWA) for practicing sight words with customizable flashcard collections. |
4 | 4 |
|
5 | | -Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup). |
| 5 | +## Features |
| 6 | + |
| 7 | +- Customizable flashcard collections |
| 8 | +- Progress tracking and statistics |
| 9 | +- Practice sessions with configurable settings |
| 10 | +- Import/Export data functionality |
| 11 | +- Progressive Web App with offline support |
| 12 | +- Default kindergarten word lists included |
| 13 | + |
| 14 | +## Development |
| 15 | + |
| 16 | +```bash |
| 17 | +# Install dependencies |
| 18 | +npm install |
| 19 | + |
| 20 | +# Run development server |
| 21 | +npm run dev |
| 22 | + |
| 23 | +# Build for production |
| 24 | +npm run build |
| 25 | + |
| 26 | +# Preview production build |
| 27 | +npm run preview |
| 28 | +``` |
| 29 | + |
| 30 | +## Deployment |
| 31 | + |
| 32 | +This app is deployed to GitHub Pages using GitHub Actions. The deployment workflow is configured in `.github/workflows/deploy.yml`. |
| 33 | + |
| 34 | +### Important Configuration Notes |
| 35 | + |
| 36 | +#### npm Registry Configuration |
| 37 | + |
| 38 | +The project includes a `.npmrc` file that explicitly sets the npm registry to the standard public registry: |
| 39 | + |
| 40 | +``` |
| 41 | +registry=https://registry.npmjs.org/ |
| 42 | +``` |
| 43 | + |
| 44 | +**Why this is critical:** Without this configuration, npm may attempt to use alternative registries (like private corporate registries) if they're configured in your user-level `.npmrc`. This causes deployment failures in GitHub Actions when those private registries are not accessible. |
| 45 | + |
| 46 | +The `package-lock.json` must reference packages from `https://registry.npmjs.org/` only. If you see references to other registries: |
| 47 | + |
| 48 | +1. Ensure `.npmrc` contains `registry=https://registry.npmjs.org/` |
| 49 | +2. Delete `node_modules/` and `package-lock.json` |
| 50 | +3. Run `npm install` to regenerate with correct registry URLs |
| 51 | + |
| 52 | +#### GitHub Actions Workflow |
| 53 | + |
| 54 | +The deployment workflow: |
| 55 | +1. Uses Node.js 20 with npm caching |
| 56 | +2. Downgrades to npm 9 (npm 10.x had issues with `.bin` directory creation in CI) |
| 57 | +3. Installs dependencies with `npm install` |
| 58 | +4. Builds with `npm run build:ci` (skips TypeScript checking for faster builds) |
| 59 | +5. Deploys to GitHub Pages |
| 60 | + |
| 61 | +Key learnings from deployment troubleshooting: |
| 62 | +- **npm 10.x issue**: npm 10.8.2 had problems creating the `node_modules/.bin/` directory with proper symlinks in GitHub Actions CI environment |
| 63 | +- **Registry configuration**: Must explicitly set registry in project `.npmrc` to avoid private registry resolution |
| 64 | +- **Hash-based routing**: Uses `createWebHashHistory` instead of `createWebHistory` for GitHub Pages compatibility |
| 65 | + |
| 66 | +### Build Scripts |
| 67 | + |
| 68 | +- `npm run build` - Full build with TypeScript type checking |
| 69 | +- `npm run build:ci` - CI build without type checking (faster, used in deployment) |
| 70 | + |
| 71 | +## Project Structure |
| 72 | + |
| 73 | +- `/src/views/` - Vue components for main pages |
| 74 | +- `/src/stores/` - Pinia stores for state management |
| 75 | +- `/src/utils/` - Utility functions including data management |
| 76 | +- `/public/` - Static assets including default word collections |
| 77 | +- `/.github/workflows/` - GitHub Actions deployment configuration |
0 commit comments