This is a Nix-powered Svelte template with Effect integration. It builds an app fully reproducibly, including tests.
To quickly get started with this template, run:
mkdir project
cd project
nix flake init -t github:cor/svelte-effect-nix-template
git initTo build the app, run:
nix build .#appThis will:
- Install all dependencies
- Build the application
- Run tests using
vitest - Output the build artifact to
./result
To preview the built app in a browser, run:
nix run .#app-previewThis will:
- Build the app if it hasn't been built already
- Start a local server using
miniserve - Serve the app on http://localhost:8080
The preview server uses SPA mode, so client-side routing will work correctly.
To start the development server with hot reloading:
nix run .#app-devThis will install dependencies and start the Svelte development server.
To enter a development shell with all necessary tools:
nix developThis provides:
- Node.js and npm
- TypeScript language server
- Svelte language server
- Tailwind CSS language server
- Other development tools
Format all code in the project with:
nix fmtThis uses:
- Prettier to format TypeScript, JavaScript, JSON, Markdown, Svelte, HTML, and CSS files according to the project's configuration in
.prettierrc - nixpkgs-fmt to format Nix files