I have created a demo project dnet which uses LFE/OTP with Cowboy for the web server and mnesia as the database. There is also a gen_server which does HTTP requests using Cowboy Gun library and handles the response as a stream asynchronously. This allows finer control over the HTTP response and allows to pause, cancel the stream, as well as continue from partially left of streams. The project demonstrates the use of LFE with OTP for writing web services with rebar3 for build and dependency management. Also, there are scripts for loading project env into LFE REPL, giving a full modern development workflow experience.

The supervision tree for the app is given below.

               ┌──────┐
          ┌───▶│db-sup│
          │    └──────┘
          │
┌────┐    │    ┌────────────┐
│dnet│────┼───▶│dnet-svc-sup│
└────┘    │    └────────────┘
          │
          │    ┌────────┐
          └───▶│http-sup│
               └────────┘

The server listens on port 8080 and has two handlers, one for GET and another for POST. The GET handler returns JSON and the POST handler returns HTML generated using Exemplar.