scala-pet-store icon indicating copy to clipboard operation
scala-pet-store copied to clipboard

Create Front End Application

Open pauljamescleary opened this issue 6 years ago • 11 comments

The front end application should communicate securely (i.e. secure cookies / jwt / etc) to the backend api.

This will require some kind of authorization middleware to be setup.

The front end application should be a ScalaJS app and mimic the existing pet store app.

pauljamescleary avatar Sep 06 '17 13:09 pauljamescleary

@pauljamescleary Out of interest - as this is intended to be an example of a production scala application, why not go for a scala.js front end e.g. using scala-js-react and diode? I'd be happy to contribute to such an effort.

hugofirth avatar Sep 08 '17 17:09 hugofirth

@hugofirth Definitely would welcome a scala-js-react / diode front end.

I was thinking about taking the existing code and moving it to a sub-module, like "typelevel-tagless-final" and then have the front end to be a separate sub-module. This way, we could use the same front end with different backends.

I was thinking about creating a Free backend, may want to do eff, who knows what else.

Also, sorry for not responding earlier :(

pauljamescleary avatar Sep 20 '17 18:09 pauljamescleary

Just dropping this in: https://github.com/OutWatch/outwatch

I think it is another interesting technology to look into.

👍 regarding the module split

daddykotex avatar Sep 21 '17 00:09 daddykotex

To make it a little bit more complex to decide which framework to use I'll also drop https://github.com/outr/youi here :-)

Thank you for this project, @pauljamescleary !

martin-g avatar Sep 21 '17 06:09 martin-g

I think there are opportunities for several front ends. I haven't quite figured out if we should have a multi-module monolithic repo or perhaps an org with several repos of different flavors. This is small, so for the time being a multi-module project seems like a logical next step.

From a reference guide in scala standpoint, I think ScalaJS makes the most sense. The other viable alternative is a straight up javascript front end built in something like Vue.js.

pauljamescleary avatar Sep 21 '17 13:09 pauljamescleary

Well I'm afraid I don't know the other frameworks mentioned, so I'll just start slowly chipping away at a scala-js-react app in a fork (probably next week) and let you know here when there is something worth looking at.

You're right that there are several possible options for front and back end frameworks/patterns/languages. If you were soliciting votes on the approaches (which you are aren't 😄 ) then mine would go to the "1 full stack application per repo" option.

You could encode all of the variations as sub-projects in this repo but for me the core value of something like this is as a packaged example of how I might write a production app using functional libraries. Including sub-projects would add noise to the project folder structure and build.sbt which could be unhelpful to somebody with that goal.

At the end of the day, someone can always build a fork using Free, Finch and Vue (for example). If they did you could even create a Scala Pet Store github org and encourage those contributors to "donate" the fork to the org for improved discoverability. You could imagine ending up with a matrix on each Readme which links to the fork for each combination.

hugofirth avatar Sep 25 '17 14:09 hugofirth

Sounds good

pauljamescleary avatar Sep 25 '17 21:09 pauljamescleary

Another good lib in the same style as scala-js-react is binding.scala : https://github.com/ThoughtWorksInc/Binding.scala

I think the syntax is a bit easier to read than scala-js-react and it's a pure scala.js framework.

loicdescotte avatar Dec 18 '17 08:12 loicdescotte

Thanks for the tip @loicdescotte . I will be sure to check it out :)

pauljamescleary avatar Dec 18 '17 11:12 pauljamescleary

Might make sense to get the authentication in before this. Would be sweet to have an SPA with JWT for authentication against the user store all fully functional :)

pauljamescleary avatar Jan 04 '18 02:01 pauljamescleary

We have some authentication bits in, at least the login bits. TSec is still developing, and I haven't been back to make the JWT pieces work yet.

pauljamescleary avatar Jul 10 '18 00:07 pauljamescleary