lgs / svelte-headlessui-starter

πŸš€ Launch your next Svelte app using Headless UI. Mirror of Svelte Headless UI Starter on Codeberg.

Home Page:https://codeberg.org/vhs/svelte-headlessui-starter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Svelte Headless UI Starter

Latest NPM version Weekly Downloads Minimum SvelteKit version AGPL licensed

Launch your next Svelte app using Headless UI.

Svelte Headless UI Starter

Svelte Headless UI Starter is a template designed to make it easier and faster to build libre Svelte apps using Headless UI. The starter intends to remain as close as possible to the default experience one might achieve using npm init svelte@next and then building a minimalist app skeleton with Headless UI.

Demo

View the online demo to see what you can expect.

Highlights

  • πŸ—οΈ SvelteKit cybernetically enhanced routing
  • πŸ”¨ Svelte for developing fast, lightweight apps
  • 🎨 Tailwind CSS with Forms and Typography plugins
  • πŸ§ͺ Headless UI for a sophisticated, accessible UI
  • πŸ’„ Prettier with Tailwind automatic class sorting
  • 🚩 Unplugin Icons to access to all IcΓ΄nes icons
  • ⚑️ Cssnano for production stylesheet compression
  • ⚑️ Service Worker dynamic resource caching
  • ✏️ Fontsource self-hosted web font integration
  • 🎭 Playwright browser testing framework
  • πŸ¦‹ Changesets to manage versioning and changelogs
  • πŸ“ˆ Basic SEO with large social sharing cards
  • πŸš€ Vercel deployments functional out of the box
  • πŸ” OAuth via GitHub, extendible to other providers
  • βš—οΈ Supabase integration for dynamic navigation
  • πŸ‘· Gravitar support for non-logged in users
  • πŸ“„ AGPL-licensed free (as in freedom) software

Structure

The application structure is as follows:

β”œβ”€β”€ src
β”‚   β”œβ”€β”€ environment
β”‚   β”œβ”€β”€ hooks
β”‚   β”œβ”€β”€ lib
β”‚   β”‚   β”œβ”€β”€ core
β”‚   β”‚   β”‚   └── services
β”‚   β”‚   β”‚       β”œβ”€β”€ auth
β”‚   β”‚   β”‚       β”œβ”€β”€ http
β”‚   β”‚   β”‚       └── supabase
β”‚   β”‚   β”œβ”€β”€ data
β”‚   β”‚   β”œβ”€β”€ models
β”‚   β”‚   β”‚   β”œβ”€β”€ classes
β”‚   β”‚   β”‚   β”œβ”€β”€ interfaces
β”‚   β”‚   β”‚   └── types
β”‚   β”‚   β”œβ”€β”€ shared
β”‚   β”‚   β”‚   β”œβ”€β”€ components
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ auth
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ form
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ meta
β”‚   β”‚   β”‚   β”‚   └── navigation
β”‚   β”‚   β”‚   └── layouts
β”‚   β”‚   └── utils
β”‚   └── routes
β”‚       β”œβ”€β”€ account
β”‚       └── api
β”‚           β”œβ”€β”€ auth
β”‚           └── user
β”œβ”€β”€ static
└── tests

Developing

Once you've created a project and installed dependencies with pnpm install, start a development server:

pnpm run dev

# or start the server and open the app in a new browser tab
pnpm run dev -- --open

Making commits

Use the approach that best suits your personal preferences and preferred work style. If you would like to add emojis to your commit messages, see Emojify Conventional Commits with Git for one approach.

Adding a changeset

To add a changeset run pnpm changeset and follow the prompts. If this is your first time adding a changeset, run pnpm changeset init to create the .changeset folder and commit it to the repository.

Building

To create a production version of your app:

pnpm run build

You can preview the production build with npm run preview.

Versioning

To create a new version run pnpm changeset version and follow the prompts.

Publishing

To publish a new version run pnpm changeset publish to generate a CHANGELOG, followed by git push --follow-tags. Assumes you have logged into NPM and have a git remote configured.

Deploying

Supported deployment environments include Vercel, Cloudflare and Netlify. Other environments may be included in the future. See adapter-auto for most current list of supported environments. Instructions for Vercel and Cloudflare included below.

Vercel

To deploy your app to Vercel run vercel for testing or vercel --prod for production. Assumes you've signed-up for and authenticated with Vercel from the Vercel CLI. No additional configuration is required. If you wish to create a Continuous Integration (CI) setup with a git repo connected to Vercel, consult the Vercel docs.

Cloudflare

Cloudflare is a little more involved and deployments blocked until sk-auth/issues/42 is resolved. The referenced issue has an open pull request in case you wish to fork until the package is updated with a fix.

Start by updating the adapter used in svelte.config.js and change the import for adapter-auto to adapter-cloudflare. The Cloudflare adapter is already included with adapter-auto, though you may wish to pnpm add -D adapter-cloudflare to be more explicit and then remove adapter-auto from the project.

You can get a CI setup running without any additional configuration described in the Cloudflare Docs for Svelte. Reference the engines property in package.json for the minimum Node version required to build the project.

For CLI-based deployments use the wrangler publish command. Assumes you've signed-up for and logged into your Cloudflare account using Wrangler CLI, and that a wrangler.toml has been created within the project. See Wrangler Configuration and here for additional help.

Rights

Svelte Headless UI Starter - Launch your next Svelte app using Headless UI.
Copyright (C) 2022  VHS <vhsdev@tutanota.com> (https://vhs.codeberg.page)

Svelte Headless UI Starter is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

About

πŸš€ Launch your next Svelte app using Headless UI. Mirror of Svelte Headless UI Starter on Codeberg.

https://codeberg.org/vhs/svelte-headlessui-starter

License:GNU Affero General Public License v3.0


Languages

Language:Svelte 46.9%Language:TypeScript 43.3%Language:JavaScript 7.1%Language:Shell 1.4%Language:HTML 1.0%Language:CSS 0.4%