This is a template for building web applications using Svelte. It includes a basic setup with authentication, a responsive navbar, and a sidebar.
You can fork this repository or copy the code to start your own Svelte project. Make sure to install the necessary dependencies before running the application.
npm i
.env
file to setup auth0 and API server variables:VITE_API_SERVER=<your API server base URL>
VITE_AUTH0_DOMAIN=<your Auth0 domain>
VITE_AUTH0_CLIENT_ID=<your Auth0 client ID>
npm run dev
To add a new page to your Svelte application:
src/routes/
with the name of your new page.+page.svelte
file.+page.svelte
file.src/lib/menu.js
, add menu icon file into folder src/lib/svgs/
profile page is a good example
To create a production version of your app:
npm run build
You can preview the production build with npm run preview
.
Controls the build type for the SvelteKit application. Set to static
to build a static site with pre-rendered pages.
Usage:
export SVELTEKIT_BUILD_TYPE=static
npm run build
This project supports deployment to vercel as default, you can also build a static dist to deploy to nginx or other static file servers.
npm run build
docker build -t svelte-ui-template:latest .
Change port number if needed
docker run -d -p 80:80 svelte-ui-template
GitHub action docker-publish.yml
will build and push the Docker image to GitHub Container Registry (ghcr.io) when you push changes to the main branch or create a new tag, you can also manually trigger a workflow run.