Website template for structured, accessible static websites, built with HTML, CSS, TypeScript and Vite. spa-template.liberacode.dev
README.md

spa template #

A starter for multi-route websites of small businesses and personal projects. One HTML shell holds the header and footer, a client-side router renders the pages, and the build prerenders every route as static HTML. The template uses semantic HTML, design tokens, modular CSS and small TypeScript modules without a frontend framework. An optional PHP backend handles the contact form.

All layout, styling and behavior is code in the repository. The site does not depend on a CMS or on external services. Vite and Biome run only during development. The demo includes a home page, layout blocks, interactive patterns, a contact form, media patterns and sample legal pages. The light/dark palette and the [st] mark are the demo identity of the template.

Requirements #

  • Node.js >=22.18.0 (.nvmrc selects Node 26) and npm
  • Optional, for the contact form: PHP 8.1 or newer on the server, Composer
  • Optional, for new images: ImageMagick 7 with AVIF and WebP support

Setup and commands #

npm ci
npm run dev      # Dev server at http://localhost:5173
npm test         # Unit tests
npm run check    # Lint and format check
npm run build    # Production build in dist/

For production, upload the contents of dist/ to an Apache server; see Deployment.

Documentation #

File Content
Getting started Set up a new project: identity, theme, content, images, contact
Technical documentation Router, pages, CSS, contact backend, build, deployment
Cheat sheet Recipes: remove features, add pages and components

Changes per version are listed in CHANGELOG.md.

Third-party components #

The template code is MIT-licensed. The following parts have their own licenses:

  • Inter and JetBrains Mono: fonts in src/assets/fonts/, SIL Open Font License 1.1. The license texts are next to the font files.
  • Demo images: from Pexels, used under the Pexels license. Replace them with the project's own images. Sources:
    • smiling-brunette-at-office-desk-19747894 (Aathif Aarifeen)
    • code-on-computer-screen-14553730 (Bibek Ghosh)
    • woman-sitting-in-front-laptop-1181677 (Christina Morillo)
    • focused-coding-session-with-laptop-and-coffee-34803969 (Daniil Komov)
    • minimalist-workspace-with-laptop-and-headphones-34803981 (Daniil Komov)
    • home-office-workspace-with-laptop-and-coffee-34803978 (Daniil Komov)
    • photo-of-turned-on-laptop-computer-943096 (Danny Meneses)
    • modern-workspace-with-laptop-and-headphones-36781594 (Jakub Zerdzicki)
    • man-sitting-in-an-office-19805878 (Naboth Otieno)
    • a-modern-home-desk-setup-with-a-computer-and-a-tablet-20694725 (Pew Nguyen)
  • ALTCHA: proof-of-work CAPTCHA of the optional contact form (browser widget and PHP verification), MIT License.
  • PHPMailer: SMTP sending of the optional contact form, installed with Composer, LGPL-2.1 License.

A site without the contact form does not use the PHP parts of ALTCHA and PHPMailer.

License #

MIT © liberacode