Skip to content

ZGrauer/Pipeband

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Kansas City St Andrew Pipes and Drums logo

Kansas City St. Andrew Pipes & Drums Website

Angular TypeScript Material Design License

A modern, responsive Angular web application for the Kansas City St. Andrew Pipes & Drums, serving as the digital home for one of Kansas City's finest and oldest pipe and drum bands. The site provides resources for fans, prospective students, current members, and event organizers.

🌟 Features

Public Features

  • 🎡 Concert Announcements - Eye-catching dismissible banner for upcoming events with ticket links
  • πŸ“Έ Photo Gallery - Responsive image galleries with lazy-loading and thumbnail optimization
  • 🎼 Music Library - Audio samples of performances and competition scores
  • πŸ“… Performance Schedule - Upcoming events and appearances
  • πŸ’Ό Hire Us - Information for booking the band for events
  • πŸ“ž Contact Information - Easy ways to reach band leadership and instructors
  • ℹ️ About Us - Band history, achievements, and member information

Member Features (Protected)

  • πŸ” Secure Authentication - Bcrypt-based password hashing with rate limiting
  • πŸ† Competition Results - Detailed score sheets and judge recordings
  • πŸ“„ Band Documents - Constitution, policies, and member resources
  • πŸŽ–οΈ 3D Models - STL files for band cap badge and kilt pin
  • πŸšͺ Session Management - 24-hour sessions with automatic logout

Technical Features

  • πŸ“± Responsive Design - Optimized for mobile, tablet, and desktop
  • ⚑ Performance Optimized - Lazy loading, WebP images, code splitting
  • β™Ώ Accessible - WCAG compliant with semantic HTML and ARIA labels
  • πŸ”’ Security Enhanced - Client-side rate limiting, bcrypt hashing, session management
  • 🐳 Docker Support - Containerized deployment with Nginx
  • πŸ“Š SEO Optimized - Meta tags, OpenGraph, Twitter Cards, structured data

πŸ“‹ Table of Contents


πŸš€ Quick Start

# Clone the repository
git clone https://github.com/yourusername/Pipeband.git
cd Pipeband

# Install dependencies
npm install

# Start development server
npm start

# Navigate to http://localhost:4200/

πŸ“¦ Installation

Prerequisites

  • Node.js (v16.x or higher recommended)
  • npm (v8.x or higher)
  • Angular CLI (v16.x)
    npm install -g @angular/cli@16

Setup Steps

  1. Clone the Repository

    git clone https://github.com/yourusername/Pipeband.git
    cd Pipeband
  2. Install Dependencies

    npm install
  3. Configure Environment (See Configuration section)

  4. Start Development Server

    ng serve
    # or
    npm start
  5. Open Browser Navigate to http://localhost:4200/


βš™οΈ Configuration

Member Authentication Setup

The site includes a protected members-only section. To configure authentication:

Option 1: Use Default Password (For Testing)

Default password: CHANGE_ME

The repository includes pre-configured hash parts for this password. You can start developing immediately.

Option 2: Set Your Production Password

  1. Generate Hash Parts

    node scripts/generate-hash-parts.js "YourProductionPassword"
  2. Update src/app/auth.service.ts

    Copy the output from the script and replace lines 15-17:

    private readonly p1 = atob('YOUR_GENERATED_PART_1');
    private readonly p2 = atob('YOUR_GENERATED_PART_2');
    private readonly p3 = atob('YOUR_GENERATED_PART_3');
  3. Security Note: Never commit production passwords to version control!

πŸ“š Detailed Guide: See scripts/README-HASH-GENERATOR.md

Environment Files

  • src/environments/environment.ts - Production configuration
  • src/environments/environment.development.ts - Development configuration

πŸ’» Development

Development Server

ng serve
# or
npm start

Navigate to http://localhost:4200/. The application will automatically reload when you change source files.

Available npm Scripts

Command Description
npm start Start development server
npm run build Build for production
npm run watch Build with file watching
npm test Run unit tests
ng generate component component-name Generate new component
ng generate service service-name Generate new service

Code Scaffolding

Generate new components, services, directives, etc.:

ng generate component component-name
ng generate service service-name
ng generate directive directive-name
ng generate pipe pipe-name
ng generate guard guard-name
ng generate module module-name

Development Best Practices

  • βœ… Use TypeScript strict mode (already enabled)
  • βœ… Follow Angular style guide
  • βœ… Write unit tests for new features
  • βœ… Use semantic HTML and ARIA labels
  • βœ… Optimize images (WebP format, responsive sizes)
  • βœ… Test on multiple devices and browsers

