CMS User guide 1.0 Help

Deployment SOP

The deployment of the application is described in this section.

Resource Server

  1. Login to the Resource Server using SSH.

  2. Stop the application service using the below commands.

sudo systemctl stop resource-server.service
  1. Run the following command to merge the latest changes from the remote repository to the local repository.

cd /path_to_scdl-web-resource-server git checkout master git pull git merge origin/master
  1. Rebuild the application using the below command.

npm run build
  1. Test run the application using the below command.

npm run start use CTRL+C to stop the application
  1. Start the application service using the below commands.

sudo systemctl start resource-server.service

CMS Application

  1. Login to the Resource Server using SSH.

  2. Stop the application service using the below commands.

sudo systemctl stop cms-server.service sudo systemctl status cms-server.service

Check the status log if everything is running fine.

  1. Run the following command to merge the latest changes from the remote repository to the local repository.

cd /path_to_scdl-cms git checkout main git pull git merge origin/main
  1. Rebuild the application using the below command.

npm run build
  1. Test run the application using the below command.

npm run start use CTRL+C to stop the application
  1. Start the application service using the below commands.

sudo systemctl start cms-server.service sudo systemctl status cms-server.service

Check the status log if everything is running fine.

Frontend Application (Website)

  1. Login to the Resource Server using SSH.

  2. Stop the application service using the below commands.

sudo systemctl stop scdl-web.service
  1. Run the following command to merge the latest changes from the remote repository to the local repository.

cd /path_to_scdl-frontend git checkout main git pull git merge origin/main
  1. Rebuild the application using the below command.

npm run build
  1. Test run the application using the below command.

npm run start use CTRL+C to stop the application
  1. Start the application service using the below commands.

sudo systemctl start scdl-web.service sudo systemctl status cms-server.service

Check the status log if everything is running fine.

Notes

  • We have preconfigured all the required environment variables for the application in its individual service files. You can find the file in /etc/systemd/system directory.

  • For Frontend application, we have preconfigured the environment variables in service files, and also there is a .env file in the root directory of the application is available for demo purpose and test runs.

  • We recommend testing the deployments in a staging environment before deploying to production.

  • Readme.md files are included in the respective repositories of each project for Building Development and Production environments.

  • Please ensure merging any development branches to the master branch before deploying to production.

  • Note a resource server must be running before building both the Frontend and CMS applications.

  • Note the resource server has the master branch for deployment, and CMS and Frontend have the main branch for deployment.

Updates

Updates to the frameworks and libraries used in the project can be done using below commands.

npm audit npm audit fix

These commands will update the dependencies and fix any vulnerabilities.

Rollback

Codebase is already available in the repository and can be rolled back to any previous commit you can use below commands to rollback.

View commit history git log --oneline
Revert to specific commit git reset --hard commit_id
Push changes to remote (force) git push -f origin branch_name
Alternatively, revert the last commit git revert HEAD Push the revert commit git push origin branch_name

Backup

We recommend taking regular backups of the database using the pg_dump utility.
Use the below command to back up the database.

pg_dump -U postgres -d xorsoyik_scdl_web > path_to_backup_directory/backup.sql

In any case you need to restore the database, use the below commands.

  1. Create new the database

    psql -U postgres CREATE DATABASE xorsoyik_scdl_web_backup;
  2. Restore the database using the backup file

    psql -U postgres -d xorsoyik_scdl_web_backup -f path_to_backup_directory/backup.sql
  3. Change the database name environment variable in the /etc/systemd/system/resource-server.service file

    DATABASE_NAME=xorsoyik_scdl_web_backup
  4. Restart the resource server

    sudo systemctl restart resource-server
  5. Check the service status

    sudo systemctl restart resource-server
  6. If everything is in place and working as expected, drop the old database.

    psql -U postgres DROP DATABASE xorsoyik_scdl_web_backup;

Files Backup

All the user-uploaded media files are stored in the /path-to-base-dir/app_uploads directory.

You can make a copy of the directory and store it as a backup in a different location.

Make sure to take incremental backups of the directory. As files may be uploaded to the directory at any time.

References

You can refer below links for more information about PostgreSQL and Systemd.

07 November 2025