{"repo":"joelseq/go-svelte-spa","free":true,"listed":false,"github":"https://github.com/joelseq/go-svelte-spa","clone":"git clone https://github.com/joelseq/go-svelte-spa.git","description":"Golang backend with a Svelte SPA frontend","language":"TypeScript","stars":42,"topics":["go","golang","single-page-app","svelte","sveltejs","sveltekit"],"license":null,"category":"saas-starters-boilerplates","readme_excerpt":"Go Svelte SPA This repo contains example code of how to integrate a Svelte single-page application (SPA), built with SvelteKit, with a Golang backend. In development mode, the Golang backend will proxy requests for the frontend assets to the Vite server (running at http://localhost:5173). In production mode, the Golang backend will serve the assets bundled from the ui/dist directory. The mode is determined by the GO ENV environment variable. If it contains \"prod\" then it will run in production mode, otherwise it will run in development mode. Motivation This setup lets you create a single, easy-to-deploy binary that contains both your API and frontend code without sacrificing on the developer experience. It is inspired by PocketBase. Requirements - Go 1.23+ - pnpm (optional, you can replace pnpm with npm or yarn in the Makefile) Try it out Development mode: Production mode: The application will be accessible at http://localhost:8080 Development The following commands use the examples/stdlib/main.go file for the backend. Run build make command with tests Build the entire application Build the UI which will output the assets to ui/dist Build the server which will output a main executable binary Run the application Live reload the application: Run the test suite: Clean up binary from the last build: Manually setting up the SvelteKit UI Follow instructions from the official docs for initializing a new app. At the time of writing this: Setup the static adapter: - Install: npm insta","default_branch":null,"files":null,"tree":[],"storefront":"/r/joelseq","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/joelseq/go-svelte-spa/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}