Skip to content

don4ecap/irms

Repository files navigation

IRMS

Table of contents

Overview

iRMS application both backend and frontend.

Project structure

The project structure uses monorepo structure with the help of npm workspace to manage the development.

Minimum requirements

The following general requirements must be provided to run iRMS:

  1. NodeJS 16 and above
  2. NPM 7.24.2 and above

Setup

Mount the public drive

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/

Install dependencies

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

iRMS backend is using Fastify as web server and MariaDB Node.js connector as database client.

Build for production

# Build
npm run build --workspace irms-backend
# Run
node packages/backend/build

or

# Build and run
npm run start --workspace irms-backend

Compiles and hot-reloads for development

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

Testing

# Run test
npm run test --workspace irms-backend

Docker

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

iRMS frontend is using ViteJS as build tool, VueJS as framework and JqxWidgets as user interface library.

Build for production

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

Compiles and hot-reloads for development

# Run development server
npx --workspace irms-frontend vite