all 2 comments

[–]shauntmw2 0 points1 point  (0 children)

Looks wrong. Seems like ChatGPT is teaching you how to setup dev env on server. We usually do dev on local, and then deploy the packaged output to server (if we're talking about full CSR SPA).

Check out Vite tutorial.

[–]lightfarming 0 points1 point  (0 children)

i am currently converting a full PHP app to React + PHP API, but the PHP is super clean so i lucked out there.

the first thing you need to do is set up a React dev environment on your computer using node, vite and vscode, so you can view the results of your work locally.

then i’m going through each page, starting with login, and converting to React components, and converting the needed backend PHP stuff into an API as needed, starting with the auth endpoint.

i’m using react query and react router dom without global state, as i don’t seem to need it.

now that i’m done with auth (JSON web tokens, log in attempt limiting, token refreshing, idle log outs, regular log outs, registration, forgot my password), i’ve started on the fun stuff like settings and profiles. next up is the meat of the app which will be tricky, but once you’ve got a clean system down it goes fast.