modern.js icon indicating copy to clipboard operation
modern.js copied to clipboard

[Feature]: Add guides about Modern.js App deployment

Open chenjiahan opened this issue 1 year ago • 12 comments

What problem does this feature solve?

Add guides on how to deploy Modern.js app on these platforms:

What does the proposed API look like?

Ref: https://nuxtjs.org/deployments

chenjiahan avatar May 08 '23 02:05 chenjiahan

Okey, I will finish these docs in Jun.

zllkjc avatar May 23 '23 02:05 zllkjc

And Azure static website please

AsuraKev avatar Sep 15 '23 04:09 AsuraKev

Any update on this?

omarshibli avatar Oct 16 '23 13:10 omarshibli

^

AsuraKev avatar Oct 26 '23 11:10 AsuraKev

No progress yet.

You can refer to "output files" to understand the dist directory structure of Modern.js and how to custom the output structure. This will help you to deploy the application to different platforms.

chenjiahan avatar Oct 26 '23 12:10 chenjiahan

ModernJS is amazing in terms of Developer productivity. the missing piece is how to deploy this after all the development. i normally deploy my apps in docker containers i would like to see more on this in the docs. currently there is no option for deploying in a Docker image or whatsoever. For this framework to be complete we need a way to deploy the application in different environments.

FYI: @chenjiahan your link for output fills is not going to the right page

mitch1009 avatar Dec 22 '23 11:12 mitch1009

i found a way to deploy to azure cloud. i will write the solution and share it. let me know if i can be of help on this issue.

mitch1009 avatar Dec 22 '23 12:12 mitch1009

any progress?

lastIndexOf avatar Jan 02 '24 13:01 lastIndexOf

@mitch1009 Were you able to deploy your build without needing the Node.js runtime?

AllenAttuned avatar Mar 05 '24 11:03 AllenAttuned

Watching this one too.

zackarychapple avatar Apr 11 '24 12:04 zackarychapple

@zackarychapple I'm not sure what your setup is, but I wrote some basic notes on hosting a static SPA on S3 here:

  • https://github.com/web-infra-dev/modern.js/discussions/5501#discussioncomment-9070123

AllenAttuned avatar Apr 12 '24 02:04 AllenAttuned

@zackarychapple I'm not sure what your setup is, but I wrote some basic notes on hosting a static SPA on S3 here:

awesome thanks for sharing.

zackarychapple avatar Apr 12 '24 12:04 zackarychapple

We have provided deployment solutions based on Vercel, Netlify, and general Node.js some time ago. For details, please check Deploy Application.

if you have other platforms that need support, you can continue to issue

zllkjc avatar Jul 09 '24 11:07 zllkjc

We have provided deployment solutions based on Vercel, Netlify, and general Node.js some time ago. For details, please check Deploy Application.

if you have other platforms that need support, you can continue to issue

The docs still don't outline how to deploy the app as static SPA. I think that would be helpful for many people, as Modern.js is great at building for such a use case.

AllenAttuned avatar Jul 11 '24 00:07 AllenAttuned

The docs still don't outline how to deploy the app as static SPA

Okey, let us add it..And could you give a deploy example for「static SPA」..How do you want to deploy it?

zllkjc avatar Jul 11 '24 05:07 zllkjc

The docs still don't outline how to deploy the app as static SPA. I think that would be helpful for many people, as Modern.js is great at building for such a use case.

I think what you may need is this , which is called "Pure Front-end Project" to distinguish it from "Full Stack Project", which may lead to misunderstanding.

yimingjfe avatar Jul 11 '24 06:07 yimingjfe

@zllkjc I wrote up these notes on how we were able to configure Modern.js to produce a "static SPA". Pretty much, we wanted to be able to copy the build output and then serve it using a web server such as Nginx, or in our case S3+Cloudfront. We didn't want to use a service like Netlify or have to run Node.js to serve it. Following this kind of setup has worked well so far for us, with both SPAs and microfrontends, and with/out Modern.js routing.

  • https://github.com/web-infra-dev/modern.js/discussions/5501#discussioncomment-9070123

AllenAttuned avatar Jul 11 '24 07:07 AllenAttuned

Hi there!

We are also migrating from nextjs to modernjs (the spa experience here is awesome!) and think it would be really helpful to document how to deploy it as a static-spa. Maybe examples/guides related to aws/cloudfront, cloudflare pages, etc.

If it is not already there, I can try to contribute to the docs but after deploying it to production in my current organization. We hope to have modernjs in prod in dec 2024.

GiancarlosIO avatar Aug 22 '24 07:08 GiancarlosIO

Thanks! Feel free to submit PRs to improve the deploy guide 😄

chenjiahan avatar Aug 22 '24 08:08 chenjiahan

Cool! Now there is no guide for static-spa, thanks for contribute~

And adding a piece of information that may help you. When you build the pure front-end product of Modern.js for Netlify, a _redirects file will be generated for route mapping, and other platforms deploying static-spa may need the same relationship.

zllkjc avatar Aug 22 '24 08:08 zllkjc

Thanks for the extra info!

After getting more experience of it deployed to amplify or s3 + cloudfront I'll comeback and try to contribute!

GiancarlosIO avatar Aug 22 '24 18:08 GiancarlosIO