DEV Community

Johannes Zillmann
Johannes Zillmann

Posted on


Fullstack with Svelte & tRPC

Usually I just do backend-less Svelte apps. This time around I tried to go full stack in javascript/typescript.

I started with Svelte-Kit but then decided for Svelte - with a typical Vite build on the frontend - and Fastify + tRPC on the backend.

The project

Find the project at It's just a skeleton project with minimal setup (mono repo, NPM workspaces) and a cookie based login.

I spare to list the individual setup steps since there is nothing sophisticated here. If you need those OR if you like video tutorial have a look at I found it excellent and it's basically the same setup just with different technologies.

Why not Svelte-Kit

Svelte is one of a few frameworks I dare to say I love. So going with Svelte-Kit was an obvious choice for me.
Why I left that path ?

Final Words

Since I didn't do much beyond the project setup, final judgment is not here yet, but I feel excited about it!

Also, there are things the skeleton could be improved upon... like:

  • testing setup
  • unified typescript setup
  • unified formatting/linting setup
  • real production settings
  • etc...

It's not my priority to do these things, but feel free to contribute if you feel like it!

Oldest comments (3)

kvetoslavnovak profile image

Thank you for sharing your experience. Is there any skeleton/starter repo where we can learn how to connect all this together? Thank you very much.

o_a_e profile image
Johannes Zillmann

The one I posted is at

kvetoslavnovak profile image

Thank you πŸ™


11 Tips That Make You a Better Typescript Programmer

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields


Read the whole post now!