DEV Community

Johannes Zillmann
Johannes Zillmann

Posted on

3

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!

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay