WordPress CLI installation for ReactPress - reactjs

sorry for the potentially obvious setup question but I can't seem to find the answer or am searching for the wrong thing.
I'm new to WordPress and I'm attempting to use the plugin ReactPress to add some React to my website. However I'm getting stuck on setup. The ReactPress instructions in WordPress tell me to:
It seems you don't have any React apps created. Go to /path/to/my/workpress in your command line and enter:
But that path/to/my/workpress doesn't exist. I installed WP-CLI so commands like wp info succeed, but I don't have this folder. I must be missing an installation step - any tips?
Thanks!

Related

Github-Pages deployement issue

I have worked on an organization whose entire account was deleted by mistake but was later restored. Now I am trying to deploy a project in this org with gh-pages. Everything works or seems fine like to commits and all, unless I try to deploy the project. When I run the command npm run deploy the feedback I get is "published". But when I go to github and look for the website it says Error 404.
I have looked into the deployment log and found
this
I have tried every possible way to deploy a project using gh-pages and I have followed its procedure carefully. I found nothing useful which can solve this issue.
Thankyou in advance.

Unable to Add React to existing Rails app

I've setup a rails app all good, server runs fine etc, now I need to add React to it.
I see the command
rails webpack:install:react
appears to be the way everyone recommends but when I run this I get the following error:
rails aborted!
Don't know how to build task 'webpacker:install:react' (See the list of available
tasks with `rails --tasks`)
Did you mean? webpacker:install
So I run webpacker:install, alls good then try with :react again and the same errors generated, I've got react added in the package.json file and react-rails in the gem file. I've also run bundled since adding these.
I cant find an answer anywhere so whatever you've got I'll take.
Thank you.
Found the issue, the problem was that webpacker:install:react was removed from webpacker v6, moved to version 5.4.3 and the issues resolved.
More info here:
https://github.com/rails/webpacker/pull/2802/files#diff-8efe491b392a5a50e31b54660bbc0e7258e544e36d4e0b8a65e4cca93d39d18c
As the above answer states, this was removed. If you see a tutorial telling you to run rails webpack:install:react you can simply skip it if you've already run rails webpack:install. React now works "out of the box" and so you don't need to specify it.

How to create a react project war and deploy it on jboss?

I know there are many articles on google about this but in some cases they are keeping react(frontend) + springboot(backend) together in a single war, but my requirement is different I want to keep the both wars as separate.
So what I tried till now,
Directly adding the react build folder in jboss->standalone->deployment but it does not work, it works on tomcat but not on jboss
Then I created a new dynamic web maven project and renamed react build folder and added it to maven project webapps directory and created a war, but after deployment its giving 403 error, and I am not getting why.
Here is a snapshot of my folder structure, pom file and error on browser
Please help regarding this have been stuck at it for days now with jboss
Is there any other way to do it, I will be happy to change my approach.
tried this also, did not worked
https://www.megadix.it/blog/create-react-app-servlet/
spring boot comes with default tomcat, you can exclude from the dependency
https://spring.io/blog/2014/03/07/deploying-spring-boot-applications
https://dev.to/jakmar17/deploy-spring-boot-on-wildfly-application-server-2029
I have the same problem and I haven't found a good solution. The best I found is to create a dynamic web project in eclipse. Copy the build files into webContent and use HashRouter instead of BrowserRouter with basename equal to the project name. Finally compile and generate the war. I hope the advice helps you.

How to show my React app to the others from GitLab?

Hi everybody im actually working for a company and they are asking me to show them my React Website while im working on it. They have a website that is connected to our GitLab Project and if i type http.websitename/folderOnGitLab it actually comes out whats inside the folder but with react it shows the code , not the website , because the only way i know how to open react app is by "npm run start" from local, i dont really know how to "append my app in that website from GitLab" . I have already pushed all my React App but i dont really know how to make that visible to everyone as a website not only as a code. The website is a website they host so is always online and is connected to the project as i said. So i kinda have all the material but dont know how to make that work. For example i have pushed Test.txt and if i type website/Test.txt it shows the inside of it , so the website works.
It depends on how your app was set up, but probably you need to run npm run build, which will package up your app to be used on a production website.
This will be in the /build folder, the contents of which can be hosted online.
I'm not sure how you've managed to get that folder working on that website, it definitely isn't best practice to have all the code hosted online like that, but for a temporary solution you can just go to http.websitename/folderOnGitLab/build and it will probably work.
In the future you want to copy just the contents of the /build folder to be visible on http.websitename/folderOnGitLab.
Edit: The /build folder will be excluded from git, don't put that on GitLab, just the other source files, as you can re-generate it any time by running np run build
You can try using heroku. Once you push to heroku, it deploys your code and provides a url which you can share. It's free.
https://blog.heroku.com/deploying-react-with-zero-configuration
Are you using gitlab pipelines?
If yes, you can configure ngrok in one of your jobs.
If someone wants to see your work, this person just need to play the job that have the ngrok tool and it will receive a custom link with the application.
To stop the app, you just need to click in the cancel button

Configuration on Ionic Framework?

I have recently wanted to a create mobile apps so I decided to use a Mobile App framework that allows the use of web technology.
I decided to install Ionic and it went pretty well, until I hit the 'Configuration' section of its installation documentation.
https://docs.ionic.io/setup.html#configuration
It says that I have to do something related to 'src/app/app.module.ts' but I can't find that file anywhere, I have installed Angular and Zone using npm install but I still can't find this file.
Can anyone help me out finding out where this file is, or how I even get to it?
Currently, this is my project root folder structure:
I have a folder called node_modules, then I have 3 json files: .io-config.json, ionic.config.jon and package.json.

Resources