iRMS application both backend and frontend.
The project structure uses monorepo structure with the help of npm workspace to manage the development.
The following general requirements must be provided to run iRMS:
- NodeJS 16 and above
- NPM 7.24.2 and above
Before going to the installation step, make sure you have mounted the public drive to your local machine.
mkdir -p /mnt/public
mount -t cifs -o rw,user="guest",pass="",uid=91,gid=91 //10.153.64.10/Public /mnt/public/
Because it uses monorepo. we have to install all dependencies for backend and frontend from the root directory of the project.
npm install
iRMS backend is using Fastify as web server and MariaDB Node.js connector as database client.
# Build
npm run build --workspace irms-backend
# Run
node packages/backend/build
or
# Build and run
npm run start --workspace irms-backend
You need to run both of the commands below at the same time.
# To watch and compile typescript files on demand
npm run ts:watch --workspace irms-backend
and
# To run the compiled javascript
npm run js:watch --workspace irms-backend
# Run test
npm run test --workspace irms-backend
NOTE: Make sure you already mount the public drive to your local machine. See Mount the public folder
# Build docker image
./build_docker_backend.sh
# Create and run irms-backend container
docker run -d --restart unless-stopped -v /mnt/public/GLibs/FourElementsConfig/iRMS:/mnt/public/GLibs/FourElementsConfig/iRMS/ --name irms-backend -p 8000:8000 alphien/irms-backend node packages/backend/build
iRMS frontend is using ViteJS as build tool, VueJS as framework and JqxWidgets as user interface library.
Make sure the .env.production
file already configured correctly. Then build and deploy.
# Build
npm run build --workspace irms-frontend
# Serve the build to test
npx --workspace irms-frontend http-server dist
# Upload the build to .83 machine
rsync -ra ./packages/frontend/dist/* [email protected]:/var/www/itools/irms-fe
# Run development server
npx --workspace irms-frontend vite