Can we have container app as React application and other microfront end apps in Nextjs using module federation? - webpack-5

Can we have container app as React application and other microfront end apps in Nextjs using module federation? since i need to reuse some of the nextjs applications

Related

How Can i use Nuxt and Django for production at the same time?

I have a background in Django and a some experience in Vue. I have used Vue for almost a year now, but since I need an SSR I have to use Nuxt.However, I am still very confused with how to deploy it in the server along with Django. Should I deploy them in the same server or should I deploy them in a different server with Django server for API and Nuxt for the front end?
I have also used Vue alongside Django for a while in my project and I'm looking into Nuxt right now.
I'm planning to migrate my standard Vue codebase into a Nuxt project.
The thing that I'm looking to do is to deploy Nuxt as a server target: 'server' (which is the default) alongside Django in Docker containers.
The idea is to be able to start the application with a simple docker-compose up.
I'm not done yet but you could look at it.
Typically, your docker-compose file would have 3 service :
The Django backend (API)
The Nuxt frontend (which make calls to the backend API)
Nginx which would route the traffic to Django or Nuxt according to your needs
EDIT BELOW :
Meanwhile, I changed my mind and instead of having Nuxt running as a server, I only have 2 containers :
The Django backend (API)
Nginx which serves my built Vue frontend and routes the traffic accordingly

Deploying DjangoREST+React project on a single google cloud app engine instance. Is it possible?

I have a Django backend that communicates with the React.js based frontend using REST APIs (made using DjangoREST Framework).
Up until now all the similar projects that I have deployed on gcloud use two different gcloud projects/app engine instances, one for django and the other for react.
This time I'm constrained to use a single app engine instance. Is it possible to deploy both the react and django components together?
I am aware we can serve react as static files using django, but then would there be a performance decrease? And I still need to be able to access django admin.
Yes,
It is possible to deploy both react and django components in same app engine service.
You will need to add the handlers in app.yaml
e.g.
handlers:
- url : /api/ #backend
script: ....
- url : /
static_files: frontend/index.html #frontend
upload: index.html....

how to combine or integrate reactjs and Django

I created front end in Reactjs and backend in Django and linked using Django rest API. but react runs in localhost:3000 and Django in localhost:8000. How to combine or integrate these two and runs in the same address.
Development
If you are in the development phase and using Create React App then you can add "proxy": "http://localhost:8000" to your package.json. Then your api requests done in React will be forwarded to port 8000.
Production
The production setup is quite different. You'll want to run yarn build and let either Django itself or nginx serve the index.html. In that case there won't be multiple ports anymore since the React build is just static files.
I am creating an example real world project as we speak with the same stack (GitHub). It doesn't have production setup quite ready yet, but you can see my development setup if you want some inspiration.
You need to link them using the routes you created in your backend. Put the routes in fetch requests in React frontend and call them via GET or POST methods etc. Your users will only hit the frontend host address once you deploy your application to the server.

Deploy Django API + React app on Heroku

I'm developing an web application with React in the front-end and Django API REST in the back-end (mostly because in the future we're gonna create a mobile app). My question is, what is the best way to deploy this web app on heroku? Using two distincts heroku's app (one for React and one for Django), or to use Docker to deploy both app's in one single heroku app? (I've read a little about Docker, but i'm not sure how I would deploy it on heroku)
Thanks and sorry for the English.
A good way is deploying to one app by bundling all your front-end with webpack for example. If you are doing server side rendering probably its better to go for two separate apps.
This tutorial talks about preparing your webpack configuration and this repo shows how to deploy webpack-django heroku app

Django Rest Framework and Angular App on same AWS Instance

I'm using Django Rest Framework for API service and Angular to use those APIs. How do I run Angular alongside Django Rest Framework on the EC2 instance using Amazon Elastic Beanstalk?
For example, Django Rest Framework serves up the API through http://test.com/api/v1/ and Angular makes HTTP requests to those API endpoints client-side.
What are the steps required to run Django Rest Framework API with an angular client side application on the same machine?
Any suggestions would be greatly appreciated!
It seems you are looking for a customized container that runs both a Python web app and an Angular app. The angular app accesses the django REST API on "localhost". I would recommend looking into creating a custom Docker container that lets you have this custom configuration.
You can read more on support of Docker containers on Elastic Beanstalk here.
While there may be simpler solutions out there I have been able to configure AngularJS + Django REST Framework to run on the same AWS instance. It's the accepted answer to this post https://stackoverflow.com/a/22852451/1759504
There I go into detail on exactly what I had to do to make it so my static AngularJS content runs from http://test.com/#/ while my APIs are at http://test.com/api/v1/