This project contains the application's UI built with React, Vite, TypeScript, and SWC. It requires Node.js v24, nvm (or n), and Yarn v4.
- Clone the repository and
cdinto the root directory:
git clone git@github.com:aquia/template-vite-react.git
cd template-vite-react- Setup Node.js and Yarn
# using nvm
nvm install --latest-npm
nvm use
# using n
n install auto
n use auto
# enable corepack
corepack enable yarn- Install dependencies:
yarn- Install pre-commit hooks:
yarn prepareTo build the application, run the following from the root directory:
yarn buildTo run unit tests, run the following from the root directory:
yarn testTo install Playwright browser dependencies, run:
yarn test:e2e:installTo run Playwright E2E smoke tests, run:
yarn test:e2eFor headed browser debugging:
yarn test:e2e:headedTo lint all files, run the following from the root directory:
yarn lintCI runs both yarn ci (lint + Jest) and yarn test:e2e on pull requests.
First, run the post-install script to create the local development environment file from the example environment file.
sh ./scripts/post-install.shTo start the local development server, run the following from the root directory:
yarn devThe demo app deploys to GitHub Pages at:
https://aquia-inc.github.io/template-vite-react/
GitHub Pages must be configured in the repository settings with Build and deployment source set to GitHub Actions.
The CI/CD workflow deploys on every push to main after the existing lint, unit test, Playwright, build, and semantic-release steps complete. Pull requests keep the local / base path and do not deploy.
The Pages build uses these public environment values:
VITE_PUBLIC_BASE_PATH=/template-vite-react/
VITE_CF_DOMAIN=https://aquia-inc.github.io/template-vite-react/
VITE_IDP_ENABLED=falseLeave the Cognito environment values blank or unset for the public demo. The app treats missing or invalid Cognito settings as auth disabled, so the Pages demo does not expose a real user pool.
For project Pages, Vite builds assets under /template-vite-react/ and React Router uses the matching basename. The workflow also copies dist/index.html to dist/404.html so direct visits to client-side routes can load the SPA fallback.