sveltekit-elysia Svelte Themes

Sveltekit Elysia

🥪 SvelteKit + Elysia for fullstack apps with type-safe APIs...

🥪 sveltekit-elysia 🥪

Fullstack Monorepo Starter with Bun + SvelteKit + Elysia

hero

[!NOTE]

sveltekit-elysia is a modern fullstack monorepo starter featuring seamless integration between SvelteKit frontend and Elysia backend. Leveraging Bun's speed and Prettier for consistent formatting, it provides an optimized development experience with hot-reloading for both ends.

🌟 Features

sveltekit-elysia comes batteries included:

  • Bun-Powered Monorepo - Blazing fast development with Bun runtime
  • Type-Safe APIs - Elysia backend with automatic validation
  • SvelteKit Frontend - Modern reactive UI framework
  • Seamless Integration - Auto-generated API client for frontend
  • Pre-configured Tooling - Prettier formatting & concurrent execution
  • Production Ready - Built-in build scripts for deployment

💻 Installation

Clone and install dependencies
git clone https://github.com/ArnavK-09/sveltekit-elysia.git
cd sveltekit-elysia
bun install

🛠️ MonoRepo Commands

{
  "scripts": {
    "backend": "Navigate to backend and start the development server",
    "frontend": "Navigate to frontend and start the SvelteKit development server",
    "frontend:build": "Build the frontend for production",
    "dev": "Start the frontend development server",
    "fmt": "Format all code in the apps directory using Prettier"
  }
}
Start development servers
bun run dev  

🧠 Elysia Backend

Example Endpoint
import { Elysia } from "elysia";

export const app = new Elysia({ prefix: "/api" })
  .get("/", () => "Hello Elysia")
  .get("/hello/:name", ({ params: { name } }) => {
    const msg = `Hello ${name}!`;
    return { message: msg };
  });

🖥️ Frontend Integration

SvelteKit API Call Example
<script lang="ts">
  import api from "$lib/api";

  let input = $state("");
  let message = $state("");

  const fetchData = async () => {
    const { data } = await api.hello({ name: input }).get();
    if (data) {
      message = data.message;
    }
  };
</script>

<input bind:value={input} />
<button onclick={fetchData}>Submit</button>
<p>{message}</p>

📷 UI Preview

Preview


💻 Contributing

[!TIP] Contributions welcome! Follow standard GitHub workflow:

  1. Fork & Clone the repository
  2. Create a feature branch: git checkout -b feat/awesome
  3. Commit changes: git commit -m "feat: awesome feature"
  4. Push & Open PR

👤 Author

Arnav K
Arnav K

📄 License

sveltekit-elysia is released under the MIT


🌟 Found this useful? Give the repo a star to support its development! 🌟

Top categories

Loading Svelte Themes