I’m trying to find out if Elm + PostgREST would be a good stack to reduce overall complexity and longevity of a system. I have played with postgrest before and really liked the experience. I am also quite a big fan of the postgresql database. I’m starting to learn Elm and saw that John Kelly has made a package available for Elm Postgrest interop.
I evaluated this stack for a project but I went with a more classical approach because I was a little hesistant to expose the database in such a direct manner. Of course, you can limit access with Postgres but there is still a risk.
But I really like the general idea and it could indeed make an application less complex.
I’ve been using alex-tan/postgrest-client package for a generic admin interface that reads the OpenApi schema definition to build dynamic filterable listings and forms for resources, and I am quite satisfied with the API. My use case is to build simple custom made CMS’, I’ve been relying on Rails’ Active Admin but I want a simpler stack.
Another option if you’re okay not using Postgrest is using a GraphQL layer. Hasura is a big player and pg_graphql is a newcomer. It has the same “generate a schema from your DB” way of working but then you can use elm-graphql, which AFAIK is maintained, to get the Elm compiler to know about your schema.
Of course, that would mean not using REST to communicate with your app, which could be a hard stop. You can always have REST endpoints with Hasura or still enable Postgrest.