Skip to content

Repository files navigation

Dice Roller Tools website

The standalone website for browser-based RPG Dice Roller tools, built with Nuxt 4, Vue 3, Nuxt UI and Tailwind CSS 4.

Development

Use Node.js 24 (see .nvmrc) and npm.

npm ci
npm run dev

Nuxt generates its TypeScript and ESLint configuration during installation (nuxt prepare). Use npm run typecheck to check TypeScript and Vue templates, npm run lint to check linting and formatting, and npm run format to format source files.

npm run generate
npm run preview

The static production website is generated in .output/public/. The GitHub Pages preset is configured in Nuxt; no Node.js server is needed in production.

Configuration

The documentation base URL is defined in Nuxt's public runtime configuration. By default, it points to https://dice-roller.github.io/documentation/.

Override it with NUXT_PUBLIC_DOCUMENTATION_BASE_URL in your environment or local .env file (see .env.example). Include the trailing slash, particularly when the documentation is hosted under a path.

For GitHub Pages, set a repository Actions variable named NUXT_PUBLIC_DOCUMENTATION_BASE_URL to change the URL used during generation. For Vercel previews, set the same environment variable in the project settings. Since the site is statically generated, changing the value requires a new build and deployment.

Structure and routing

  • app/app.vue: the application entry, wrapped in Nuxt UI's UApp provider.
  • app/layouts/default.vue: shared site header, navigation and footer.
  • app/pages/index.vue: the homepage.
  • app/pages/converter.vue: the data converter.
  • app/data/tools.ts: the tool catalogue and shared external links.
  • app/app.config.ts: Nuxt UI semantic colours and icons.
  • app/assets/css/main.css: shared Tailwind CSS and Nuxt UI styles.
  • nuxt.config.ts: framework, module and static hosting configuration.

The homepage uses Nuxt UI's Parchment preset (palette and tokens in app/assets/css/main.css, semantic colours and icons in app/app.config.ts). Fonts are bundled locally. The existing documentation logo is reused from the documentation repository; the current artwork derived from Font Awesome is retained pending its replacement. The hero background is a WebP-optimised copy of the documentation artwork, with a theme-aware overlay for text legibility. The converter runs locally in the browser and supports file input, conversion, copying and downloading exports.

Nuxt automatically creates routes from Vue files in app/pages/. For example, app/pages/index.vue becomes / and app/pages/converter.vue becomes /converter. Use NuxtLink for internal navigation. Components, layouts and composables can live in app/components/, app/layouts/ and app/composables/ respectively.

See the Nuxt documentation and Nuxt UI component catalogue.

Accessibility and contributing

Accessibility is a core project requirement. See CONTRIBUTING.md for our WCAG 2.2 AA target, manual review expectations and Playwright/axe-core tests.

npx playwright install chromium firefox
npm run test:e2e

The end-to-end tests generate and serve the static website automatically. Chromium runs the full suite; Firefox also runs the converter's functional tests.

Publishing

The Publish website workflow generates and deploys static files to GitHub Pages whenever main is updated. It can also be run manually from main. Other branches and pull requests run CI without publishing.

Before the first deployment:

  1. Open the repository's Settings → Pages and set the publishing source to GitHub Actions.
  2. Ensure the organisation's GitHub plan supports Pages for private repositories. The published website may be public even though its source repository is private.
  3. When ready to use the custom domain, configure tools.dice-roller.dev in Pages settings and add a DNS CNAME record for tools pointing to dice-roller.github.io. Enable HTTPS once DNS has been verified.

The workflow sets NUXT_APP_BASE_URL from the Pages configuration, including the trailing slash. This supports both the default project URL and the custom domain. No separate publishing branch is required.

Releases

Packages

Used by

Contributors

Languages