Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,22 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "24"
cache: npm
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Restore cache
uses: actions/cache@v4
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lock') }}-
- name: Install dependencies
run: npm ci
run: bun install --frozen-lockfile
- name: Build with Next.js
run: npx --no-install next build
run: bun run build
- name: Add .htaccess
run: cp deployment/htaccess.txt out/.htaccess
- name: Install lftp
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ jobs:

steps:
- name: Begin CI...
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 24
- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install Node.js dependencies
run: npm ci
- name: Install dependencies
run: bun install --frozen-lockfile

- name: Lint
run: npm run lint
run: bun run lint
40 changes: 40 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

This is the Wye & Welsh Land Rover Club (WWLRC) website, a statically exported Next.js site deployed via FTP.

## Commands

```bash
bun run dev # Start development server
bun run build # Build static export (outputs to /out)
bun run lint # Run ESLint
```

Always run `bun run build` before pushing to ensure static export works correctly.

## Architecture

### Static Export
The site uses Next.js with `output: 'export'` (configured in `next.config.mjs`), generating a fully static site in the `/out` directory. This means all data fetching happens at build time.

### Spanner API Integration
The site fetches data from the club's management system at `spanner.wwlrc.co.uk`. The API client is in `src/spanner/`:
- `api.ts` - Base fetch wrapper using `pathcat` for URL construction
- `wwlrc.ts` - Club-specific constants (club ID, Facebook link)
- `events.ts` - Fetches rally/event data
- `blog.ts` - Fetches news posts

Data is fetched at build time in page components (e.g., `getPosts()` in `src/app/page.tsx`).

### Directory Structure
- `src/app/` - Next.js App Router pages (home, about, join, events, sponsors)
- `src/components/` - Shared React components (navbar, footer, calendar, blog)
- `src/spanner/` - API client for Spanner backend
- `deployment/` - Contains htaccess config copied to output during deploy

### Deployment
CI/CD via GitHub Actions (`.github/workflows/build-deploy.yml`) builds and uploads to FTP on push to main.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ This is the repo for the Wye & Welsh Land Rover Club's website.

## Development Setup

1. Install nodejs/npm for your system. See [https://nodejs.org/en/download]
1. Install bun for your system. See [https://bun.sh]

2. Run `npm install` to install the dependencies
2. Run `bun install` to install the dependencies

3. Run `npm run dev` to test locally. This will automatically start a web server, and will output a URL that you can visit in a web browser.
3. Run `bun run dev` to test locally. This will automatically start a web server, and will output a URL that you can visit in a web browser.

## Building

Before pushing changes, make sure it builds statically by running `npm run build` (I should really add this in CI).
Before pushing changes, make sure it builds statically by running `bun run build` (I should really add this in CI).
Loading