Exploring what it's like to develop a fullstack app in Gleam
- Automatic rebuild with Watchexec
- Caddy as a dev server with local HTTPS
- UI is written in Lustre (and my ham-fisted attempt at recreating the app structure of elm-spa but without routing) and is built with Vite
- Backend uses elli and docker-compose for managing the database (and other services in the future)
- Features a shared module with common types and json codecs/decoders
- Uses my WIP CORS library (and my fork of gleam/fetch to add support for session cookies)
Initial setup
- run
make db-reset
to initialize the project's database (seeyak_backend/reset.sql
) cd yak_ui
andnpm install
- clone
ffigiel/gleam_cors
andffigiel/fetch
adjacent to this project's directory - add
127.0.0.1 yak.localhost api.yak.localhost
to your hosts file
Development
Run make
to start a dev server and navigate to https://yak.localhost:3000/
Testing
You can run tests via make test
or make test-watch