Fullstack example project with Svelte/Vite, Fastify & tRPC all in typescript.
As a showcase Login functionality via cookie/server-sessions.
If you like video tutorials, https://www.youtube.com/watch?v=Lam0cYOEst8 walks you through a pretty similar setup (just with slightly different technologies like express, react, yarn workspaces, etc..).
Note: I'm not intending to update this a lot in the furture, but if you have meaningful contributions (like unifying the typescript setup or an env setup for real production) i happily accept pull requests!
A bit more thoughts on the setup at https://dev.to/o_a_e/fullstack-with-svelte-trpc-2cab.
It's a very simple monorepo setup with NPM workspaces. The frontend and backend folders are separated node modules, the root module just calls the relevant sub-modules tasks for convenience.
frontend
contains a typical Svelte
/Vite
setup which could be used and operated standalone.backend
has a minimal fastify
HTTP server and the actual backend logic is crafted in tRPC
.During development 2 servers are started. Each one is refreshed/restarted automatically on relevant file changes.
fastify
)./client/dist
.npm install
- Install node modules for all packagesnpm run dev
- Starts the development servers (Use http://127.0.0.1:5173 for using the app)npm run start
- Start production server (Use http://127.0.0.1:3000 for using the app)