https://github.com/quickz/svelte-dotnet-template
A simple project template for working with Svelte and ASP.NET. The template consists of 2 projects - a Svelte project (Client) that utilizes SvelteKit for the routing and an ASP.NET API (Server).
https://github.com/quickz/svelte-dotnet-template
aspnetcore csharp dotnet-core dotnet-template svelte svelte-dotnet-template svelte-template sveltejs sveltekit typescript
Last synced: over 1 year ago
JSON representation
A simple project template for working with Svelte and ASP.NET. The template consists of 2 projects - a Svelte project (Client) that utilizes SvelteKit for the routing and an ASP.NET API (Server).
- Host: GitHub
- URL: https://github.com/quickz/svelte-dotnet-template
- Owner: Quickz
- License: mit
- Created: 2023-03-15T00:00:28.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-16T21:36:33.000Z (over 1 year ago)
- Last Synced: 2025-03-17T04:37:04.350Z (over 1 year ago)
- Topics: aspnetcore, csharp, dotnet-core, dotnet-template, svelte, svelte-dotnet-template, svelte-template, sveltejs, sveltekit, typescript
- Language: TypeScript
- Homepage:
- Size: 381 KB
- Stars: 21
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Svelte .NET Template

A simple project template for working with Svelte and ASP.NET.
The template consists of 2 projects - a Svelte project (Client) that utilizes SvelteKit for the routing and an ASP.NET API (Server).
The project is using **Svelte 5** and **.NET 8**.
# Installing the template
Using [NuGet](https://www.nuget.org/packages/Svelte.Dotnet.Template):
```cmd
dotnet new install Svelte.Dotnet.Template
```
# Client
## Prerequisites
This project requires [NodeJS](http://nodejs.org/) (version 18 or later) and [NPM](https://npmjs.org/).
To make sure you have them available on your machine,
try running the following command:
```sh
$ npm -v && node -v
9.5.0
v18.14.1
```
## Installation
```bash
npm install
```
## Serving the app
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
## Building
To create a production version of your app:
```bash
npm run build
```
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
## Generating code from Swagger API
To regenerate TypeScript code around interacting with the Web API:
```bash
npm run generate-api-classes
```
# Recommendations
The template was created with the intention of using [VS Code](https://code.visualstudio.com/)
for the [Client](https://github.com/Quickz/svelte-dotnet-template/tree/main/svelte-dotnet-template/Client)
and [Visual Studio](https://visualstudio.microsoft.com/) for the [Server](https://github.com/Quickz/svelte-dotnet-template/tree/main/svelte-dotnet-template/Server). You are free to use whatever tools you prefer though.