This guide will walk you through setting up a simple Svelte frontend with TypeScript and a Go backend.
Project for a realtime quiz platform played on a large screen, similar to Kahoot. Backend in Go with Fiber HTTP server, frontend in vanilla Svelte.
Before starting, ensure you have the following installed:
Start the Go server by running the following command:
go run main.go
Install the TypeScript support for Svelte:
npm install --save-dev typescript svelte-preprocess @tsconfig/svelte
And then run the following command to start the Svelte development server:
npm run dev
To create a production-ready build of your Svelte frontend, run:
npm run build
To deploy the Go backend, you can build it using:
go build -o go-backend
You can use any static file server to serve your Svelte frontend, for example:
npm install -g serve
serve -s public
You now have a fully functional application with a Go backend and a Svelte frontend with TypeScript. This is a basic setup and can be expanded with more complex routes, database integration, authentication, and so on.