A modern, type-safe SvelteKit application featuring a comprehensive dashboard with authentication, data visualization, and interactive components built with shadcn/ui components.
src/
āāā features/
ā āāā accounts/ # Authentication related components
ā ā āāā ui/
ā ā āāā login-form.svelte
ā āāā dashboard-template/ # Dashboard components
ā āāā chart-area-interactive.svelte
ā āāā data-table.svelte
ā āāā data-table-cell-viewer.svelte
ā āāā data-table-checkbox.svelte
ā āāā data-table-reviewer.svelte
ā āāā schemas.ts
ā āāā section-cards.svelte
āāā lib/
ā āāā components/
ā ā āāā app/ # Application layout components
ā ā ā āāā app-sidebar.svelte
ā ā ā āāā mode-switcher.svelte
ā ā ā āāā nav-main.svelte
ā ā ā āāā sidebar-opt-in-form.svelte
ā ā ā āāā site-header.svelte
ā ā āāā ui/ # shadcn/ui components
ā ā āāā avatar/
ā ā āāā badge/
ā ā āāā button/
ā ā āāā card/
ā ā āāā chart/
ā ā āāā checkbox/
ā ā āāā data-table/
ā ā āāā drawer/
ā ā āāā dropdown-menu/
ā ā āāā field/
ā ā āāā input/
ā ā āāā label/
ā ā āāā select/
ā ā āāā sidebar/
ā ā āāā table/
ā ā āāā tabs/
ā ā āāā ...
ā āāā hooks/
ā ā āāā is-mobile.svelte.ts
ā āāā styles/
ā ā āāā layout-arcade.css
ā ā āāā layout-default.css
ā ā āāā layout-mono.css
ā āāā auth-client.ts # Client-side authentication
ā āāā auth.ts # Server-side authentication configuration
ā āāā environment.ts # Environment constants
ā āāā prisma.ts # Prisma client configuration
ā āāā utils.ts # Utility functions
āāā routes/
ā āāā (global)/
ā ā āāā (private)/dashboard/ # Protected dashboard routes
ā ā ā āāā +page.svelte
ā ā ā āāā data.ts
ā ā āāā (public)/ # Public landing page
ā ā ā āāā +page.svelte
ā ā āāā +layout.server.ts
ā ā āāā +layout.svelte
ā āāā (simple)/
ā ā āāā auth/login/ # Authentication routes
ā ā ā āāā +page.server.ts
ā ā ā āāā +page.svelte
ā ā āāā +layout.svelte
ā āāā layout.css
āāā app.d.ts
āāā app.html
āāā hooks.server.ts # Server hooks for authentication middleware
git clone <repository-url>
cd my-app
bun install
# or
npm install
# or
yarn install
# or
pnpm install
.env file in the root directory:# Database
DATABASE_URL="postgresql://username:password@localhost:5432/database_name"
# Better Auth
BETTER_AUTH_URL="http://localhost:5173"
BETTER_AUTH_SECRET="your-secret-key-here"
# Google OAuth (optional)
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
npx prisma migrate dev
npx prisma generate
Start the development server:
bun run dev
# or
npm run dev
# or
yarn dev
# or
pnpm dev
The application will be available at http://localhost:5173.
dev - Start development serverbuild - Build for productionpreview - Preview production build locallycheck - Run type checkingcheck:watch - Run type checking in watch modelint - Check code formatting with Prettierformat - Format code with PrettierThe application uses Better Auth for authentication with the following features:
Routes under (private) group require authentication. Unauthenticated users will be redirected to /auth/login.
The Prisma schema includes the following models:
This project uses shadcn/ui components with custom styling:
The application uses @sveltejs/adapter-node which automatically adapts to Node.js servers
For production deployment:
bun run build
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see the LICENSE file for details.