This is a minimal SvelteKit contact form project styled with Tailwind CSS and backed by Directus as a headless CMS/database.
Users can submit their name, email, and a message through the form on the home page. The submission is:
form APIcontact_form collectionsrc/app.html
Base HTML template used by SvelteKit. It defines the document structure and hosts %sveltekit.head% and %sveltekit.body% placeholders that SvelteKit fills at runtime.
src/routes/+page.svelte
Root page component. It simply imports and renders the Form.svelte component, making the contact form the main content of the app.
src/lib/Form.svelte
UI for the contact form. It:
<form> element to submitForm from forms.remote.tsname, email, and messagesrc/lib/forms.remote.ts
Server-side form logic. It:
name, email, message)form helper to create submitFormcontact_form collection in Directussrc/lib/server/directus.ts
Directus client configuration. It:
http://localhost:8055staticToken(...).with(rest())
Replace the placeholder token (YOUR DIRECTUS STATIC TOKEN) and URL as needed for your environment.src/routes/layout.css
Global CSS entry that imports Tailwind via the new @import 'tailwindcss' syntax and registers the @tailwindcss/forms and @tailwindcss/typography plugins. This powers the utility classes used in the form.
static/robots.txt
Simple robots configuration that currently allows all user agents to crawl the site.
.vscode/settings.json
Workspace editor settings (for example, formatting behavior or Svelte/TypeScript integration).
.vscode/extensions.json
Recommended VS Code extensions for working with this project (e.g., Svelte, Tailwind, etc.).
npm install
npm run dev
Then open http://localhost:5173 (or the URL printed in your terminal).
npm run build
You can preview the production build with:
npm run preview
For deployment, configure an appropriate SvelteKit adapter as described in the official docs.