Browser-based memory training for cognitive enhancement
English | 简体中文
🎮 Play Online • 📱 Install • 📖 Docs • 🤝 Contribute
| Mode | Description | Cognitive Target |
|---|---|---|
| Classic Matching | Flip cards to find matching pairs (4×4, 4×5, 6×6) | Visual memory, attention |
| Countdown Mode | Race against configurable time limits | Processing speed, stress handling |
| Daily Challenge | Same card layout for all players worldwide | Consistency, competition |
| N-back Training | Working memory exercise — match stimulus N-steps back | Working memory, focus |
| Delayed Recall | Post-game recognition test | Long-term memory consolidation |
- Adaptive Difficulty — Adjusts preview time and hints based on performance (ELO-like rating 600-1600)
- Spaced Reinforcement — Prioritizes challenging cards using decay-weighted selection
- Combo System — 5-second window for consecutive match bonuses
- Star Ratings — Performance scoring based on time, moves, hints, and combos
| Feature | Description |
|---|---|
| 🌍 Full i18n | Chinese & English with auto-detection |
| 📲 PWA Support | Installable, works offline |
| ⌨️ Keyboard Shortcuts | Complete keyboard navigation |
| 📊 Statistics Dashboard | Track progress across all metrics |
| 🏆 Achievement System | Unlock milestones |
| 💾 Data Backup | Export/import all progress as JSON |
Visit https://lessup.github.io/mind-gym/ to play immediately in your browser.
Chrome/Edge:
- Visit the site
- Click the install icon (➕) in the address bar
- Launch from desktop
iOS Safari:
- Tap Share → "Add to Home Screen"
Android Chrome:
- Tap Menu → "Add to Home screen"
# Clone repository
git clone https://github.com/LessUp/mind-gym.git
cd mind-gym
# Install dependencies
npm install
# Start local server
npx serve .| Command | Purpose |
|---|---|
npm test |
Run Jest unit tests |
npm run lint |
Check code formatting |
npm run format |
Auto-format all files |
npm run build:css |
Compile Tailwind CSS |
npm run prepare:deploy |
Build + copy to dist/ |
mind-gym/
├── specs/ # Spec-Driven Development documents
│ ├── product/ # Product feature specifications
│ ├── rfc/ # Technical design documents
│ ├── db/ # Data model definitions
│ └── testing/ # Test specifications
├── docs/ # User guides and tutorials
├── changelog/ # Version history
├── index.html # Main SPA entry
├── app.js # Game orchestrator (state machine, modes)
├── sw.js # Service Worker (offline caching)
├── manifest.webmanifest # PWA manifest
├── src/ # Modular source (UMD)
│ ├── storage.js # localStorage CRUD
│ ├── stats.js # Statistics aggregation
│ ├── achievements.js # Achievement logic
│ ├── modes.js # N-back & recall logic
│ ├── i18n.js # Internationalization
│ ├── timer.js # Timer management
│ └── ... # Additional modules
├── __tests__/ # Jest tests
└── assets/ # Icons, CSS, static files
| Key | Action |
|---|---|
N |
New game |
P |
Pause / Resume |
H |
Use hint |
J |
N-back match (during N-back) |
↑↓←→ |
Navigate cards |
Enter / Space |
Flip selected card |
Escape |
Close modal |
| Layer | Technology |
|---|---|
| Runtime | Vanilla JavaScript (ES2022) — zero runtime dependencies |
| Styling | Tailwind CSS 3.4 (CLI compiled) |
| Storage | localStorage for persistence |
| Testing | Jest 30 + jsdom |
| CI/CD | GitHub Actions |
| Hosting | GitHub Pages |
| Browser | Version | PWA Install |
|---|---|---|
| Chrome | 90+ | ✅ |
| Firefox | 90+ | ✅ |
| Safari | 14+ | |
| Edge | 90+ | ✅ |
* Safari: Use "Add to Home Screen" from share menu
All data is stored locally in localStorage with the memory_match_ prefix:
| Key | Data |
|---|---|
_settings |
User preferences |
_best_<difficulty> |
Best scores |
_lb_<difficulty> |
Leaderboards |
_stats |
Aggregate statistics |
_achievements |
Unlocked achievements |
_adaptive |
Adaptive rating (600-1600) |
See docs/storage.md for complete data structures.
| Document | Description |
|---|---|
| Training Modes | Mode specifications and algorithms |
| PWA/Offline | Service Worker and caching |
| Document | Description |
|---|---|
| Architecture | System design and data flow |
| Storage Model | Data structures and persistence |
| Product Specs | Feature definitions & acceptance criteria |
| Technical RFCs | Architecture decisions |
| Database Schema | Data model specifications |
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Review or create relevant Spec documents in
/specs/ - Make changes following our code style
- Run tests (
npm test) - Commit with clear messages
- Push and open a Pull Request
MIT License © LessUp
Made with ❤️ for cognitive health