Locally hosted AI code reviews.
bun install
bun run dev
# or start the server and open the app in a new browser tab
bun run dev -- --openTo create a production version of your app:
bun run buildYou can preview the production build with bun run preview.
To deploy your app, you may need to install an adapter for your target environment.
src/routes/ - File-based routing
+page.svelte- Page component (UI)+page.server.ts- Server-side code (load data, form actions)+page.ts- Universal load function (runs on both server & client)+layout.svelte- Shared layout wrapper for child routes+layout.server.ts- Server layout data+server.ts- API endpoints (GET, POST, etc.)+error.svelte- Error page for this route
Route examples:
src/routes/+page.svelte→/src/routes/about/+page.svelte→/aboutsrc/routes/blog/[slug]/+page.svelte→/blog/anything(dynamic)
src/lib/ - Reusable code
- Import via
$libalias:import { foo } from '$lib/utils' - Components, utilities, helpers go here
src/lib/server/ - Server-only code
- Never bundled for client
- Database connections, API keys, server utilities
static/ - Static assets (root level, not in src/)
- Served as-is:
static/favicon.png→/favicon.png
src/hooks.server.ts - Server hooks (intercept all requests)
src/app.html - HTML template (base shell)
Redirecting from POST routes:
import { redirect } from '@sveltejs/kit';
import type { Actions } from './$types';
export const actions = {
submit: async ({ request }) => {
const data = await request.formData();
// Process data...
// Redirect after successful submission
throw redirect(303, '/success');
}
} satisfies Actions;Use status code 303 (See Other) for POST-redirect-GET pattern.