A simple example of integrating TypeScript and Haskell.
Go to file
2021-08-25 08:06:16 -04:00
app First Commit 2021-08-24 17:38:04 -04:00
frontend Updated to use embedded files for the static server 2021-08-25 08:06:16 -04:00
src Updated to use embedded files for the static server 2021-08-25 08:06:16 -04:00
.gitignore First Commit 2021-08-24 17:38:04 -04:00
CHANGELOG.md First Commit 2021-08-24 17:38:04 -04:00
hs-ts.cabal Updated to use embedded files for the static server 2021-08-25 08:06:16 -04:00
install.sh Updated to use embedded files for the static server 2021-08-25 08:06:16 -04:00
README.md Added a README 2021-08-24 17:46:00 -04:00

Haskell + TypeScript

This is a simple example for me to base future projects on which use Haskell + TypeScript. It provides scaffolding for dealing with cors requests when using the yarn start command, and has a convenient installation script which can be expanded upon to move other artifacts of importance or create file structure which is important to your particular application. This does not contain a production grade server with middlewares you'd want to run in production. The choices you'll make in constructing that will probably be specific to the stack you've chosen: tracing, logging, metrics, etc.

The only opinionated choices I've made on the TypeScript side is including styled-components. I'm just going to want to use this every time, so it makes sense for me to add it into the template.

I'm generating the TypeScript types with aeson-typescript, but I am not generating a client. There are a couple options here: write my own machinery to generate requests using fetch or something, or use OpenAPI to generate the typescript instead of using aeson-typescript. Both routes should be explored, but the dependencies for the OpenAPI client generator were pretty immense last I checked.