Template for web app with SvelteKit, Tailwind, Heroicons, Mongoose, and cookie-based JWT authentication.
# create a new project in the current directory
npx degit iffyloop/sveltekit-starter
# create a new project in my-app
npx degit iffyloop/sveltekit-starter my-app
Several environment variables need to be set in order to use this template. Copy the .env.example
file and replace the values accordingly.
MONGODB_URI
: Connection string for a MongoDB databaseJWT_SECRET
: A long, complex, secret encryption key which will be used to encrypt JSON Web Tokens used for authentication
Once you've created a project and installed dependencies with npm install -D
(or pnpm install
or yarn
), start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
To create a production version of your app:
npm run build
You can preview the production build with npm run preview
.
To deploy your app, you may need to install an adapter for your target environment.
This README was based on that of the SvelteKit default template repo.