This repository provides a template for building full-stack web applications using ASP.NET 9 Minimal API for the backend and SvelteKit 5 for the frontend.
During development, both the backend and frontend need to be running simultaneously.
Before starting the frontend, install the dependencies:
npm install
dotnet run
npm run dev
⚠️ Make sure to adjust the ports if necessary in
environment.ts
in the SvelteKit frontend.
If you need to generate a new API client, run:
npm run generate-api-client
⚠️ The backend must be running when generating the API client. You may also need to adjust the port of the C# backend if it differs from the default.
api/todos
.To build the frontend and serve it via the ASP.NET backend:
npm run build
This command will place the built SvelteKit SPA into the wwwroot
folder of the API, making it accessible through your API URL.
Hosting works the same way as a normal .NET 9 Minimal API, meaning you can deploy via IIS or run it inside a Docker container.