An open source Next.js static website for Walkham Valley Scouts, featuring:
- 📱 Progressive Web App (PWA) support
- 📅 Integration with Online Scout Manager (OSM) API
- 🎨 Bootscout theme/design
- 🔍 SEO optimized with Open Graph tags
- 📤 Social media sharing support
- ⚡ Static site generation for fast performance
# Install dependencies
npm install
# Copy environment file
cp .env.example .env.local
# Set USE_MOCK_DATA=true in .env.local for development without OSM credentials
# Run development server
npm run dev
# Build static site
npm run buildThe structure of the site is:
Event/calendar small widget with summary details of next 5 events, click to expand and nav to events screen
Full Event Calendar Screen. Click on individual events to navigate to Event Screen
Parameterised with event_id
Full details of event, including, cost, description, count of current attendees (other fields per the docs)
The home page displays a Badge Programme section that shows:
- Section-specific badges: Shows badges for the configured section (Beavers, Cubs, Scouts, or Explorers)
- Term information: Displays which term the data is from (e.g., "Autumn 2024")
- Badge frequency: The size of each badge pill indicates how many programme activities cover that badge
- Activity count: Hover over badges to see the number of activities
How it works:
- The OSM API provides a "tag cloud" of badges per section and term
- Each badge has a count representing how many programme activities include it
- Badges are displayed with varying sizes - larger badges are covered more frequently
- The data is section-specific, so if you run a Beavers group, set
OSM_SECTION_TYPE=beaversto see Beaver badges
Configuration:
- Set
OSM_SECTION_TYPEin your.env.localto your section type (squirrels, beavers, cubs, scouts, explorers) - The badge data is automatically filtered to that section's badge programme
- Term dates are shown to indicate the time period
The site includes comprehensive Open Graph and Twitter Card metadata for optimal social media sharing and SEO.
- Open Graph Tags: Every page includes proper OG tags for Facebook, WhatsApp, and other platforms
- Twitter Cards: Large image cards for enhanced Twitter sharing
- JSON-LD Structured Data: Schema.org markup for events and organization information
- Dynamic Metadata: Event pages automatically generate sharing content based on event details
- Home Page: Shares site logo and general description
- Events Listing: Shares upcoming events overview
- Individual Events: Each event page has unique metadata including:
- Event title and date
- Event description and notes for parents
- Whether parents are required
- Proper event structured data for search engines
Test how your links will appear when shared:
- Facebook: Facebook Sharing Debugger
- Twitter: Twitter Card Validator
- LinkedIn: LinkedIn Post Inspector
Edit lib/metadata.ts to customize:
- Site name, description, and URL
- Social media handles
- Default images
- SEO keywords
This project uses the Bootscout theme for consistent Scouts branding.
The project is currently set up with basic pages and will integrate Bootscout styling. The theme provides:
- Scout-branded color schemes (purple, teal, yellow)
- Responsive components
- Accessible design patterns
- Official Scouts fonts and styling
-
Install Tailwind CSS (if using Bootscout's utility classes):
npm install -D tailwindcss postcss autoprefixer npx tailwindcss init -p
-
Add Bootscout assets:
- Download Bootscout CSS from bootscout.org.uk
- Add to
app/globals.css - Configure brand colors in Tailwind config
-
Apply Scout branding:
- Use official Scouts purple (
#7413dc) - Apply Bootscout component classes
- Ensure accessibility standards (WCAG AA)
- Use official Scouts purple (
-
Add Scout-specific components:
- Navigation with Scouts branding
- Badge display components
- Event cards with Scout styling
- Footer with required Scouts links
All public pages are unauthenticated. The website is completely stateless.
Static site generation (SSG) is used in NextJS to render all pages, and this process is run in a github actions flow which is triggered either on demand, in response to a merge to the main branch.
This project uses the Online Scout Manager (OSM) API to fetch data about events, badges, and programme activities. You'll need to obtain API credentials from OSM and configure them as environment variables.
- Log in to your Online Scout Manager account at www.onlinescoutmanager.co.uk
- Navigate to Settings > My Account Details > Developer Tools
- Create a new API application to generate your credentials
- You'll receive two values:
- API ID (also called Client ID)
- API Token (also called Client Secret)
For more detailed information about the OSM API, see the OSM API Documentation.
-
Copy the example environment file:
cp .env.example .env.local
-
Edit
.env.localand add your OSM API credentials:OSM_API_ID=your_api_id_here OSM_API_TOKEN=your_api_token_here OSM_SECTION_ID=your_section_id OSM_TERM_ID=your_term_id USE_MOCK_DATA=false NEXT_PUBLIC_SITE_URL=https://walkhamvalleyscouts.org.uk
Note: .env.local is gitignored and will not be committed to the repository.
To deploy the static site via GitHub Actions, you need to add your OSM credentials as repository secrets:
-
Go to your GitHub repository
-
Click Settings > Secrets and variables > Actions
-
Click New repository secret
-
Add the following secrets:
Secret Name Value OSM_API_IDYour OSM API ID from Step 1 OSM_API_TOKENYour OSM API Token from Step 1 OSM_SECTION_IDYour section ID (find in OSM URL) OSM_TERM_IDYour current term ID -
These secrets will be available to your GitHub Actions workflows
For development or testing without OSM API access, you can use mock data:
- Set
USE_MOCK_DATA=truein your.env.localfile - The application will use static mock data instead of making real API calls
- This is useful for:
- Development without API credentials
- Testing the site structure and design
- Avoiding API rate limits during development
Note: Mock data is for development only. For production deployments, always use real OSM API credentials.
The OSM API enforces rate limiting. The client automatically tracks rate limit information via response headers:
X-RateLimit-Limit: Total requests allowed per hourX-RateLimit-Remaining: Remaining requests in current windowX-RateLimit-Reset: When the rate limit resets
If you exceed the rate limit (HTTP 429 response), the build will fail. Consider using mock data during development to avoid hitting limits.
This website uses the Online Scout Manager (OSM) API to fetch data. The full API documentation is available at:
- ✅ Programme/Events - Meeting schedules and event details
- ✅ Badge Tag Cloud - Badge coverage across programme activities
- ✅ Startup Data - Section and term information
The OSM API provides many more endpoints that could be added to this website:
-
Member Management:
- Member lists (for authenticated leaders)
- Patrol/Six organization
- Attendance tracking
-
Advanced Programme Features:
- Individual meeting details with badge links
- Programme attachments and resources
- Risk assessment categories
-
Reports & Statistics:
- Census data and demographics
- Badge completion statistics
- Attendance reports
Note: Many of these features require authentication and are intended for leader-only access. This public website is designed for unauthenticated public viewing of programme and event information.
To add new features: Review the OSM API docs, add methods to lib/osm/client.ts, create corresponding TypeScript types in lib/osm/types.ts, and implement the UI in your pages.
This project is configured to deploy automatically to GitHub Pages using GitHub Actions.
First, push your code to a GitHub repository:
git init
git add .
git commit -m "Initial commit - Walkham Valley Scouts website"
git branch -M main
git remote add origin https://github.com/YOUR-USERNAME/YOUR-REPO.git
git push -u origin main- Go to your repository on GitHub.com
- Click the Settings tab at the top
- In the left sidebar, click Pages
- Under "Build and deployment", find Source
- Select "GitHub Actions" from the dropdown (NOT "Deploy from a branch")
- Click Save
Before adding secrets to GitHub, you need to get these values from Online Scout Manager.
- Log in to www.onlinescoutmanager.co.uk
- Click your name in the top right
- Select "My Account Details"
- Click the "Developer Tools" tab on the left
- Under "OAuth Applications", click "Create New Application"
- Fill in the form:
- Application Name: "Walkham Valley Scouts Website"
- Redirect URI: Leave blank or use your GitHub Pages URL
- Click "Create"
- You'll now see:
- Client ID ← This is your
OSM_API_ID - Client Secret ← This is your
OSM_API_TOKEN
- Client ID ← This is your
- Important: Copy both values now - you won't see the Client Secret again!
- In Online Scout Manager, go to your section (e.g., Beavers, Cubs, Scouts)
- Look at the browser address bar URL
- Find the
sectionidparameter:https://www.onlinescoutmanager.co.uk/...?sectionid=12345 - The number after
sectionid=is your OSM_SECTION_ID
- In Online Scout Manager, go to Programme or Activities
- At the top of the page, find the term selector dropdown (e.g., "Autumn 2024")
- Click "Change Term" and note down the term you want to use
- Look at the URL when viewing that term's data
- Find the
termidparameter:https://www.onlinescoutmanager.co.uk/...?termid=987 - The number after
termid=is your OSM_TERM_ID
OR use the startup API to find all terms:
- Once you have API credentials, you can call the startup endpoint
- It will return all terms with their IDs
This determines which badges are shown. Choose one:
squirrels- For Squirrel Scouts (4-6 years)beavers- For Beaver Scouts (6-8 years)cubs- For Cub Scouts (8-10½ years)scouts- For Scouts (10½-14 years)explorers- For Explorer Scouts (14-18 years)
Now add these values as GitHub secrets:
- In your GitHub repository, go to Settings > Secrets and variables > Actions
- Click the "Secrets" tab
- Click the green "New repository secret" button
- Add each secret:
Required Secrets:
| Secret Name | Value to Enter |
|---|---|
OSM_API_ID |
The Client ID from OSM Developer Tools |
OSM_API_TOKEN |
The Client Secret from OSM Developer Tools |
Recommended Secrets:
| Secret Name | Value to Enter | Default if not set |
|---|---|---|
OSM_SECTION_ID |
The number from your OSM section URL | 1 |
OSM_TERM_ID |
The number from your OSM term URL | 1 |
OSM_SECTION_TYPE |
squirrels, beavers, cubs, scouts, or explorers |
scouts |
How to add each secret:
- Click "New repository secret"
- Enter the Name exactly as shown (e.g.,
OSM_API_ID) - Paste the Value (e.g., your actual Client ID from OSM)
- Click "Add secret"
- Repeat for each secret above
Variables are like secrets but are not encrypted (use for non-sensitive data like URLs).
-
In Settings > Secrets and variables > Actions
-
Click the "Variables" tab
-
Click "New repository variable"
-
Add:
Variable Name Value Example SITE_URLYour GitHub Pages URL https://USERNAME.github.io/REPO-NAME
The site will automatically build and deploy when:
- You push changes to the
mainbranch - You manually trigger the workflow from the Actions tab
- (Optional) On a schedule (uncomment the
schedulesection in.github/workflows/deploy.yml)
To manually trigger a deployment:
- Go to Actions tab in your repository
- Select "Build and Deploy Static Site" workflow
- Click "Run workflow"
- Select the branch (usually
main) - Click "Run workflow"
If you want to deploy the site with mock data (for testing without OSM credentials):
- Edit
.github/workflows/deploy.yml - Uncomment the line:
# USE_MOCK_DATA: true - Commit and push the change
Warning: Mock data should only be used for testing. Production sites should use real OSM data.
Build fails with "Missing OSM API credentials":
- Ensure
OSM_API_IDandOSM_API_TOKENsecrets are set correctly - Or enable
USE_MOCK_DATA: truein the workflow file
Build succeeds but pages don't update:
- Check that GitHub Pages source is set to "GitHub Actions"
- Ensure the workflow has write permissions to
pages(already configured indeploy.yml) - Check the Actions tab for any deployment errors
Rate limit errors during build:
- The OSM API has rate limits
- Consider scheduling builds during off-peak hours
- Use mock data for development/testing
scouts/
├── .github/
│ └── workflows/
│ └── deploy.yml # GitHub Actions deployment workflow
├── app/
│ ├── layout.tsx # Root layout with metadata
│ ├── page.tsx # Home page
│ └── events/
│ ├── page.tsx # Events listing page
│ └── [eveningid]/
│ └── page.tsx # Individual event page
├── lib/
│ ├── metadata.ts # SEO and Open Graph utilities
│ └── osm/
│ ├── index.ts # OSM API client entry point
│ ├── client.ts # Real OSM API client
│ ├── mock-client.ts # Mock data client
│ ├── mock-data.ts # Mock data definitions
│ └── types.ts # TypeScript types for OSM API
├── .env.example # Example environment variables
├── .gitignore # Git ignore rules
├── next.config.js # Next.js configuration
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── README.md # This file
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
For questions or issues:
- Open an issue on GitHub
- Check the OSM API Documentation
- Refer to the Next.js Documentation