QAT Application Installation Guide
Prerequisites
- Java Runtime Environment
- Node.js server with npm
- MySQL database server
- Git
- PM2 (Node.js process manager)
- Access to FASP-QAT repositories
Pre-Installation Preparation
1. Record Current Git Commit Hash
Before pulling the latest code, record the current commit hash for both the API and UI repositories. This will allow you to revert to the previous state if needed.
-
Navigate to the API repository:
cd /home/ubuntu/GitRepo/fasp-api
git rev-parse HEAD > /backup/fasp/api_last_commit_$(date +%Y%m%d_%H%M%S).txt -
Navigate to the UI repository:
cd /home/ubuntu/GitRepo/fasp-core-ui
git rev-parse HEAD > /backup/fasp/ui_last_commit_$(date +%Y%m%d_%H%M%S).txt
2. Backup Current Database
- Connect to your MySQL database server
- Back up your existing database:
mysqldump -u [username] -p fasp > backup_$(date +%Y%m%d_%H%M%S).sql
Installation Steps
1. Database Preparation
- Connect to your MySQL database server
- Execute all provided SQL scripts in sequential order:
mysql -u [username] -p fasp < [script_name].sql
2. UI Installation
-
Navigate to the UI deployment directory:
cd /home/ubuntu/GitRepo/fasp-core-ui
-
Stop the existing UI service:
pm2 stop QAT-React
-
Get the latest code:
git checkout master
git pull -
Install dependencies:
npm install
-
Start the UI service:
pm2 start QAT-React
-
Verify the service status:
pm2 status
-
Check logs if needed:
pm2 log
3. API Installation
-
Navigate to the API directory:
cd /home/ubuntu/GitRepo/fasp-api
-
Build and deploy the API:
run sh buildAndDeploy.sh
-
Check the API logs:
tail -f /home/ubuntu/QAT/logs/qat/faspLogger.log
4. Post-Installation Verification
- Verify API endpoints are accessible
- Verify UI is accessible through the browser
- Perform basic functionality testing:
- User login
- Basic navigation
- Core features
- Monitor logs for any errors:
- UI logs:
pm2 log
- API logs:
tail -f faspLogger.log
- UI logs:
Troubleshooting
- If services fail to start, check the log files for specific error messages
- Ensure database connectivity is established
- Confirm all required ports are open and accessible
- Verify file permissions are set correctly
- If build fails:
- Check Git branch is correct
- Verify all dependencies are installed
- Check disk space availability
- Review build logs for specific errors