Need Help Publishing My React Project on DigitalOcean

0
0
Asked By TechExplorer27 On

Hey everyone! I recently bought the domain bearandevu.com from GoDaddy and set up my DigitalOcean namespaces without any issues. I've also created a droplet where I've uploaded both my backend (Node.js) and frontend (React) files. I've been running the backend using PM2, but I'm struggling to connect the frontend to my domain, and it's really frustrating! I tried to run the frontend with PM2 as well, but while adjusting UFW permissions, I accidentally disconnected my terminal access. Now I can't SSH into the server—not through the DigitalOcean root console nor through my terminal. I even attempted to fix the SSH structure via the recovery console, but the backend seems to be locked down, and I can't access it anymore (I did ensure UFW allowed access to port 3000). Plus, now it seems my frontend isn't working either. I'm really in a bind here, and any help would be greatly appreciated!

3 Answers

Answered By WebWarrior88 On

Have you considered using Vercel to handle your deployment? It can simplify the process, but I understand you want both your frontend and backend on the same server.

Answered By TechExplorer27 On
Answered By NodeNinja42 On

You can use the DigitalOcean console to re-enable SSH access. Once you're back in, build your React app with `npm run build`, then install Nginx to serve your files. Copy your build files to `/var/www/html`, configure your domain in the Nginx settings, and restart Nginx. Just keep your backend running on PM2 as it is.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.