Skip to content

Product-Designs/basketball-scorekeeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Basketball Scorekeeper PWA

A mobile-first Progressive Web App for tracking basketball games and player statistics.

Features

  • Mobile-First Design: Optimized for mobile devices with touch-friendly controls
  • Progressive Web App: Install on your device and use offline
  • Player Management: Add and manage team rosters
  • Game Tracking: Record detailed per-player statistics for each game
  • Season Overview: View aggregated stats and per-player averages
  • Data Export: Export season data to CSV format
  • Offline Support: Full functionality without internet connection

Installation

Development

npm install
npm run dev

The app will be available at http://localhost:8100

Production Build

npm run build

Built files will be in the dist/ directory.

Testing

# Run tests
npm test

# Run tests with coverage
npm test:coverage

# Run tests in watch mode
npm test:watch

Lighthouse Performance Scores

Performance audit results (as of December 2024):

Category Score
Performance πŸ’― 100
Accessibility πŸ’― 100
Best Practices πŸ’― 100
SEO πŸ’― 100

Key Performance Metrics

  • First Contentful Paint: < 1s
  • Time to Interactive: < 1s
  • Speed Index: < 1s
  • Total Blocking Time: 0ms
  • Cumulative Layout Shift: 0

Accessibility Features

  • βœ… Semantic HTML structure
  • βœ… ARIA labels where appropriate
  • βœ… Keyboard navigation support
  • βœ… Minimum 44x44px touch targets
  • βœ… High contrast ratios (WCAG AA compliant)
  • βœ… Screen reader friendly
  • βœ… Focus indicators

Technology Stack

  • Static Site Generator: Eleventy (11ty)
  • Styling: Modern CSS with custom properties
  • JavaScript: Vanilla ES6+ modules
  • Testing: Jest + Testing Library
  • PWA: Service Worker with cache-first strategy
  • Code Quality: Prettier + ESLint

Project Structure

basketball-scorekeeper/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ _includes/
β”‚   β”‚   └── base.njk           # HTML template
β”‚   β”œβ”€β”€ assets/                # Static assets (icons)
β”‚   β”‚   β”œβ”€β”€ favicon.svg
β”‚   β”‚   β”œβ”€β”€ icon-192.svg
β”‚   β”‚   └── icon-512.svg
β”‚   β”œβ”€β”€ styles/                # Modular CSS
β”‚   β”‚   β”œβ”€β”€ variables.css      # Design tokens
β”‚   β”‚   β”œβ”€β”€ base.css           # Reset & base styles
β”‚   β”‚   β”œβ”€β”€ layout.css         # Layout components
β”‚   β”‚   β”œβ”€β”€ components.css     # UI components
β”‚   β”‚   β”œβ”€β”€ utilities.css      # Utility classes
β”‚   β”‚   └── style.css          # Main entry (imports all)
β”‚   β”œβ”€β”€ utils/                 # JavaScript utilities
β”‚   β”‚   β”œβ”€β”€ storage.js         # localStorage operations
β”‚   β”‚   β”œβ”€β”€ calculations.js    # Stats calculations
β”‚   β”‚   └── validation.js      # Input validation
β”‚   β”œβ”€β”€ pages/                 # Page-specific scripts
β”‚   β”‚   └── index.js           # Main application logic
β”‚   β”œβ”€β”€ manifest.json          # PWA manifest
β”‚   β”œβ”€β”€ sw.js                  # Service worker
β”‚   └── index.md               # Entry point
β”œβ”€β”€ tests/
β”‚   └── core.test.js           # Jest test suite
β”œβ”€β”€ .eleventy.js               # Eleventy configuration
β”œβ”€β”€ .prettierrc                # Prettier configuration
β”œβ”€β”€ .eslintrc.json             # ESLint configuration
β”œβ”€β”€ jest.config.js             # Jest configuration
└── package.json

Build Tool Choice

This project uses Eleventy (11ty) as its static site generator instead of Vite for the following reasons:

  1. Simplicity: Eleventy is lightweight and perfect for simple PWAs that don't require a heavy framework
  2. Vanilla JavaScript: No React or other framework needed - just ES6 modules
  3. Static Output: Generates static HTML/CSS/JS files ideal for PWA deployment
  4. Fast Builds: Minimal build tooling for quick development iteration
  5. PWA-First: Easy integration with service workers and offline-first patterns

When to use Eleventy vs Vite:

  • Use Eleventy for simple vanilla JS PWAs, static sites, and lightweight apps
  • Use Vite for React-based projects requiring component bundling and HMR

Architecture Decisions

No External Dependencies

  • Removed heavy third-party libraries (XLSX, WebAwesome)
  • Built custom, lightweight components
  • Reduced bundle size significantly
  • Improved load times and offline reliability

Mobile-First Approach

  • Single-column layouts on mobile
  • Touch-optimized button sizes (44x44px minimum)
  • Responsive grid system
  • Safe area support for notched devices

Progressive Enhancement

  • Core functionality works without JavaScript
  • Service Worker provides offline support
  • LocalStorage for data persistence
  • Graceful degradation for older browsers

Browser Support

  • Chrome/Edge 90+
  • Safari 14+
  • Firefox 88+
  • iOS Safari 14+
  • Android Chrome 90+

Future Improvements

Planned Features

  1. Data Sync: Cloud backup and sync across devices
  2. Advanced Statistics:
    • Shooting percentages
    • Plus/minus ratings
    • Heat maps for shot locations
  3. Game Analysis:
    • Quarter-by-quarter breakdown
    • Momentum tracking
    • Comparison charts
  4. Team Management:
    • Multiple teams support
    • Season history
    • Player photos
  5. Enhanced Export:
    • PDF reports
    • Shareable game summaries
    • Social media integration

Performance Optimizations

  • Image optimization for icons (WebP/AVIF)
  • Code splitting for larger features
  • Service Worker precaching strategies
  • IndexedDB for larger datasets

UX Enhancements

  • Dark mode support
  • Customizable team colors
  • Undo/redo functionality
  • Drag-and-drop roster management
  • Quick stats entry shortcuts

Accessibility Improvements

  • Voice input for stats
  • High contrast mode
  • Adjustable font sizes
  • Screen reader optimizations

License

ISC

Author

Adam Jolicoeur

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

A simple basketball scorekeeping app.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors