# Elm library to pair with my Go backend

**URL:** <https://discourse.elm-lang.org/t/elm-library-to-pair-with-my-go-backend/8785>\
**Category:** Learn\
**Created:** [November 25, 2022, 4:04pm UTC](https://discourse.elm-lang.org/t/elm-library-to-pair-with-my-go-backend/8785 "2022-11-25T16:04:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mystique09](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/mystique09/32/4703_2.png) [@mystique09](https://discourse.elm-lang.org/u/mystique09)\
**Post date:** [November 25, 2022, 4:04pm UTC](https://discourse.elm-lang.org/t/elm-library-to-pair-with-my-go-backend/8785/1 "2022-11-25T16:04:23Z")

</div>

Hi, this is my first time asking here. I have a backend made with Go, now I want to pair it with Elm but I don’t know what will be the best fit library to use. I saw elm-spa and elm-pages, but I’m confuse what to pick, btw my frontend also needs authentication, and routing guard. TIA.

---

<div class="post-metadata">

**Author:** ![mattpiz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/mattpiz/32/860_2.png) [@mattpiz](https://discourse.elm-lang.org/u/mattpiz)\
**Post date:** [November 25, 2022, 5:19pm UTC](https://discourse.elm-lang.org/t/elm-library-to-pair-with-my-go-backend/8785/2 "2022-11-25T17:19:25Z")

</div>

Hi @mystique09. Basically all elm application use what is called TEA ([The Elm Architecture](https://guide.elm-lang.org/architecture/)). Using elm in the frontend is very much the same whatever backend you use. You simply need to be able to serve an html and a JS file (where the JS is the result from elm compilation). Some more info about that [in the guide](https://guide.elm-lang.org/interop/).

Regarding how your app is organized, many like the way [Richard’s “Real World”](https://github.com/rtfeldman/elm-spa-example) example app is structured.  
Now there also exists a few helper frameworks such as [Elm Land](https://elm.land/) (successor to elm-spa).  
And a few static site generator libraries such as [elm-pages](https://elm-pages.com/).

If not already, I’d suggest registering to the [elm slack](https://elm-lang.org/community/slack), where you can more easily find out what really fits your needs.

---

<div class="post-metadata">

**Author:** ![cbrake](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/cbrake/32/438_2.png) [@cbrake](https://discourse.elm-lang.org/u/cbrake)\
**Post date:** [November 29, 2022, 7:58pm UTC](https://discourse.elm-lang.org/t/elm-library-to-pair-with-my-go-backend/8785/3 "2022-11-29T19:58:53Z")

</div>

I use elm-spa and like it a lot. Here is repo:

> **[GitHub - simpleiot/simpleiot: Simple IoT cloud/edge application/framework](https://github.com/simpleiot/simpleiot)**
>
> Simple IoT cloud/edge application/framework. Contribute to simpleiot/simpleiot development by creating an account on GitHub.

`api` and `frontend` directories may be of interest. We build and compress the [elm.js](https://github.com/simpleiot/simpleiot/blob/master/frontend/public/elm.js.gz) file (only 50KB) and then embed that using go-embed. We then serve the compressed file by using this HTTP wrapper that decompresses the file on the fly:

> <https://github.com/simpleiot/simpleiot/blob/master/server/server.go#L329>

> <https://github.com/simpleiot/simpleiot/blob/master/server/fs-decomp.go>

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [December 9, 2022, 7:59pm UTC](https://discourse.elm-lang.org/t/elm-library-to-pair-with-my-go-backend/8785/4 "2022-12-09T19:59:38Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
