Skip to content

Feat/system upgrade #516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: in-app-evaluation
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
891745a
feat: upgraded node to latest version
alex-struk May 8, 2025
ca5deb9
feat: upgraded node to latest version
alex-struk May 8, 2025
57c8268
feat: add copilotkit
kmandryk May 14, 2025
ba3ed93
feat: copilotkit backend and front end example
alex-struk May 14, 2025
e42998e
Merge branch 'feat/marketplace-ai' of https://github.com/bcgov/digita…
alex-struk May 14, 2025
d037791
Create index.html
kmandryk May 14, 2025
194bf08
Merge branch 'feat/marketplace-ai' of https://github.com/bcgov/digita…
kmandryk May 14, 2025
62a2ee3
feat: bootstrap upgrade wip
alex-struk May 15, 2025
ce09c86
feat: bootstrap migration complete
alex-struk May 16, 2025
ead83e9
feat: serve front-end from express, ui fixes
alex-struk May 22, 2025
46f17a6
feat: system migration cleanup
alex-struk May 26, 2025
3dcb420
feat: system migration - fixed markdown html render
alex-struk May 26, 2025
d359ee2
feat: system migration - undid type additions - no longer needed
alex-struk May 26, 2025
5bfe42c
feat: system upgrade - env var fixes
alex-struk May 27, 2025
a2803b7
feat: system upgrade - minor cleanup
alex-struk May 27, 2025
d4245ef
feat: system upgrade - feedback cleanup pass
alex-struk May 27, 2025
83a26ea
feat: system upgrade - aligned lodash to original behavior
alex-struk May 29, 2025
b26ab58
feat: system upgrade - minor sonarqube fixes
alex-struk May 30, 2025
77f860a
feat: system upgrade - simplified solution to navlink issue for react…
alex-struk May 30, 2025
8fd0fdc
feat: system upgrade - missed undefined checks
alex-struk May 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
POSTGRES_PORT: 5432
PGHOST: localhost
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_ENV: "development"
VITE_NODE_ENV: "development"
POSTGRES_URL: "postgresql://digmkt:digmkt@localhost:5432/digmkt"
MAILER_GMAIL_USER: "fake@gmail.com"
MAILER_GMAIL_PASS: "password"
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ COPY ./grunt-configs ./grunt-configs
# `yarn install` runs twice as a workaround for development and production
# dependencies in package.json needing better taxonomy

# NODE_ENV=production is passed here to allow for specific dev env variables when NODE_ENV=development
# VITE_NODE_ENV=production is passed here to allow for specific dev env variables when VITE_NODE_ENV=development
# @see /src/back-end/config.ts::developmentMailerConfigOptions
RUN yarn install --frozen-lockfile && \
NODE_ENV=production npm run front-end:build && \
VITE_NODE_ENV=production npm run front-end:build && \
npm run back-end:build && \
yarn install --frozen-lockfile --production && \
yarn cache clean && \
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ Environment variables that affect the back-end server's functionality are stored

| Name | Description |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `NODE_ENV` | The back-end run-time's environment. Possible values include either "development" or "production". |
| `VITE_NODE_ENV` | The back-end run-time's environment. Possible values include either "development" or "production". |
| `SERVER_HOST` | The IPv4 address for the back-end to bind to. |
| `SERVER_PORT` | The TCP port for the back-end to bind to. |
| `SCHEDULED_DOWNTIME` | A boolean flag (set to `0` for `false`, `1` for `true`) to turn off CRUD endpoints and vend a downtime HTML page to all users when set to a non-zero number. Defaults to `false` if `SCHEDULED_DOWNTIME` is undefined or invalid. |
Expand Down Expand Up @@ -280,8 +280,8 @@ Environment variables that affect the back-end server's functionality are stored
| `SWAGGER_ENABLE` | A flag to enable the Swagger UI API documentation under `SWAGGER_UI_PATH`. Defaults to `false`. |
| `SWAGGER_UI_PATH` | The base path to run the Swagger UI under for serving of API documentation. Defaults to `/docs/api`. |
| `TZ` | Time-zone to use for the back-end. Required by the Linux OS that runs the back-end, but not used as application configuration. |
| `SHOW_TEST_INDICATOR` | A boolean flag (set to `0` for `false`, `1` for `true`) to indicate that an environment is intended for testing purposes (prefixes emails subjects and shows a testing variant of the logo in email notifications). Defaults to `false`. |
| `LOG_LEVEL` | An enumerated logging level that can be used to control the level of output when running the application. Allowed values are `debug`, `info`, `warn`, `error`, and `none`. The level will default to `debug` when `NODE_ENV` is set to `development`. Otherwise, the level will default to `info` unless explicity set in the environment. |
| `VITE_SHOW_TEST_INDICATOR` | A boolean flag (set to `0` for `false`, `1` for `true`) to indicate that an environment is intended for testing purposes (prefixes emails subjects and shows a testing variant of the logo in email notifications). Defaults to `false`. |
| `LOG_LEVEL` | An enumerated logging level that can be used to control the level of output when running the application. Allowed values are `debug`, `info`, `warn`, `error`, and `none`. The level will default to `debug` when `VITE_NODE_ENV` is set to `development`. Otherwise, the level will default to `info` unless explicity set in the environment. |
| `DISABLE_NOTIFICATIONS` | A boolean flag that will disable all outgoing email notifications when set to `1` (`true`). Defaults to `0` (`false`). |
| `LOG_MEM_USAGE` | A boolean flag (set to `0` for `false`, `1` for `true`) to enable debug-level logging of Node memory usage. Defaults to `false`. |

