Note
Last updated on 2025-07-25
This document outlines the key technical aspects of the sveltevietnam.dev project.
Each technical decision is to be made with considerations of the following:
- Minimalism: keep the system simple and easy to understand with only necessary components, modules, and abstraction layers.
- Scalability: avoid potential technical debts; make good trade-off between consistency and flexibility. Avoid premature abstraction and predicting the future.
- Developer Experience: use innovative and mature technologies, reduce development friction, write self-documented code. Focus on delivering value over over-engineering infrastructure.
- Performance: deliver solutions that enable good end-user experience. Prefer functionality over decoration.
This section lists the current technical stack for the project. The stack is subject to change as the project evolves. Discussions are welcome.
- cloudflare: domain hosting, infrastructor provider for both frontend, backend, and database (D1)
- pnpm: package manager, alternative to npm
- turborepo: manage dependencies between projects in the monorepo
- vite: build tool & development server
- svelte-kit: fullstack metaframework
- lefthook: pre-commit git hook for code commit sanity
- eslint & prettier & stylelint: linting & formatting tools
- wrangler: local development CLI for cloudflare services (pages, workers, D1, ...)
- svelte: the frontend framework (think react or vue)
- postcss: CSS preprocessor (think Sass but more plugin-based & JS-friendly)
- tailwindcss: utility-first CSS framework (think Bootstrap but more performant & customizable)
- animejs: complex animation
Other transition, state management, routing solutions are provided first-party by svelte & svelte-kit.
We use Vitest and Playwright for testing.
Typescript or Javascript?
Important
Prefer JS (preferably with JSDocs) for libraries and scripts, and TS for sites and applications.
Sites (sites/... in our case) typically already have a build step or at least some preprocessing before the dev server can serve modules to clients. TS in these cases provides good developer experience without much tradeoff. In libraries or shared packages, however, having TS will introduce complexity and friction to the development workflow because we would lose direct access to the source code and have to rely on dependencies around build & workflow setup. JS with JSDocs is usually sufficient.
Follow instructions from DEVELOPMENT to get started.