Website deployment
Website Extraction
-
First you have to extract the
handyhue-service-app.zipthen you will get zip files.- handyhue-website.zip
-
Create
handyhue_webfolder with below commandmkdir -p /var/www/handyhue_web -
Upload
handyhue-website.zipto a location where you want to deploy Project using FileZilla/var/www/handyhue_web(This is the recommended location)
-
Extract
handyhue-website.zipto/var/www/handyhue_web -
Here you will get all the files of website.
Configure Environment Variables
-
Edit the
.envfile in the root directory of your project. This step is mandatory to ensure the application can connect to your server. -
Update the following lines in the
.envfile with your actual server and database credentials:NEXT_PUBLIC_API_URL=http://server_ip/api
NEXT_PUBLIC_SOCKET_URL=http://server_ip:3002/
Server Starting
- After editing the .env file, you have to create build of website.
- Every time you change the code you have to create build of website and restart the server.
npm run build
- After that you have start the server on port 3005.
PORT=3005 pm2 start npm --name "handyhue_web" -- run start
- If you want to stop the server then use below command.
pm2 stop handyhue_web
- If you want to restart the server then use below command.
pm2 restart handyhue_web
- you have to open your browser and go to
http://server_ip:3005to see the website.