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 https://github.com/jzillmann/svelte-trpc-skeleton. 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 https://www.youtube.com/watch?v=Lam0cYOEst8. 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!

Top comments (4)

Collapse
 
kvetoslavnovak profile image
kvetoslavnovak

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.

Collapse
 
o_a_e profile image
Johannes Zillmann

The one I posted is at github.com/jzillmann/svelte-trpc-s...

Collapse
 
kvetoslavnovak profile image
kvetoslavnovak

Thank you 🙏

Collapse
 
bd_perez profile image
Bruno PĂ©rez

tRPC looks amazing, I have to check this out