A Sinatra-based web application for managing bands, songs, set lists, and venues.
- Ruby 3.1+ or higher
- PostgreSQL 14+ (recommended 17+)
- Bundler
- Clone the repository
- Install dependencies:
bundle install
The application now uses proper database migrations instead of a full database reset.
rake db:setupThis will:
- Run all pending migrations
- Seed the database with initial data (default band)
The application requires certain environment variables to be set for security and functionality:
- SESSION_SECRET: A secure random string for session encryption (at least 64 characters)
- BAND_HUDDLE_ACCT_CREATION_SECRET: An account creation code required for new user registration
- GOOGLE_SERVICE_ACCOUNT_JSON: JSON credentials for Google Calendar integration (optional)
You can set these in several ways:
- Create a
.envfile in the project root (copy fromenv.example) - Export them in your shell:
export BAND_HUDDLE_ACCT_CREATION_SECRET=your_account_creation_code - Set them when running the app:
BAND_HUDDLE_ACCT_CREATION_SECRET=your_account_creation_code ruby app.rb
ruby app.rbThen visit http://localhost:4567
rake db:create_migration[name_of_migration]Example: rake db:create_migration[add_user_preferences]
rake db:migraterake db:rollbackrake db:statusrake db:resetrake db:seedMigrations are stored in db/migrate/ and follow the format:
YYYYMMDDHHMMSS_descriptive_name.rb
band-huddle/
βββ app.rb # Main application file
βββ Gemfile # Dependencies
βββ Rakefile # Database tasks
βββ config/
β βββ database.yml # Database configuration
βββ db/
β βββ migrate/ # Database migrations
βββ views/ # ERB templates
βββ README.md # This file
- Band Management: Create and manage multiple bands
- Song Library: Store songs with metadata (key, tempo, genre, etc.)
- Set Lists: Create and organize set lists for performances
- Venue Management: Track venues with contact information
- Performance Scheduling: Schedule performances with dates and times
- Google Calendar Integration: Sync gigs to Google Calendar automatically
- Mobile Responsive: Works great on mobile devices
- Print Support: Print-friendly set list views
Band Huddle includes optional Google Calendar integration that allows bands to automatically sync their gigs to a shared Google Calendar. This enables band members to see upcoming performances in their personal calendar apps.
- Automatic Sync: Gigs are automatically synced when created, updated, or deleted
- Shared Calendars: Each band can have its own Google Calendar
- Event Details: Includes venue information, performance times, and setlists
- Real-time Updates: Changes in Band Huddle are immediately reflected in Google Calendar
Google Calendar integration requires additional setup including:
- Creating a Google Cloud Project
- Enabling the Google Calendar API
- Creating a service account and downloading credentials
- Configuring environment variables
- Sharing calendars with the service account
For detailed setup instructions, see GOOGLE_CALENDAR_SETUP.md in the project root.
Once configured:
- Edit your band settings
- Enable "Google Calendar Sync"
- Enter your Google Calendar ID
- Test the connection
- All future gigs will automatically sync to Google Calendar
- Create a migration for any database changes:
rake db:create_migration[add_new_feature]
- Edit the generated migration file in
db/migrate/ - Run the migration:
rake db:migrate
- Update models and views as needed
- Always use migrations for schema changes
- Never modify the database directly
- Test migrations on a copy of production data
The project includes a comprehensive test suite using RSpec and FactoryBot.
# Run all tests
rake spec
# or
bundle exec rspec
# Run specific test categories
bundle exec rspec spec/models/ # Model tests
bundle exec rspec spec/requests/ # Request/Integration tests
# Run specific test file
bundle exec rspec spec/models/band_spec.rb
# Run with verbose output
bundle exec rspec --format documentationModel Tests: Validations, associations, scopes, and business logic Request Tests: CRUD operations, form handling, search/filtering, API endpoints Integration Tests: Set list management, band associations, database setup Helper Tests: Application helper methods and calendar functionality Service Tests: Google Calendar integration and external API handling
spec/
βββ spec_helper.rb # RSpec configuration
βββ factories.rb # FactoryBot factories
βββ models/ # Model tests
βββ requests/ # Request/Integration tests
- Create factories in
spec/factories.rbfor new models - Add model tests in
spec/models/ - Add request tests in
spec/requests/ - Use descriptive test names and test both success and error cases
If you encounter migration problems:
- Check migration status:
rake db:status - Rollback if needed:
rake db:rollback - Reset if necessary:
rake db:reset(β οΈ This will delete all data)
- Check database configuration in
config/database.yml - Verify PostgreSQL is running and accessible
- Ensure database credentials are correct
This project is open source and available under the MIT License.