> ## Documentation Index
> Fetch the complete documentation index at: https://opencals.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# METTLE — boutique gym template

> Free, open-source gym website template. Next.js 15, a strength, fight and recovery club in Melbourne with group classes on a day-by-day timetable, personal training by coach tier, recovery suites, lab tests, events and Training Blocks that unlock a bundle discount, built on the Opencals Storefront API.

A complete gym website you can clone and deploy today. METTLE is built for **a
gym that sells many kinds of session side by side**: group classes, personal
training, recovery, testing and events, all booked into one cart. Start here
for a boutique gym, a boxing or martial-arts club, a strength studio, or any
business that runs a class timetable next to 1:1 sessions. It runs on the same
[Storefront API](https://opencals.com/docs/api-reference/introduction.md) and typed
[TypeScript SDK](https://opencals.com/docs/guides/storefront-sdk.md) as [Haar](https://opencals.com/docs/open-source/haar.md),
[Frisor](https://opencals.com/docs/open-source/frisor.md), [Clear Care](https://opencals.com/docs/open-source/clarity.md),
[VOLT](https://opencals.com/docs/open-source/volt.md), [NOIR Drive](https://opencals.com/docs/open-source/noir.md),
[Fluently](https://opencals.com/docs/open-source/fluently.md), [Bali Villa Rentals](https://opencals.com/docs/open-source/bali-villas.md),
[Tensile](https://opencals.com/docs/open-source/reformer.md), [Alba Dental](https://opencals.com/docs/open-source/alba.md),
[Gable](https://opencals.com/docs/open-source/gable.md) and [Afterglow](https://opencals.com/docs/open-source/afterglow.md).

It's set in Melbourne (AUD, `Australia/Melbourne`) with two sites, the Engine
House in Collingwood and the Yard in Cremorne, plus Mettle Remote online: 12
coaches in three tiers, 16 class types run as 39 weekly series, and 60
products in all. The design is rubber flooring and chalk: every discipline
takes the colour of a calibrated bumper plate (red strength, blue fight,
yellow conditioning, green mobility), and times read like an LED interval
timer.

> [card] [Live demo](https://template-mettle.vercel.app)
>
> template-mettle.vercel.app

> [card] [Source code](https://github.com/letsopencals/template-mettle)
>
> letsopencals/template-mettle (MIT)

> [card] [Deploy to Vercel](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fletsopencals%2Ftemplate-mettle\&env=OPENCALS_API_KEY,AUTH_SECRET\&envDescription=API%20key%20from%20your%20Opencals%20dashboard%20and%20a%20random%20secret%20for%20auth\&project-name=mettle\&repository-name=template-mettle)
>
> One-click deploy

> [card] [Build it with AI](https://opencals.com/docs/ai-agents/build-booking-site-skill.md)
>
> build-booking-site skill

![METTLE boutique gym website template on a phone and a tablet: the day-by-day Floor timetable and the homepage](https://raw.githubusercontent.com/letsopencals/template-mettle/main/docs/cover.png)

METTLE: the Floor on a phone in hand, the homepage on a tablet

## The Floor

The timetable shows one day at a time on a horizontal clock, with **one lane
per discipline**. Each session is a block in its discipline's colour, placed
at its start time and as wide as it is long, with the coach, the site and a
places-left fill. The API drops a class once it's full. Classes repeat weekly,
so the template learns each series' pattern and shows a missing week as
**Full**, with a link to the next session with space. The day row sits right
above the board, and the filters cover site, discipline, coach and intensity.

Tapping a session opens its panel under the board: coach, site, intensity,
extras, places for a friend, the price with any offer, and **Load the bar**. On
a phone the lanes become an hour-by-hour list and the panel a bottom sheet.

![METTLE class timetable with a lane per discipline](https://raw.githubusercontent.com/letsopencals/template-mettle/main/docs/schedule.png)

The Floor: one lane per discipline, each class placed at its start time with places left

## The slot rack

Personal training, padwork, ring hire, the recovery suites and the lab tests
all book the same way: pick the service and the option, then the coach (or
the first free one), the site and the length, then a day and a plain time
slot directly under it. The price updates in place. PT comes in three coach
tiers at 30, 60 or 90 minutes; the price scales per 30 minutes.

![METTLE personal training booker with coach tiers and start times](https://raw.githubusercontent.com/letsopencals/template-mettle/main/docs/coaching.png)

The slot rack: personal training by coach tier, length and start time

## The Bar and Training Blocks

The cart is a barbell: every session you add racks a plate in its discipline's
colour. Under the bar, a scale marks the **Training Block** thresholds: book
A$100 in one order for 10% off, A$250 for 15%. They're ordinary automatic
discounts with a minimum purchase amount, so the cart applies them itself; the
template only shows how far you are. `/blocks` has four curated bundles, such
as Fight Week (three fight classes and a contrast suite session): you pick a
real slot for each line and book the whole block in one checkout.

There are no memberships or class packs on the API, so METTLE doesn't fake
them. `/memberships` is a clearly labelled preview ("Launching 2027"), and its
only call to action is the free First Round intro.

![METTLE cart shown as a barbell with Training Block discount](https://raw.githubusercontent.com/letsopencals/template-mettle/main/docs/bar.png)

The Bar: the cart as a loaded barbell, with the Training Block discount applied

![METTLE booking confirmation styled as a race bib](https://raw.githubusercontent.com/letsopencals/template-mettle/main/docs/thank-you.png)

The race-bib confirmation

## The gym model

This is the part worth copying even if you never ship METTLE itself. It uses
existing Opencals features only.

| Piece | How it's modelled |
| - | - |
| A site | A location with its address, coordinates and hours; Mettle Remote is an online location with a `link` |
| A discipline | A collection (`strength`, `fight`, `conditioning`, `mobility`, `recovery`, `coaching`, `lab`, `events`), mapped to its plate colour in `lib/site-config.ts` |
| A class | A product group with **one variant per class × site × coach** (`barbell-club-collingwood-jo`): its own weekly schedule, one location, one coach, `maxAttendees` = places |
| Personal training | One variant per coach tier with a 30-minute base and `allowCustomDuration` up to 90; the Staff rule stops a coach being double-booked across classes and PT |
| Partner PT | One booking for two, sent as the custom attribute `people = "2"` |
| Contrast suite, infrared suites, ring hire, open floor | Staffless products (Self rule): six places in the contrast suite, one per infrared suite, one open-floor product per site |
| Lab tests and the free intro | 1-seat products; the First Round intro costs nothing and skips payment |
| Events | Dated products in the `events` collection |
| Hand wraps, glove hire, towel and locker, a recovery shake, compression boots, a cold plunge, a session video breakdown | 7 add-ons |
| First order, midday classes, Training Blocks, `METTLE10` | 25% off a first order of classes, 20% off classes starting 11:00–14:30 on weekdays, 10% from A$100 and 15% from A$250, and a 10% code. They don't combine: each line gets the biggest one |
| Health waiver, injuries, fight experience, goal | Checkout questions; the waiver is a required checkbox |

Availability is read once per class series for the Floor, and once per
service, coach and site for the slot rack, each for the whole booking window
and cached for 60 seconds. The day strips and start times are worked out in
the browser.

## What's inside

| Feature | Notes |
| - | - |
| Home | A live board of the next sessions, the disciplines with this week's counts and prices, today's Floor, Training Blocks, coaches, recovery and lab, memberships preview, the sites |
| The Floor | One day, one lane per discipline, places left, Full sessions with "next with space", filters in the URL |
| Slot rack | PT, padwork, ring hire, recovery suites and lab tests: option, coach, site, length, day and time on one screen |
| The Bar | A barbell cart with Training Block thresholds and a hold timer |
| Checkout | The Bar across the top, then your details, the health waiver and questions, and Stripe or pay at the desk |
| Confirmation | A race bib with the booking number and a stripe per session, calendar links, what to bring and how to get there |
| Accounts | Passwordless 6-digit code; a training log with up next, Join for online sessions, move and cancel up to 12 hours before |
| Coaches, sites, disciplines, events | A page per coach, site and discipline, and the events as a fight card |
| SEO | Per-page metadata, Open Graph, `ExerciseGym` structured data per site, `robots.txt`, `sitemap.xml` |
| Stack | Next.js 15, TypeScript, Tailwind v4, `@opencals/storefront-sdk` v0.3.20 |

## Get started

**1. Clone and install**

```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
git clone https://github.com/letsopencals/template-mettle.git
cd template-mettle
npm install
```

**2. Add your API key**

Create a Dev Store in the [Opencals dashboard](https://opencals.com) with the
country set to **Australia** (for AUD) and choose the **METTLE** dataset
(`boutique_gym`). It seeds the two sites and Mettle Remote, 12 coaches, 60
products, 7 add-ons, the checkout questions, five discounts and sample
bookings. Then grab a private storefront key (`spk_`, see
[API keys](https://opencals.com/docs/authentication.md#api-keys)) and set `OPENCALS_API_KEY` and
`AUTH_SECRET` in `.env.local`.

**3. Run it**

```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
npm run dev
```

Your classes, coaches and sites render immediately.

**4. Deploy**

Push to your own repo and
[deploy to Vercel](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fletsopencals%2Ftemplate-mettle\&env=OPENCALS_API_KEY,AUTH_SECRET\&envDescription=API%20key%20from%20your%20Opencals%20dashboard%20and%20a%20random%20secret%20for%20auth\&project-name=mettle\&repository-name=template-mettle),
or host anywhere Next.js runs.

> [!NOTE]
>
> Pages are server-rendered, so their API calls carry no browser `Origin`.
> Leave **allowed origins** empty on the key you give this template, or those
> calls are rejected.

> [!NOTE]
>
> Set **Storefront Base URL** in your dashboard (Settings → API) to your
> deployed domain. Every customer link (view, reschedule, cancel, leave
> feedback) is built as `{storefrontBaseUrl}/link/{token}`.

## Make it yours

MIT-licensed: rebrand it, restructure it, or use it for client work. Gym copy
lives in `lib/site-config.ts` (discipline colours, class intensity, coach bios
and tiers, the Training Blocks and their thresholds, the memberships preview).
Every colour and font is a Tailwind v4 `@theme` token in `app/globals.css`, and
`DESIGN.md` describes the design system:

```css theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
@theme {
  --color-rubber: #121212;       /* the floor */
  --color-chalk: #f2efe8;        /* paper sections */
  --color-plate-red: #d7262e;    /* strength */
  --color-plate-blue: #1f5fbf;   /* fight */
  --color-plate-yellow: #f2c230; /* conditioning, and the booking action */
  --color-plate-green: #1e9e5a;  /* mobility */
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.