pracitcal-prompt-svelte Svelte Themes

Pracitcal Prompt Svelte

sgoldfarb2's FrontEnd Master's project, sveltified

Svelte Starter Template

This is a Svelte starter template preconfigured with:

Getting Started

GitHub Template

Create a repo from this template on GitHub.

Set Up Bun

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.

Install Dependencies

To install dependencies:

bun i

Prepare Environment Variables

This project expects a .env file. Copy the .env.example file and adjust the variables.

Developing

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.

Building

To create a production version of the app:

bun --bun run build

You can preview the production build with bun --bun run preview.

Docker

Install Docker

This project uses Docker for containerization. It is recommended to install Docker Desktop.

Download Docker Desktop

Run with Docker

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

Committing

This repo uses commitlint to help adhere to a commit convention. Commits should follow the Conventional Commits specification.

Commit types:

  • ✨ feat: A new feature
  • 🐛 fix: A bug fix
  • 📚 docs: Documentation only changes
  • 💎 style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • 📦 refactor: A code change that neither fixes a bug nor adds a feature
  • 🚀 perf: A code change that improves performance
  • 🚨 test: Adding missing tests or correcting existing tests
  • 🛠 build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ⚙️ ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • ♻️ chore: Other changes that don't modify src or test files
  • 🗑 revert: Reverts a previous commit

For help with authoring commit messages that adhere to the commit convention, use bun --bun run commit to launch an interactive CLI.

Learn More

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:

Top categories

Loading Svelte Themes