I am looking for my first job, my specialty is JavaScript development, I wanted to take over PHP and laravel to acquire new skills.
I started a project that will help me in my everyday life.
I realize API Rest with laravel, it is almost finished.
The front part will be managed with ReactJS, the API is therefore the back part.
I am testing my API with postman.
One of my features of my project consists in recovering data from a website (title, text, etc.)
I added this functionality in my API, which I managed to do but only for static sites or the sites that I target are generated with JavaScript.
I have tried several solution with laravel:
Solution 1:
Use puphpeteer and SimpleHtmlDomParser.
Result: I have an exception error as the "node" command does not detect.
After several searches, I tried a lot of solution for 3 hours and I could not resolve this error.
Solution 2: Use PhantomJS with SimpleHtmlDomParser and CasperJS.
Result: I get an error related to CasperJS concerning the tempname () function, the creation of a temporary file failed.
I researched and failed to resolve the problem.
Solution 3: Use a NodeJS script and use cheerio.js / puppeter.
Result: I got the data I wanted, and that in 10 min.
After that I started to think about the choice of technologies used and I asked myself several questions.
Why used NodeJS and Laravel in the same project knowing that these are 2 server-side technologies.
Initially I planned to stay on Laravel because my API is almost finished.
In the end, I think I used NodeJS just for the functionality I need, but I'm afraid it will add to the project.
Finally, could this not make it more difficult to deploy the application to production because I will have to make NodeJS and Laravel coexist.
I ask myself a lot of questions, it can be easy to answer these questions but I would like to have your opinion.
Thank you in advance for your answers.
If you don't understand part of my post, don't hesitate to ask me questions.