Heroku deploy backend Nestjs + React js as frontend build not succeeding - reactjs

After hours of reading this tricky build for Heroku using nestjs as backend and reactjs as frontend separately with MySQL still react app does not succeed building into heroku, failing "react-scripts: not found" which I have copy from the devdependencies to dependencies.
I would like some suggestions/guidance on the clear steps from the react part setup to make the build successful with nestjs (separately).

Related

Deploying a Reactjs application (CRA) on heroku throws an error

Following is the error I am getting. The front-end of the application is built using CRA. And the backend is built with Laravel - Laravel Sanctum and Laravel Fortify. I am using craco for building the app.
Error: React Refresh runtime should not be included in the production bundle.
I found the issue. Heroku was building the react app using nodejs buildpack. In order to deploy a react project scaffolded using create-react-app a buildpack other than "heroku/nodejs" needs to be used. In my case I used this buildpack -> https://github.com/mars/create-react-app-buildpack.git. And finally using this I got the app to working.
Thank you #mando for you help.

Deploy a React app to Netlify + AWS Amplify

So I have this normal React app that is deployed in Netlify.
Then I tried using AWS Amplify for my authentication. All went well in my local.
The problem is, I think I would not be able to deploy it properly to Netlify anymore because of the aws-exports.js that is dynamically generated. Or can I? Is it still possible to deploy a React + Amplify app to Netlify? Or I have no choice but to deploy it to AWS?
UPDATE: I was able to deploy it successfully on Netlify by commenting out the aws-exports.js in the .gitignore. The problem now is how could I have different version of the file for different environments (e.g. Dev, Stage, Prod).

Stopping Heroku from building a react app, and deploying with local production build

I want to deploy a React + Django application on Heroku. When I push to Heroku, it automatically rebuilds my application without referring to my webpack. Is there any way I can push my build directory directly to Heroku?
Thanks!

How to build react app for production without making the website offline?

Is it possible to build react app for production using npm run build without it making the site offline? I am using nginx to serve the react app and when I run the above command, I get Internal server error until the build is finished. It would be nice if the old version of the app is served until the build is finished.
You shouldn't be building your application on the production server. Build it locally, then deploy it to production and this won't be an issue.

Deploying Groovy and React Application to Heroku

I currently have a Ratpack Groovy application hosted on heroku, I've managed to get it working correctly and deploying to the URL Heroku created for me. I decided to make a ReactJS application, which grabs the data from my database from an API I've built in Ratpack, my React application acts as a basic CMS where I can post data back to Ratpack and update the database.
My front end templates get rendered from within my Ratpack handlers, this all works fine locally. I followed
https://github.com/gschrader/ratpack-react-boilerplate
Here is my basic project structure
So I can run ./gradlew run which builds the react app and starts up my Ratpack app in the root of my project and then yarn start in my React directory which starts up my react application on localhost:3000.
My question is how do I deploy this on Heroku, at the moment it's in one big directory, so could I deploy it as one project? I'd like the cms to be on a sub domain such as admin.application.com. I am pretty confused as to how this would work, if anyone has any documentation that would be very helpful.

Resources