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


#1

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.


#2

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, index.html
Live version: https://spa-basic-domain.markuslaire.com/


#3

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


#4

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.


#5

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


#6

Regarding Authentication: if you’re prepared to just use Federated Login then you might want to check out truqu/elm-oauth2 or orus-io/elm-open-id-connect as you may find them simpler to set up than a completely home-grown authentication solution…


#7

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