Static weekend planner for restaurants and events. Aggregates data from multiple sources, pairs restaurants with events intelligently, and publishes as a static website on GitHub Pages.
Browse restaurants, events, and paired recommendations with filtering and multiple layout options:
- Restaurants tab: Dining options filtered by cuisine or keywords
- Events tab: Upcoming events by category (art, music, family, sports)
- Paired tab: Recommended restaurant + event combinations
- Filter: Search by keywords or categories
- Layout: Toggle between card view (visual) and table view (compact)
- Getting Started - Overview, key folders, and data flow
- Generator Guide - CLI usage, configuration, and adding data sources
- Deployment Guide - GitHub Pages setup, custom domains, and validation
- API Setup - Configure real data sources (Google Places, Ticketmaster)
- Architecture - Technical deep dive
- Roadmap - Feature roadmap and future plans
- Python 3.11 or higher
- pip (Python package manager)
# Clone the repository
git clone https://github.com/gitbrainlab/happenstance.git
cd happenstance
# Install dependencies
pip install -r requirements.txt
# Generate data (uses demo/fixture data by default - no API keys needed!)
python -m happenstance.cli aggregate
# Start local server
python -m happenstance.cli serve
# Or use Makefile shortcut
make devOpen your browser to http://localhost:8000
By default, Happenstance uses fixture data (sample restaurants and events) so you can try it immediately without any API keys or paid services. This is perfect for:
- Testing the application
- Development and customization
- Understanding how it works before connecting to real data sources
The fixture data is configured in config/config_logic.json:
{
"data_sources": {
"restaurants": "fixtures",
"events": "fixtures"
}
}To fetch real restaurant and event data:
-
Get API keys (see docs/API_SETUP.md for details):
- Google Places API - for restaurants
- Ticketmaster API - for events
- Both have free tiers!
-
Set environment variables:
export GOOGLE_PLACES_API_KEY="your_google_key" export TICKETMASTER_API_KEY="your_ticketmaster_key"
-
Update
config/config_logic.json:{ "data_sources": { "restaurants": "google_places", "events": "ticketmaster" } } -
Generate fresh data:
python -m happenstance.cli aggregate
Alternative: Use AI-powered data sources (Grok/OpenAI) - see docs/AI_SETUP.md
Edit config/config_logic.json to customize:
- Region: Your city/area (e.g., "San Francisco", "New York City")
- Branding: Site title, tagline, and accent color
- Data sources: Fixtures, APIs, or AI
- Cuisines: Preferred restaurant types
- Categories: Preferred event types
Environment variable overrides:
export PROFILE=default # Profile to use from config
export EVENT_WINDOW_DAYS=14 # Days ahead for events
export BASE_URL=http://localhost:8000Click the Fork button at the top of this page to create your own copy.
Edit config/config_logic.json in your fork:
{
"profiles": {
"default": {
"region": "Your City, State",
"branding": {
"title": "Happenstance - Your City",
"tagline": "Plan your weekend with great food and events",
"accent_color": "#3b82f6"
},
"data_sources": {
"restaurants": "fixtures",
"events": "fixtures"
}
}
}
}Tip: Start with fixtures, then add API keys later for real data.
- Go to Settings β Pages
- Under "Build and deployment":
- Source: GitHub Actions
- Under "Workflow permissions" (Settings β Actions β General):
- Select "Read and write permissions"
- Save
For real data, add repository secrets:
- Go to Settings β Secrets and variables β Actions
- Click "New repository secret"
- Add secrets:
GOOGLE_PLACES_API_KEY- for restaurantsTICKETMASTER_API_KEY- for events
See docs/API_SETUP.md for obtaining API keys (both have free tiers).
Option A: Push to trigger deployment
git add config/config_logic.json
git commit -m "Configure for my city"
git push origin mainOption B: Manual trigger
- Go to Actions tab
- Click "Pages Deploy"
- Click "Run workflow"
After 2-3 minutes, your site will be live at:
https://yourusername.github.io/happenstance/
Check Settings β Pages for the URL.
Your site automatically updates daily at 6 AM UTC. Validation ensures data is being refreshed correctly and your site remains functional.
Why validate? Scheduled runs can fail due to API rate limits, configuration errors, or GitHub Actions issues. Regular validation helps you catch problems early.
Check GitHub Actions:
- Go to Actions tab
- Look for runs with π clock icon (scheduled)
- View logs to see data generation output
Check deployment history:
- Settings β Pages
- View deployment timestamps - should show daily updates
Check site footer: Visit your site and check the bottom for the update timestamp:
Data from Your City β’ Updated: 2025-12-29 at 06:05 UTC
Check JSON metadata:
curl https://yourusername.github.io/happenstance/meta.json | grep generated_atCommon issues and solutions:
- No scheduled runs: GitHub may pause workflows on inactive repos - trigger manually once to reactivate
- Run failed: Check logs - usually API limits or errors (fixture fallback ensures site still works)
- Data unchanged: Check
_meta.changedfield - iffalse, no updates were needed (this is normal) - If validation fails: See the detailed troubleshooting guide in docs/deployment.md
See docs/deployment.md for detailed deployment documentation, custom domains, and troubleshooting.
# Linting
ruff check .
# or
make lint
# Unit and contract tests
pytest
# or
make test
# End-to-end tests (requires Playwright)
npx playwright install --with-deps chromium
npm run test:e2e
# or
make e2eContributions are welcome! Here's how to get started:
- Fork the repository and create a feature branch
- Make your changes - follow existing code style
- Add tests for new functionality
- Run tests to ensure nothing breaks:
make lint make test - Submit a pull request with a clear description
- Code style: Follow existing patterns, use type hints
- Tests: Add tests for new features and bug fixes
- Documentation: Update relevant docs in
docs/ - Commits: Write clear, descriptive commit messages
See docs/generator.md for a complete guide on adding new API integrations.
- Check docs/BUGS.md for known issues
- Search existing issues before creating new ones
- Provide clear reproduction steps
- Include logs from GitHub Actions if deployment-related
βββββββββββββββββββββββββββββββββββ
β Data Sources β
β - Fixtures (demo data) β
β - Google Places (restaurants) β
β - Ticketmaster (events) β
β - AI-powered (alternative) β
ββββββββββββββ¬βββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββ
β Python Generator β
β 1. Fetch & normalize data β
β 2. Geocode locations β
β 3. Calculate pairings β
β 4. Generate JSON files β
ββββββββββββββ¬βββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββ
β Static Files (docs/) β
β - restaurants.json β
β - events.json β
β - meta.json (with pairings) β
β - index.html + app.js β
ββββββββββββββ¬βββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββ
β GitHub Pages β
β - Automatic daily updates β
β - CDN distribution β
β - Free hosting β
βββββββββββββββββββββββββββββββββββ
Key Features:
- Reproducible: Clear data lineage from source to output
- Resilient: Automatic fallback to fixture data
- Free: No paid services required (uses free API tiers)
- Simple: Static site architecture, no backend needed
- Automated: Daily scheduled updates via GitHub Actions
This project is open source. See the repository for license details.
- Data sources: Google Places API, Ticketmaster API
- Geocoding: OpenStreetMap Nominatim
- Hosting: GitHub Pages
- Automation: GitHub Actions