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
9 changes: 9 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- BEGIN:nextjs-agent-rules -->

## This is NOT the Next.js you know

This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.

This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.

<!-- END:nextjs-agent-rules -->
30 changes: 30 additions & 0 deletions docs/admin-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Editing the site with the admin panel

The band edits the site at `https://clarksbowlingclub.com/admin`. It replaces the Google Sheet.

## Signing in

Sign in with your own `@clarksbowlingclub.com` address and password. Every account can edit all the content. Ask a developer to add a new member: a developer creates the account under **Users**.

## What you can edit

| Menu | What it controls | Notes |
| --- | --- | --- |
| About page | The text of `/about` | Title and content, in English and French |
| Tour page | The intro text of `/tour` | Title and content, in English and French |
| Tour dates | The gigs on `/tour` | Date and venue are required. Links must start with `https://`. The site works out which dates are upcoming and which are past |
| Music items | The players on `/music` | Pick the type (YouTube, Spotify, Bandcamp) and paste the player link from that site. The category is written in both languages. Drag the rows to change their order |
| Lyrics | The songs on `/lyrics` | A song shows on the site only when its status is `published` and it has lyrics. Keep unfinished songs as `draft`. Drag the rows to change their order |
| Media | Images | Not used on a page yet |

## Switching language

Pages with two languages have an `en` / `fr` switch at the top right of the edit form. Fill in both. If the French is empty, the site shows the English instead (lyrics excepted: the French lyrics tab can stay empty).

## When changes appear

Saving or deleting a document refreshes the site straight away. If a change does not appear after a minute, reload the page without the cache (Cmd/Ctrl + Shift + R) before asking a developer.

## If something goes wrong

A field that is invalid shows a red message under it and the document is not saved. Fix it and save again. For anything else, send the address of the page and what you did to a developer.
2 changes: 1 addition & 1 deletion docs/tickets/INSTRUCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ One checkout, one ticket in flight at a time, except under `/orchestrate-tickets
| Dev server | `pnpm dev --port <4000 + issue number>`, e.g. ticket 27 uses 4027. Run it in the background and stop it when you're done |
| The user's own server | Port 3000 belongs to the user. Never use it, never stop it |
| Env file | `.env.local` in the repo root. Read variable names only. Once Payload lands (#33), its `DATABASE_URL` must point at the Neon `dev` branch, because `pnpm dev` will push the Payload schema to it |
| Content | The published Google Sheet, read as CSV by `src/utils/fetchSheet.ts`, until Payload replaces it |
| Content | Payload when `DATABASE_URL` is set (`src/lib/data/payload.ts`), otherwise the published Google Sheet (`src/lib/data/sheet.ts`). Production reads the sheet until the switchover in #33. Local storage variables are `S3_ENDPOINT`, `S3_REGION`, `S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY` and `S3_BUCKET`; `neon checkout` writes Neon's `AWS_*` names, so copy them across. `pnpm content:import` and `pnpm content:compare` run against whatever `DATABASE_URL` points at |
| Artefacts | Screenshots, logs and scratch scripts go in `.git/ticket/<issue number>/artefacts/`, never in the working tree |

Rules:
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import nextTs from "eslint-config-next/typescript";
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts"]),
globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts", "src/migrations/**"]),
]);

export default eslintConfig;
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build]
command = "pnpm build"
command = "if [ -n \"$DATABASE_URL\" ]; then pnpm exec payload migrate; fi && pnpm build"
publish = ".next"

[build.environment]
Expand Down
23 changes: 22 additions & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
import { withPayload } from "@payloadcms/next/withPayload";
import type { NextConfig } from "next";

const storageEndpoint = process.env.S3_ENDPOINT;

const nextConfig: NextConfig = {
cacheComponents: true,
images: {
remotePatterns: storageEndpoint ? [new URL(`${storageEndpoint}/**`)] : [],
},
// Without a database the admin and Payload API stay hidden, as before Payload.
async rewrites() {
if (process.env.DATABASE_URL) return [];
return {
beforeFiles: [
{ source: "/admin/:path*", destination: "/nope" },
{
source: "/api/:path((?!send-emails$).*)",
destination: "/nope",
},
],
afterFiles: [],
fallback: [],
};
},
};

export default nextConfig;
export default withPayload(nextConfig);
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,33 @@
"name": "cbc",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "eslint",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"content:import": "NODE_ENV=production payload run src/scripts/importSheet.ts",
"content:compare": "NODE_ENV=production payload run src/scripts/compareSources.ts",
"payload": "payload"
},
"dependencies": {
"@payloadcms/db-postgres": "3.93.0",
"@payloadcms/next": "3.93.0",
"@payloadcms/storage-s3": "3.93.0",
"clsx": "^2.1.1",
"focus-trap-react": "^12.0.3",
"graphql": "^16.15.0",
"next": "16.4.6",
"nodemailer": "^10.5.0",
"papaparse": "^5.7.0",
"payload": "3.93.0",
"react": "^19.3.1",
"react-dom": "^19.3.1",
"react-hot-toast": "^2.6.1",
"react-icons": "^5.7.0",
"sharp": "^0.35.5",
"three": "^0.187.0"
},
"devDependencies": {
Expand Down
Loading
Loading