sveltekit-directus-tailwind Svelte Themes

Sveltekit Directus Tailwind

SvelteKit + Directus + Tailwind

Starter Template for a SvelteKit project with Directus CMS and TailwindCSS

First Steps

If you haven't already created your direcus project follow this quickstart guide

ppnm install

Creating (or Updating) the Directus Schema

  1. Log in to Directus

    Open your Directus URL in the browser and sign in with an admin-level account.

  2. Create a Admin Access Token

    Go to your Admin User and click on "Generate Token" at the bottom of the page

  3. Add credentials to your environment

    Create/Update your .env with the variables in .env.example

    PRIVATE_DIRECTUS_TOKEN=YOUR_ADMIN_TOKEN_HERE
    PUBLIC_DIRECTUS_URL=YOUR_DIRECTUS_URL_HERE
    
  4. Pull the Schema

    Use the ds script to pull the Schema from you directus project into src/lib/directus/schema.ts

    pnpm ds
    

Developing

Once you've created a project and installed the dependencies, start a development server:

pnpm dev

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

# or start the server and open it to your network
pnpm dev --host

Building

To create a production version of your app:

pnpm build

You can preview the production build with pnpm preview.

To deploy your app, you may need to install an adapter for your target environment.

Top categories

Loading Svelte Themes