Expand All @@ -295,10 +295,10 @@ Environment variables that affect the front-end's build process are stored and s

| Name | Description |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `NODE_ENV` | Determines whether the front-end is built for production (e.g. minification, compression, etc). Possible values include either "development" or "production". |
| `VITE_NODE_ENV` | Determines whether the front-end is built for production (e.g. minification, compression, etc). Possible values include either "development" or "production". |
| `CONTACT_EMAIL` | The Digital Marketplace team's contact email address. |
| `PATH_PREFIX` | The URL path prefix that the Digital Marketplace is deployed to. For example, if deployed to `digital.gov.bc.ca/marketplace`, the value of this variable should be `marketplace`. |
| `SHOW_TEST_INDICATOR` | A boolean flag (set to `0` for `false`, `1` for `true`) to indicate that an environment is intended for testing purposes (shows a testing variant of the logo in the web app UI). Defaults to `false`. |
| `VITE_PATH_PREFIX` | The URL path prefix that the Digital Marketplace is deployed to. For example, if deployed to `digital.gov.bc.ca/marketplace`, the value of this variable should be `marketplace`. |
| `VITE_SHOW_TEST_INDICATOR` | A boolean flag (set to `0` for `false`, `1` for `true`) to indicate that an environment is intended for testing purposes (shows a testing variant of the logo in the web app UI). Defaults to `false`. |

## Deployment

Expand Down Expand Up @@ -412,4 +412,4 @@ The Digital Marketplace is currently operated by the Procurement Services Branch

## Credits

This project would not have been possible by the incredible work done by open source project maintainers. The licenses for open source projects used are documented in `docs/open-source-licenses.txt`.
This project would not have been possible by the incredible work done by open source project maintainers. The licenses for open source projects used are documented in `docs/open-source-licenses.txt`.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- "3000:3000"
environment:
POSTGRES_URL: postgresql://digmkt:digmkt@db:5432/digmkt
NODE_ENV: ${NODE_ENV}
VITE_NODE_ENV: ${VITE_NODE_ENV}
depends_on:
- db

Expand Down
6 changes: 3 additions & 3 deletions docs/build-deploy/openshift.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ oc -n ccc866-dev process -f openshift/templates/app/app-digmkt-deploy.yaml \
-p TAG_NAME=dev \
-p KEYCLOAK_CLIENT_SECRET=<secret> \
-p KEYCLOAK_URL=https://dev.loginproxy.gov.bc.ca/auth \
-p SHOW_TEST_INDICATOR=1 \
-p VITE_SHOW_TEST_INDICATOR=1 \
-p BASIC_AUTH_USERNAME=<username> \
-p BASIC_AUTH_PASSWORD_HASH=<hashed_password> \
-p ORIGIN=https://app-digmkt-dev.apps.silver.devops.gov.bc.ca \
Expand All @@ -113,7 +113,7 @@ oc -n ccc866-test process -f openshift/templates/app/app-digmkt-deploy.yaml \
-p TAG_NAME=test \
-p KEYCLOAK_CLIENT_SECRET=<secret> \
-p KEYCLOAK_URL=https://test.loginproxy.gov.bc.ca/auth \
-p SHOW_TEST_INDICATOR=1 \
-p VITE_SHOW_TEST_INDICATOR=1 \
-p ORIGIN=https://app-digmkt-test.apps.silver.devops.gov.bc.ca \
-p HOST=app-digmkt-test.apps.silver.devops.gov.bc.ca \
-p BASIC_AUTH_USERNAME=<username> \
Expand All @@ -127,7 +127,7 @@ oc -n ccc866-prod process -f openshift/templates/app/app-digmkt-deploy.yaml \
-p TAG_NAME=prod \
-p KEYCLOAK_CLIENT_SECRET=<secret> \
-p KEYCLOAK_URL=https://loginproxy.gov.bc.ca/auth \
-p SHOW_TEST_INDICATOR=0 \
-p VITE_SHOW_TEST_INDICATOR=0 \
-p ORIGIN=https://marketplace.digital.gov.bc.ca \
-p HOST=marketplace.digital.gov.bc.ca \
-p DATABASE_SERVICE_NAME=patroni-pg12 | oc -n ccc866-prod apply -f -
Expand Down
4 changes: 2 additions & 2 deletions docs/local-development/debug-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Debugging the front-end might require evaluating MSG's in the state object.
- dev tools in the browser

