A production-ready SvelteKit admin dashboard template for 3IT Services projects.
$state, $derived, $props)cp -r 3it.services.templates/admin my-project/frontend
cd my-project/frontend
npm install
Edit vite.config.ts:
server: {
port: 51XX, // Your frontend port
proxy: {
'/api': {
target: 'http://localhost:71XX', // Your backend port
changeOrigin: true
}
}
}
npm run dev
src/
├── routes/
│ ├── +layout.svelte # App shell with sidebar
│ ├── +page.svelte # Dashboard home
│ ├── users/ # User management
│ ├── items/ # Item management
│ └── settings/ # Settings page
├── lib/
│ ├── components/ # Reusable components
│ │ ├── DataTable.svelte
│ │ ├── Modal.svelte
│ │ └── PageHeader.svelte
│ ├── stores/ # Svelte stores
│ └── utils/ # Utility functions
├── app.css # Global styles + Tailwind
└── app.html # HTML template
src/routes/mypage/src/routes/mypage/+page.svelte+layout.sveltesrc/lib/components/src/lib/components/index.tsReplace mock data with API calls:
<script lang="ts">
import { onMount } from 'svelte';
let items = $state([]);
onMount(async () => {
const response = await fetch('/api/v1/items');
items = await response.json();
});
</script>
Edit CSS variables in src/app.css:
@theme {
--color-primary: #your-color;
--color-bg-dark: #your-background;
}
Generic table with pagination:
<DataTable
data={items}
columns={[
{ key: 'id', label: 'ID' },
{ key: 'name', label: 'Name' },
{ key: 'price', label: 'Price', render: (item) => `$${item.price}` }
]}
total={100}
page={1}
onPageChange={(p) => page = p}
>
{#snippet actions(item)}
<button onclick={() => edit(item)}>Edit</button>
{/snippet}
</DataTable>
Dialog component:
<Modal open={showModal} title="Edit Item" onClose={() => showModal = false}>
<form><!-- form content --></form>
{#snippet footer()}
<button onclick={save}>Save</button>
{/snippet}
</Modal>
Page title with actions:
<PageHeader title="Users" description="Manage users">
{#snippet actions()}
<button>Add User</button>
{/snippet}
</PageHeader>
MIT