No description
  • TypeScript 91.1%
  • Nix 4.9%
  • HTML 2.2%
  • CSS 1.8%
Find a file Use this template
hayshin 418634b5c5
All checks were successful
CI / Check, test, and build (push) Successful in 27s
feat: add production-ready app foundations
- add lazy routes, error handling, metadata, and validated environment config
- expand browser tests with accessibility and coverage reporting
- publish coverage artifacts in CI and document new template behavior
2026-08-27 23:59:43 +05:00
.forgejo/workflows feat: add production-ready app foundations 2026-08-27 23:59:43 +05:00
src feat: add production-ready app foundations 2026-08-27 23:59:43 +05:00
.env.example feat: add production-ready app foundations 2026-08-27 23:59:43 +05:00
.gitignore feat: add Vite+ frontend template 2026-08-27 14:14:21 +05:00
devenv.lock refactor: strengthen frontend template quality 2026-08-27 23:26:18 +05:00
devenv.nix feat: add production-ready app foundations 2026-08-27 23:59:43 +05:00
devenv.yaml refactor: strengthen frontend template quality 2026-08-27 23:26:18 +05:00
index.html feat: add Vite+ frontend template 2026-08-27 14:14:21 +05:00
package.json feat: add production-ready app foundations 2026-08-27 23:59:43 +05:00
pnpm-lock.yaml feat: add production-ready app foundations 2026-08-27 23:59:43 +05:00
pnpm-workspace.yaml feat: add production-ready app foundations 2026-08-27 23:59:43 +05:00
README.md feat: add production-ready app foundations 2026-08-27 23:59:43 +05:00
tsconfig.json feat: add Vite+ frontend template 2026-08-27 14:14:21 +05:00
vite.config.ts feat: add production-ready app foundations 2026-08-27 23:59:43 +05:00

Vite+ Frontend Template

A small standalone SPA template using React, TypeScript, Tailwind CSS, React Router, i18next, and Vite+. The project-local vite-plus development dependency provides the vp CLI in every environment.

Requirements

  • Nix with flakes enabled
  • devenv
  • A package manager supported by Vite+ (pnpm is pinned through packageManager)

Setup

devenv shell
pnpm install

Development

Start the Vite development server:

pnpm dev

The starter includes lazy-loaded home, about, and not-found routes, a localized loading state, route error handling, and accessible focus management. Each page updates localized document metadata through PageMetadata.

Configuration

Client environment variables are typed and validated in src/config/env.ts. Copy .env.example when local overrides are needed:

cp .env.example .env

VITE_APP_NAME changes the application name used in document titles. Optional VITE_API_URL must be an absolute URL when set.

Internationalization

English and Russian translations live in src/locales/. i18next detects the browser language, falls back to English, and saves manual language choices in localStorage. Translation resources are type-checked through src/i18next.d.ts.

Add another locale by creating its resource module, registering it in src/i18n.ts, and adding it to the language switcher.

Production

Create a production build in dist/:

pnpm build

Preview that build locally:

pnpm preview

This template uses BrowserRouter. Production hosts must rewrite unknown application routes, such as /about, to index.html so direct visits and page reloads work.

Quality checks

Run Vite+ formatting, linting, and type checks together:

pnpm check

Or run individual tasks:

pnpm lint
pnpm fmt
pnpm test
pnpm test:coverage

pnpm test runs browser-like Vitest tests covering routes, navigation, metadata, error handling, language switching, and automated accessibility checks. pnpm test:coverage writes text, HTML, and LCOV reports to coverage/. CI uploads the coverage report without enforcing a threshold.

Vite+ supplies the development, build, preview, check, lint, and formatting commands behind these package scripts.