1. Run the following
`NODE_ENV=development npm run front-end:watch`
`VITE_NODE_ENV=development npm run front-end:watch`

2. Open the Console of a browser's Dev Tools to view a list of state events.

Expand Down Expand Up @@ -85,7 +85,7 @@ Debugging the front-end might require evaluating MSG's in the state object.

Run the following for normal development:
```bash
NODE_ENV=development npm run back-end:watch
VITE_NODE_ENV=development npm run back-end:watch
```

This will display server logs:
Expand Down
4 changes: 2 additions & 2 deletions docs/onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The front-end is built using tasks defined with Grunt. This includes:

All commonly-used build scripts are aliased as NPM scripts in `package.json` for convenience.

To build the front-end, simply run `NODE_ENV=development npm run front-end:build`. To build the app for production, which includes asset minification, optimization and compression, change the value of `NODE_ENV` to `production`.
To build the front-end, simply run `VITE_NODE_ENV=development npm run front-end:build`. To build the app for production, which includes asset minification, optimization and compression, change the value of `VITE_NODE_ENV` to `production`.

To watch for source file changes and rebuild the front-end during local development, execute the `npm run front-end:watch` command in your terminal.

Expand Down Expand Up @@ -101,7 +101,7 @@ The `npm run migrations:*` scripts in `package.json` are how developers can crea

The back-end is compiled from TypeScript to JavaScript, which is implemented as a Grunt task.

To build the back-end, simply run `NODE_ENV=development npm run back-end:build`. To build the app for production, which involves cleaning the build directory before rebuilding, change the value of `NODE_ENV` to `production`.
To build the back-end, simply run `VITE_NODE_ENV=development npm run back-end:build`. To build the app for production, which involves cleaning the build directory before rebuilding, change the value of `VITE_NODE_ENV` to `production`.

To watch for source file changes and rebuild the back-end during local development, execute the `npm run back-end:watch` command in your terminal.

Expand Down
67 changes: 0 additions & 67 deletions grunt-configs/browserify.js

This file was deleted.

15 changes: 0 additions & 15 deletions grunt-configs/concurrent.js

This file was deleted.

46 changes: 0 additions & 46 deletions grunt-configs/ejs.js

This file was deleted.

20 changes: 0 additions & 20 deletions grunt-configs/htmlmin.js

This file was deleted.

23 changes: 0 additions & 23 deletions grunt-configs/postcss.js

This file was deleted.

24 changes: 0 additions & 24 deletions grunt-configs/sass.js

This file was deleted.

8 changes: 7 additions & 1 deletion grunt-configs/shell.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
module.exports = {
frontEndTypeScript: `npx tsc --project "${gruntConfig.frontEnd.src.ts}" --outDir "${gruntConfig.frontEnd.tmp.dir}"`,
// frontEndTypeScript: `npx tsc --project "${gruntConfig.frontEnd.src.ts}" --outDir "${gruntConfig.frontEnd.tmp.dir}"`, // Replaced by Vite
frontEndViteBuildDev:
"VITE_NODE_ENV=development vite build --mode development",
frontEndViteBuildProd:
"VITE_NODE_ENV=production vite build --mode production",
frontEndViteWatch:
"VITE_NODE_ENV=development vite build --watch --mode development",
backEndTypeScript: `npx tsc --project "${gruntConfig.backEnd.src.dir}" --outDir "${gruntConfig.backEnd.build.dir}"`,
scriptsTypeScript: `npx tsc --project "${gruntConfig.scripts.src.dir}" --outDir "${gruntConfig.scripts.build.dir}"`,
learnFrontEndTypeScript: `npx tsc --project "${gruntConfig.learnFrontEnd.src.ts}" --outDir "${gruntConfig.learnFrontEnd.tmp.dir}"`,
Expand Down
12 changes: 0 additions & 12 deletions grunt-configs/terser.js

This file was deleted.

Loading
Loading