This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Gatsby-based marketing and documentation site for Roadie.io. The site serves:
- Marketing pages at
roadie.io - Documentation at
roadie.io/docs/ - Backstage plugin documentation
- Blog posts, case studies, and changelog
# Start development server (uses Netlify Dev, runs on port 8888)
yarn start
# Direct Gatsby development (runs on port 8000)
yarn develop
# Clean Gatsby cache
yarn clean# Build for production (includes prebuild step)
yarn build
# Serve production build (runs on port 9000)
yarn serve
# Run Cypress e2e tests
yarn test
# Run Jest unit tests
yarn test:unit
# Lint code
yarn lint
# Format code
yarn format# Preview deployment to Netlify
yarn previewRequired environment variables (see .env.sample):
CONTENTFUL_ACCESS_TOKEN- Contentful API key (found in 1Password)CONTENTFUL_SPACE_ID- Contentful space IDROADIE_API_TOKEN- Required for build (downloads OpenAPI docs)GITHUB_TOKEN- Required for build (downloads Roadie Local releases)SITE_RECAPTCHA_KEY- reCAPTCHA key for forms
-
Markdown Files (
/content)content/docs/- Documentation pagescontent/backstage/plugins/- Generic Backstage plugin docscontent/legal-notices/- Legal pagescontent/team/- Team member profiles
-
Contentful CMS
- Blog posts
- Backstage Weekly content
- Backstage Bites videos
- Case studies
- Changelog entries
- Plugin pages
-
External APIs (fetched during build)
- OpenAPI specifications from
api.roadie.so - Roadie Local CLI builds from GitHub releases
- NPM package data (stored in Netlify Blobs)
- OpenAPI specifications from
Pages are dynamically created in gatsby-node.mjs using the createPages API:
- Blog posts:
/blog/{slug}(from Contentful) - Docs:
/docs/{path}(from Markdown) - Plugins:
/backstage/plugins/{slug}(from Contentful) - Case studies:
/case-studies/{slug}(from Contentful) - Changelog:
/changelog/and/changelog/{slug}(from Contentful, paginated) - Backstage Bites:
/backstage-bites/{slug}(from Contentful) - Legal notices:
/legal-notices/{slug}(from Markdown) - Tags:
/tags/{tag}(from blog post tags)
Templates are in src/templates/ and page creation logic is in src/pageCreation/.
src/components/- React components organized by featuresrc/pages/- Gatsby static pages (index, pricing, etc.)src/templates/- Templates for dynamically generated pagessrc/hooks/- Custom React hookssrc/stylesheets/- Global styles and Tailwind imports
- Tailwind CSS - Primary styling framework
- PostCSS - CSS processing
- Configuration in
tailwind.config.jsandpostcss.config.js - Theme constants in
src/theme.mjs
-
Prebuild (
bin/fetch_api_docs_and_roadie_local.js):- Downloads OpenAPI specs to
static/ - Downloads Roadie Local CLI builds to
static/downloads/roadie-local/ - Creates version index for CLI downloads
- Downloads OpenAPI specs to
-
Main Build (
gatsby build):- Fetches content from Contentful
- Processes Markdown files
- Generates pages dynamically
- Indexes content in Algolia (production only)
- Stores NPM package data in Netlify Blobs
- Algolia - Search indexing and autocomplete
- Queries defined in
src/queries/agolia.mjs - Indexing skips on preview/PR builds
- Search UI components use
@algolia/autocomplete-js
- Production:
roadie.io(SITE_NAME=roadie, CONTEXT=production) - Preview:
preview.roadie.io(SITE_NAME=roadie-preview) - Uses Contentful preview API - PR Previews: Deploy previews on Netlify (CONTEXT=deploy-preview)
Different environments use different Contentful hosts:
- Production uses
cdn.contentful.com - Preview/local uses
preview.contentful.com
- Cypress: E2e tests in
cypress/e2e/ - Jest: Unit tests (run with
yarn test:unit) - Test config in
cypress.config.mjsand root-level Jest config
- ESLint:
.eslintrc.jsfor linting rules - Prettier:
.prettierrcfor formatting - Husky: Pre-commit hooks run linter and formatter on staged files
- URLs always use trailing slashes (
trailingSlash: 'always'in Gatsby config) - The site uses CSP headers configured in
src/gatsby/cspDirectives.mjs - Module resolution allows importing from
components/as an alias - SVG files with
.inline.svgextension are imported as React components - The docs site structure is found at
src/doc/layouts(note: typo in original README)