[!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.
sveltekit-elysia comes batteries included:
git clone https://github.com/ArnavK-09/sveltekit-elysia.git
cd sveltekit-elysia
bun install
{
"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"
}
}
bun run dev
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 };
});
<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>
Preview |
---|
[!TIP] Contributions welcome! Follow standard GitHub workflow:
git checkout -b feat/awesome
git commit -m "feat: awesome feature"
![]() Arnav K |
sveltekit-elysia is released under the MIT
🌟 Found this useful? Give the repo a star to support its development! 🌟