TeamTavern: a full-stack PureScript site, and how client and server share their routes

TeamTavern (https://www.teamtavern.net) is a team-finding site for online games, and it’s PureScript on both sides: a Halogen app in the browser and a Node server, in one codebase, built with one spago build. I’ve just relaunched it after a redesign, and the code is open under AGPL-3.0:

Some of you may remember the first version from 2018: Teamtavern.net - a client-server web app written in PureScript

The part I think is most interesting to people here is how the client and server talk. Every endpoint is a single type, and the server’s handler and the client’s fetch are both derived from it through type classes, so most mismatches between the two sides become compile errors. I wrote it up here:

The routing library is Jarilo, in GitHub - bklaric/purescript-bklaric: All libraries and snippets that I've developed, but haven't published · GitHub. Let me know if you have any questions.

2 Likes

That’s cool :slight_smile:

+1 for the native “pRPC” example!