πŸ”’ Security Features

This application implements multiple layers of security for the members-only section:

1. Bcrypt Password Hashing βœ…

  • Industry-standard bcrypt algorithm with 10 salt rounds
  • Hash split into 3 obfuscated parts to make it harder to find in JS bundle
  • Automatic salt generation and management
  • ~100ms computation time prevents brute-force attacks

2. Rate Limiting βœ…

  • 5 failed login attempts trigger 15-minute lockout
  • Lockout persists across page refreshes
  • Live countdown timer shows remaining lockout time
  • Visual feedback on remaining attempts

3. Session Management βœ…

  • 24-hour automatic session expiration
  • Secure token generation with timestamps
  • Session validation on every protected route access
  • Manual logout functionality

4. Security Considerations

⚠️ Important: This is client-side authentication suitable for:

  • βœ… Non-sensitive member content
  • βœ… Competition scores and band documents
  • βœ… Keeping casual visitors out

❌ Not suitable for:

  • Personal information
  • Financial data
  • HIPAA/GDPR protected content

For true security, consider:

  • AWS Lambda@Edge for edge authentication
  • AWS Cognito for managed auth
  • API Gateway + Lambda for server-side validation

πŸ“š Detailed Security Guide: See SECURITY-IMPLEMENTATION.md


πŸ—οΈ Building & Deployment

Build for Production

ng build --configuration production
# or
npm run build

Build artifacts will be in the dist/pipeband directory.

Docker Deployment

Build Docker Image

docker build -t pipeband-image .

Run Container

docker run --name pipeband-container -d -p 8080:80 pipeband-image

Navigate to http://localhost:8080/

AWS S3 + CloudFront Deployment

This site is designed to run as a static website on AWS:

  1. Build the application

    npm run build
  2. Upload to S3

    aws s3 sync dist/pipeband s3://your-bucket-name --delete
  3. Invalidate CloudFront cache

    aws cloudfront create-invalidation --distribution-id YOUR_DIST_ID --paths "/*"

Nginx Configuration

The included nginx.conf provides:

  • Gzip compression
  • Browser caching headers
  • SPA routing support
  • Security headers

πŸ“ Project Structure

Pipeband/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ about/              # About Us page
β”‚   β”‚   β”œβ”€β”€ contact/            # Contact page
β”‚   β”‚   β”œβ”€β”€ hire/               # Hire Us page
β”‚   β”‚   β”œβ”€β”€ home/               # Home page (with concert banner)
β”‚   β”‚   β”œβ”€β”€ login/              # Login page (enhanced security)
β”‚   β”‚   β”œβ”€β”€ members/            # Members-only section (protected)
β”‚   β”‚   β”œβ”€β”€ music/              # Music library
β”‚   β”‚   β”œβ”€β”€ photos/             # Photo galleries
β”‚   β”‚   β”œβ”€β”€ schedule/           # Performance schedule
β”‚   β”‚   β”œβ”€β”€ auth.service.ts     # Authentication service (bcrypt)
β”‚   β”‚   β”œβ”€β”€ auth.guard.ts       # Route guard
β”‚   β”‚   └── meta.service.ts     # SEO meta tags service
β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   β”œβ”€β”€ optimized/          # Optimized WebP images
β”‚   β”‚   β”œβ”€β”€ photos/             # Photo gallery images
β”‚   β”‚   β”œβ”€β”€ score-sheets/       # Competition recordings & PDFs
β”‚   β”‚   └── band_logo.webp      # Band logo
β”‚   β”œβ”€β”€ environments/           # Environment configurations
β”‚   └── styles.css              # Global styles
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ generate-hash-parts.js  # Bcrypt hash generator
β”‚   β”œβ”€β”€ generate_thumbnails.py  # Photo thumbnail generator
β”‚   └── README-HASH-GENERATOR.md
β”œβ”€β”€ Dockerfile                  # Docker configuration
β”œβ”€β”€ nginx.conf                  # Nginx server config
β”œβ”€β”€ package.json                # npm dependencies
β”œβ”€β”€ angular.json                # Angular CLI configuration
β”œβ”€β”€ SECURITY-IMPLEMENTATION.md  # Security documentation
β”œβ”€β”€ BCRYPT-UPGRADE-GUIDE.md     # Bcrypt migration guide
└── README.md                   # This file

