fun-stack / sdk-scala

Client library for fun-stack in scala
MIT License
5 stars 2 forks source link

Integrate with typelevel/feral? #94

Open armanbilge opened 2 years ago

armanbilge commented 2 years ago

Hi there, saw your post on the unified Scala.js thread :) I've actually been working on a similar project, which may be of interest to you:

https://github.com/typelevel/feral

It takes a bit of a different approach: the entire stack is pure Scala, and thus avoids the need for Scala.js Bundler, Scalably Typed, and npm dependencies.

Seems like it could be cool to have an integration between our projects.

cornerman commented 2 years ago

Awesome, thanks for connecting!

To me it sounds like in the future, the lambdas we are writing could be based on feral. Abstracting away parts of how to setup lambdas and to interact with AWS. Furthermore, being able to switch between JVM and JS. That could be interesting.

I also see that there is a cloudformation resource to deploy them as well. We are using terraform here, but that should not matter for the scala parts. By the way, do you plan to provide helpers for other iac tools as well? Like terraform, pulumi, cdk.

Here, we are trying to build an opinionated serverless stack in AWS to easily setup a new website project or application: Creating a website with s3 and cloudfront, setting up an http and websocket api with API Gateway, setting up authentication with Cognito. This scala library tries to be the glue when communicating with this infrastructure inside the frontend or backend code.

Currently, we are bound to scala-js here because of the concrete usage of the AWS SDK. Do you plan to go further on building a cross-build/pure scala interface for that? That would be really nice. Of course, javascript works already great for lambdas, especially with cold-starts. But the JVM can be nice when being bound to certain libraries.

Do you see more integrations? :)

armanbilge commented 2 years ago

Thanks for the response! It sounds like our goals are somewhat orthogonal which is fantastic :)

So far I've focused mostly on cross-building the Typelevel ecosystem so that we can get a pure Scala stack. By offering fs2-io, http4s-ember, skunk, etc. without relying on npm dependencies makes it very easy and inviting for JVM users to start building serverless apps in Scala.js since the experience is so uniform. In particular, supporting http4s in both the browser and Node.js also makes it easy to share code between frontends and JS/JVM backends.

But, I have not put the same work you have into getting a solid UX with regard to deployment/infrastructure or creating a framework for bootstrapping a fullstack app. That is awesome and super important, and I would love to find a meeting of the minds here :)

Do you plan to go further on building a cross-build/pure scala interface for that?

Are you aware of this project? It auto-generates pure-Scala APIs for AWS sdks that cross-compile to JVM/JS. Still early days but I'm hopeful it can solve the SDK problem :)

https://disneystreaming.github.io/smithy4s/docs/protocols/aws/aws

But the JVM can be nice when being bound to certain libraries.

I'm less fussed about JVM users but I am slowly thinking ahead to Native :) imagine those cold-starts!

PS since you mentioned CockroachDB I'm hopeful we can get skunk working with that, see: