
| Service in Monorepo |
SonarCloud |
| frontend |
 |
| admin-frontend |
 |
| backend |
 |
| doc-gen-service |
 |
| backend-external |
 |
Pay Transparency Reporting Tool is a webapp that employers use to generate a pdf report. The Gender equity - Pay transparency website has more information and a link to the tool.
Key Technologies Used
- OpenShift and helm charts
- PostgreSQL and Prisma
- node.js
- Vue and Vuetify
- Vite
- jest, vitest, and playwright
- ESLint and Prettier
- SonarCloud
GitHub Actions
Automatic actions
- Pull requests automatically create a temporary instance on OpenShift and are automatically removed when merged to main
- Unit tests, integration tests, and end-to-end test are automatically performed.
- SonarCloud scans
Manual actions
- Deploy to Test environment
- Deploy to Prod environment
Local Environment Setup
Prerequisites
- BC Gov VPN
- Keycloak and BCeID authorization
- Podman (or equivalent for running docker containers)
- Node.js or DevContainers
- Ports need to be available for the application to work locally
- 8081 frontend
- 8084 admin-frontend
- 3000 backend
- 3001 doc-gen-service
- 3002 backend-external
- 3011 clamav-service ( node.js api)
- 3310 clamav (clamav daemon)
- 5432 postgres
Repo setup
- Clone repo
- Create and populate environment variable files
/backend/.env
/frontend/env.js
/admin-frontend/env.js
- (Optional) Reopen in DevContainers
- (Optional) A VSCode workspace is provided in .vscode/fin-pay-transparency.code-workspace
- (Optional) Tasks.json and launch.json are fully configured for intalling all packages and launching the app.
- Install npm packages for each project in repo
npm -C backend ci
npm -C backend-external ci
npm -C doc-gen-service ci
npm -C frontend ci
npm -C admin-frontend ci
- Build and start the database container
podman-compose up --build -d database
- Run the database migrations to create/update the database for this project
podman-compose up -d database-migrations
- Run the clamav container
podman-compose up -d clamav
Start servers
- The backend requires the doc-gen-service and the database docker container to be running.
- The backend-external requires the backend service to be running.
- The frontend requires the backend to be running in order to login.
npm -C backend run dev
npm -C backend-external run dev
npm -C doc-gen-service run dev
npm -C clamav-service run dev
npm -C frontend run serve
npm -C admin-frontend run serve
Tests
Unit
All projects have unit tests and can be run with
npm run test
Integration
The backend and backend-external have integration tests. Requires that the services be running to run tests.
npm run test:integration
End-to-end
The frontend and admin-frontend end-to-end tests are performed by Playwright.
-
Install playwright tools:
npx playwright install --with-deps
-
Create and populate the environment variable files
/frontend/.env.playwright
/admin-frontend/.env.playwright
-
Run the tests:
npm run e2e
Hotfix Process
flowchart
A[Last Released To Production Tag ex: 1.17.2] -->|create a hotfix branch from the tag ex: hotfix/1.17.2_hotfix.1| B(Make Changes)
A[Last Released To Production Tag ex: 1.17.2] -->|create releases/hotfix branch from the tag | C( Branch to Which pull request will be raised)
B --> C[Create pull request to releases/hotfix branch, from the hotfix/x.x.x_hotfix.x branch]
C --> D[Changes Deployed to Dev environment with Postgres DB, follow .github/workflows/ci_cd_on_pr_hotfix.yml]
D -->|On Approval and Merge to releases/hotfix| E[Clean up PR environment and create the new Docker Tags and GitHub Tag]
E -->|Promote to PROD, using the tag that was generated in previous step | F[Promote to Prod using branch releases/hotfix using existing github workflow, check the is hostfix deployment to true, cd-to-prod-on-workflow-dispatch.yml]
F -->|Create a PR to main branch from releases/hotfix| G[Resolve Merge Conflicts here and promote through, DEV and TEST]
G --> H[Close the releases/hotfix branch]
评论