# Looking for as-simple-as-possible SPA including navigation, Msg between Pages and User Auth

**URL:** <https://discourse.elm-lang.org/t/looking-for-as-simple-as-possible-spa-including-navigation-msg-between-pages-and-user-auth/2848>\
**Category:** Learn\
**Created:** [December 30, 2018, 11:27am UTC](https://discourse.elm-lang.org/t/looking-for-as-simple-as-possible-spa-including-navigation-msg-between-pages-and-user-auth/2848 "2018-12-30T11:27:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmjr](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/jmjr/32/1298_2.png) [@jmjr](https://discourse.elm-lang.org/u/jmjr)\
**Post date:** [December 30, 2018, 11:27am UTC](https://discourse.elm-lang.org/t/looking-for-as-simple-as-possible-spa-including-navigation-msg-between-pages-and-user-auth/2848/1 "2018-12-30T11:27:08Z")

</div>

A little bit of context:

1. I started to learn programming 2 months ago and elm (0.19) is my first real programming language (R, Html)
2. I started to learn elm because I want to build an (open source) web app (and got the recommendation that elm is great. After listenting to some podcasts and reading about comparisons of programming languages I thought, yep, seems about right.)
3. I’ve worked through online tutorials, 1 elm book, went to a meetup used other online resources

Next things I want to learn (and understand) are:

1. SPA with Navigation and handling several Pages (incl Msgs, views, etc) in Main.elm
2. User Authentication

At the moment I am rather frustrated, because:

- I’m not proficient enough to understand complex SPAs like official one of Richard Feldman or the elm-lang website
- The official guide is too challenging for me. The chapter on Web Apps is quite short and it is too difficult for me to understand what’s going on in detail.
- The books I have (‘Elm in Action’ and ‘Programming Elm’) either don’t cover SPAs (yet) or the respective chapter is not updated to elm 0.19 (yet)

So this is why I am hoping that somebody here has a recommendation for a SPA that is **as simple as possible** but **as complex as necessary** to understand the above mentioned functionalities.

Thank you.

---

<div class="post-metadata">

**Author:** ![malaire](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@malaire](https://discourse.elm-lang.org/u/malaire)\
**Post date:** [December 30, 2018, 12:02pm UTC](https://discourse.elm-lang.org/t/looking-for-as-simple-as-possible-spa-including-navigation-msg-between-pages-and-user-auth/2848/2 "2018-12-30T12:02:57Z")

</div>

I have created a small SPA which isn’t nearly as complex as you want, but maybe it’ll still be useful as a starting point. It has Navigation and can show different pages, but is missing proper Pages, messages, authentication and using several files (everything is in Main.elm):

Source: [Main.elm](https://github.com/malaire/elm-examples/blob/master/spa-basic-domain/src/Main.elm), [index.html](https://github.com/malaire/elm-examples/blob/master/spa-basic-domain/index.html)  
Live version: [https://spa-basic-domain.markuslaire.com/](https://spa-basic-domain.markuslaire.com/)

---

<div class="post-metadata">

**Author:** ![Sebastian](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/sebastian/32/98_2.png) [@Sebastian](https://discourse.elm-lang.org/u/Sebastian)\
**Post date:** [December 31, 2018, 3:17am UTC](https://discourse.elm-lang.org/t/looking-for-as-simple-as-possible-spa-including-navigation-msg-between-pages-and-user-auth/2848/3 "2018-12-31T03:17:29Z")

</div>

I have a couple of open source examples that might help:

- [https://github.com/sporto/elm-tutorial-app](https://github.com/sporto/elm-tutorial-app) quite simple, has navigation and pages, but not authentication
- [https://github.com/sporto/save-up/tree/master/client](https://github.com/sporto/save-up/tree/master/client) has that + authentication

---

<div class="post-metadata">

**Author:** ![jmjr](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/jmjr/32/1298_2.png) [@jmjr](https://discourse.elm-lang.org/u/jmjr)\
**Post date:** [December 31, 2018, 8:44am UTC](https://discourse.elm-lang.org/t/looking-for-as-simple-as-possible-spa-including-navigation-msg-between-pages-and-user-auth/2848/4 "2018-12-31T08:44:11Z")

</div>

Thank you @malaire. I’ve looked into it. It is a great start and as simple as possible! Do you have a recommendation on what is a good start to get the Pages and Page.messages going? Of course I have googled and found stuff, it’s just difficult to evaluate what is a practical example for me and what not.

---

<div class="post-metadata">

**Author:** ![jmjr](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/jmjr/32/1298_2.png) [@jmjr](https://discourse.elm-lang.org/u/jmjr)\
**Post date:** [December 31, 2018, 8:50am UTC](https://discourse.elm-lang.org/t/looking-for-as-simple-as-possible-spa-including-navigation-msg-between-pages-and-user-auth/2848/5 "2018-12-31T08:50:36Z")

</div>

Thank you @Sebastian for the links. I’ll try and work them through! The Auth app seems quite complex, but I’ll try.

---

<div class="post-metadata">

**Author:** ![Jess\_Bromley](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/jess_bromley/32/3396_2.png) [@Jess\_Bromley](https://discourse.elm-lang.org/u/Jess_Bromley)\
**Post date:** [December 31, 2018, 10:43am UTC](https://discourse.elm-lang.org/t/looking-for-as-simple-as-possible-spa-including-navigation-msg-between-pages-and-user-auth/2848/6 "2018-12-31T10:43:32Z")

</div>

Regarding Authentication: if you’re prepared to just use Federated Login then you might want to check out [truqu/elm-oauth2](https://package.elm-lang.org/packages/truqu/elm-oauth2/latest/OAuth) or [orus-io/elm-open-id-connect](https://package.elm-lang.org/packages/orus-io/elm-openid-connect/latest/) as you may find them simpler to set up than a completely home-grown authentication solution…

---

<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:** [January 10, 2019, 10:43am UTC](https://discourse.elm-lang.org/t/looking-for-as-simple-as-possible-spa-including-navigation-msg-between-pages-and-user-auth/2848/7 "2019-01-10T10:43:43Z")

</div>

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