I'm sorry this question must have been asked many ...
# compose-web
j
I'm sorry this question must have been asked many times, but I couldn't find answer: is there an easy to follow tutorial to learn how to deploy a Jetpack Compose frontend website on something like Heroku or AWS?
r
Compose website (or any other Kotlin/JS app) is just a bunch of static files (html, js, css, images etc). You don't need Heroku, AWS or any other dynamic hosting. Any static hosting (e.g. netlify, github pages) is enough.
j
@Robert Jaros Thanks! Even if I want to make a dynamic page?
r
It depends on your needs. You may want to use some kind of server side API in your web app. In this case you will have to implement and deploy the API somewhere (e.g. Heroku or AWS). But the API has nothing to do with Compose Web. It would be the same API for React, Angular, Svelte or any other JS-based app.
If you are coming from mobile world, it would be also the same API used by Android or iOS mobile apps.
j
OK, thanks! I only have limited experience.
Compose website (or any other Kotlin/JS app) is just a bunch of static files (html, js, css, images etc). You don't need Heroku, AWS or any other dynamic hosting. Any static hosting (e.g. netlify, github pages) is enough.
I guess I'm looking for a tutorial to do that then.
b
Just pull up any js deployment tutorial. Kotlin only lives at build-time. After that you're dealing with regular js app
c
As an example, here’s a site I’m currently working on. The entire front-end is Compose/Web, and the “backend” is statically-generated JSON files. Everything is hosted entirely on GitHub pages, which is free. As a quick “tutorial”, you could setup a GitHub Actions Workflow to run
./gradlew build
, and then use the Deploy To GitHub Pages Action to point to the
build/distributions/
folder, which contains everything you need for your Compose/Web app to run without needing a full backend. You can view the workflow file in the repo to see that there’s not much to it