This is a Svelte starter template preconfigured with:
Create a repo from this template on GitHub.
This project uses Bun, a fast, all-in-one toolkit for JavaScript and TypeScript. It is a JavaScript runtime that acts as a drop-in replacement for Node.js, but also includes a built-in bundler, test runner, package manager, and other development tools.
To install Bun:
# macos / linux
curl -fsSL https://bun.com/install | bash
# windows
powershell -c "irm bun.sh/install.ps1|iex"
To check that Bun was installed successfully, open a new terminal window and run:
bun --version
# Output: 1.x.y
# See the precise commit of `oven-sh/bun` that you're using
bun --revision
# Output: 1.x.y+b7982ac13189
If you’ve installed Bun but are seeing a command not found error, you may have to manually add the installation directory (~/.bun/bin) to your PATH.
For more information, view the Bun docs.
To install dependencies:
bun i
This project expects a .env file. Copy the .env.example file and adjust the variables.
To start a development server:
bun --bun run dev
To run the development server with Node.js instead of Bun, you can omit the --bun flag.
Visit http://localhost:5173 in a browser to see the template app.
If you edit and save src/routes/+page.svelte, you should see your changes hot-reloaded in the browser.
To create a production version of the app:
bun --bun run build
You can preview the production build with bun --bun run preview.
This project uses Docker for containerization. It is recommended to install Docker Desktop.
Before running these commands, ensure .env exists.
To start all containers:
# using docker
docker compose up -d
# or with a rebuild of the images
docker compose up -d --build
# using bun script
bun --bun run docker:up
# or with a rebuild of the images
bun --bun run docker:build
The app container listens on
PORT(defaults to 3000), so after the stack is up, you should be able to visit http://localhost:3000 unless you override that value.
To view logs:
docker compose logs -f app
To stop all containers:
# using docker
docker compose stop
# using bun script
bun --bun run docker:stop
To stop and remove all containers:
# using docker
docker compose down
# using bun script
bun --bun run docker:down
This repo uses commitlint to help adhere to a commit convention. Commits should follow the Conventional Commits specification.
Commit types:
For help with authoring commit messages that adhere to the commit convention, use bun --bun run commit to launch an interactive CLI.
If you would like to create your own Svelte app from scratch, run:
bunx sv create my-app
To learn more about Svelte, take a look at the following resources: