GETTING STARTED

Build and deployment

Check production output, configure SPA routing, and plan subdirectory hosting carefully.

Totems builds to static frontend assets. Hosting those assets does not provide the application services behind your interface.

Run the checks

From the Totems source folder, after installing dependencies:

yarn test
yarn lint
yarn build

test runs Vitest once. lint runs ESLint. build runs tsc -b before Vite and writes the production output to dist/. A development server can display a page even when the production TypeScript check fails, so always run the build.

The development source also includes a stricter bundle check. Use this only when your copy includes the referenced bundle tools; final customer-package scripts may differ:

yarn build:verify

That script builds with a manifest and runs tools/bundle/check-bundle-budgets.mjs. If a dependency change exceeds a budget, inspect the changed bundle before changing the limits.

Preview the actual output

yarn preview

Open the URL printed by Vite. Visit your primary pages, trigger lazy-loaded examples, and inspect the browser console and network requests. Preview is a local review server; choose a production host separately.

Keep the complete build output together. A partial upload can leave HTML referring to missing hashed JavaScript or CSS assets.

The current entry point uses BrowserRouter. Your host must return the application index.html for client routes such as /apps/projects, while still serving real asset files normally.

Configure this fallback using your host's SPA or rewrite setting. Then test a copied deep link in a fresh tab and reload it. Also check a missing route and a missing asset, so a broad fallback does not hide deployment errors.

No provider-specific deployment configuration is prescribed by this draft. The right rewrite syntax depends on the host you choose.

Hosting below a subdirectory

The current Vite config does not set base, and BrowserRouter does not set a basename. Some fixture image paths begin with /, so they resolve from the domain root.

If your application must live at a path such as /admin/, coordinate all three concerns:

  1. Set Vite's asset base for the deployment path
  2. Give the router the corresponding basename
  3. Audit root-relative asset URLs and other hard-coded paths

Vite's base option alone does not rewrite every string in your data files. Test navigation, direct reloads, images, fonts, and lazy chunks at the actual subdirectory. This draft does not claim the unchanged source is already verified for that deployment arrangement.

Before your own launch

Remove demo-only routes and content you do not intend to expose. Connect and test real authentication, authorization, persistence, and failure handling. Review keyboard use, narrow layouts, themes, content security, and dependency/asset licensing for your finished application.

Keep a record of the source revision and lockfile you started from. Apply future template or dependency changes in a branch, inspect the diff, and rerun your checks. Final customer packaging and the supported-environment policy remain release work; these guides are a working draft rather than a release guarantee.