Starter Template for a SvelteKit project with Directus CMS and TailwindCSS
If you haven't already created your direcus project follow this quickstart guide
ppnm install
Log in to Directus
Open your Directus URL in the browser and sign in with an admin-level account.
Create a Admin Access Token
Go to your Admin User and click on "Generate Token" at the bottom of the page
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
Pull the Schema
Use the ds
script to pull the Schema from you directus project into src/lib/directus/schema.ts
pnpm ds
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
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.