πŸ› οΈ Scripts & Utilities

Generate Password Hash Parts

Generate secure bcrypt hash for member authentication:

# Interactive mode (password hidden)
node scripts/generate-hash-parts.js

# Command-line mode
node scripts/generate-hash-parts.js "YourPassword"

πŸ“š Full Documentation: scripts/README-HASH-GENERATOR.md

Generate Photo Thumbnails

Generate optimized thumbnails for photo galleries:

Prerequisites:

pip install Pillow

Usage:

python scripts/generate_thumbnails.py GALLERY_ID

Example:

python scripts/generate_thumbnails.py 2024_Highland_Games

This creates 400x400 WebP thumbnails in src/assets/photos/GALLERY_ID/thumbs/

Generate Photo Manifest

Generate manifest JSON files for photo galleries:

# PowerShell
.\scripts\Generate-Manifest.ps1 -GalleryId "2024_Highland_Games"

# Bash
bash scripts/generate_manifest.sh "2024_Highland_Games"

πŸ§ͺ Testing

Unit Tests

ng test

Executes unit tests via Karma

Code Coverage

ng test --code-coverage

Coverage report will be in coverage/ directory.

End-to-End Tests

ng e2e

Note: You need to add an e2e testing package first (e.g., Cypress, Playwright)

Recommended Setup:

ng add @cypress/schematic

🀝 Contributing

We welcome contributions! Please follow these guidelines:

Development Workflow

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
    • Follow Angular style guide
    • Write/update tests
    • Update documentation
  4. Test your changes
    npm test
    npm run build
  5. Commit your changes
    git commit -m "Add amazing feature"
  6. Push to your fork
    git push origin feature/amazing-feature
  7. Open a Pull Request

Code Style

  • Follow Angular Style Guide
  • Use TypeScript strict mode
  • Write meaningful commit messages
  • Document public APIs with JSDoc
  • Add unit tests for new features

Before Committing

  • βœ… Run tests: npm test
  • βœ… Check linting: ng lint
  • βœ… Build successfully: npm run build
  • βœ… Update documentation if needed

πŸ“š Documentation

Main Documentation

Additional Resources


🎯 Roadmap

Planned Features

  • Email newsletter signup
  • Event calendar with iCal export
  • Online store for merchandise
  • Member directory with profiles
  • Practice attendance tracking
  • Sheet music library
  • Video gallery
  • Blog/news section

Future Enhancements

  • Server-side authentication (Lambda@Edge)
  • Progressive Web App (PWA) features
  • Advanced analytics dashboard
  • Multi-language support
  • Accessibility improvements (WCAG 2.1 AA)
  • Performance monitoring

πŸ› Troubleshooting

Common Issues

Login Always Fails

Solution: Verify the hash parts in auth.service.ts match your password. Regenerate with:

node scripts/generate-hash-parts.js "YourPassword"

Build Errors with bcrypt

Solution: Ensure you have both bcrypt and bcryptjs installed:

npm install bcrypt bcryptjs @types/bcryptjs

Docker Image Too Large

Solution: Add .dockerignore with:

node_modules
dist
.git
*.md

Photos Not Loading

Solution:

  1. Check if thumbnails exist: src/assets/photos/GALLERY_ID/thumbs/
  2. Regenerate thumbnails: python scripts/generate_thumbnails.py GALLERY_ID
  3. Verify manifest.json exists in gallery folder

Getting Help


πŸ‘₯ Team

Kansas City St. Andrew Pipes & Drums


πŸ“„ License

This project is licensed under the terms specified in the LICENSE file.

Copyright Β© 2023-2026 Kansas City St. Andrew Pipes & Drums

All rights reserved.


πŸ™ Acknowledgments

  • Angular Team - For the excellent framework
  • Angular Material - For beautiful UI components
  • Band Members - For content and feedback
  • Contributors - For improvements and bug fixes

πŸ“ž Contact & Support

Band Contact

Practice Location

St. Andrew's Episcopal Church
6401 Wornall Terrace
Kansas City, MO 64113
Tuesday nights, 7:00 PM - 9:00 PM

Mailing Address

PO Box 648
Shawnee Mission, KS 66201-0648


⭐ Star This Repository

If you find this project useful, please consider giving it a star on GitHub!


Made with ❀️ by the Kansas City St. Andrew Pipes & Drums community

🎡 Ceòl is Càirdeas (Music and Friendship) 🎡

About

Angular website for the Kansas City St. Andrew Pipes & Drums band

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •