The Connected Services, Team Access & Roles (CSTAR) manages tenants who use multitenanted common components.
Initial setup is intended to take an hour or less. This depends greatly on intended complexity, features selected/excluded and outside cooperation.
The following are required:
- BC Government IDIR accounts for anyone submitting requests
- GitHub accounts for all participating team members
- Membership in the BCGov GitHub organization
- Join the bcgov organization using these instructions.
- OpenShift project namespaces:
Dependabot and Mend Renovate can both provide dependency updates using pull requests. Dependabot is simpler to configure, while Renovate is much more configurable and lighter on resources.
A config file (renovate.json) is included with this template. It can source config from our renovate repository. Renovate can be self-hosted or run using the GitHub App managed at the organization level. For BC Government the OCIO controls this application, so please opt in with them using a GitHub issue.
To opt-in:
- Visit the Renovate GitHub App
- Click
Configureand set up your repository - Visit BCDevOps Requests
- Select Issues
- Select New Issue
- Select Request for integrating a GitHub App
- Create a meaningful title, e.g.
Request to add X repo to Renovate App - Fill out the description providing a repository name
- Select "Submit new issue"
- Wait for Renovate to start sending pull requests to your repository
Dependabot is no longer recommended as an alternative to Renovate for generating security, vulnerability and dependency pull requests. It can still be used to generate warnings under the GitHub Security tab, which is only viewable by repository administrators.
Squash merging is recommended for simplified history and ease of rollback. Cleaning up merged branches is recommended for your DevOps Specialist's fragile sanity.
Click Settings > General (selected automatically)
Pull Requests:
[uncheck] Allow merge commits[check] Allow squash mergingDefault to pull request title
[uncheck] Allow rebase merging[check] Always suggest updating pull request branches[uncheck] Allow auto-merge[check] Automatically delete head branches
Packages are available from your repository (link on right). All should have visibility set to public for the workflows to run successfully.
E.g. https://github.com/bcgov/quickstart-openshift/packages
This is required to prevent direct pushes and merges to the default branch. These steps must be run after one full pull request pipeline has been run to populate the required status checks.
- Select
Settings(gear, top right) >Rules>Rulesets(under Code and Automation) - Click
New ruleset>New branch ruleset - Setup Ruleset:
- Ruleset Name:
main - Enforcement status:
Active - Bypass list:
- Click
+ Add bypass - Check
[x] Repository admin - Click
Add selected
- Click
- Target branches:
- Click
Add target - Select
Add default branch
- Click
- Branch protections:
[x] Restrict deletions[x] Require linear history[x] Require a pull request before merging- Additional settings:
Require approvals: 1(or more!)[x] Require conversation resolution before merging
- Additional settings:
[x] Require status checks to pass[x] Require branches to be up to date before merging- Required checks: These will be populated after a full pull request pipeline run!
- Click
+Add checks - This is our default set, yours may differ:
Analysis ResultsPR ResultsValidate Results
- Click
[x] Block force pushes[x] Require code scanning results- Click
+ Add tool - This is our default set, yours may differ:
CodeQLTrivy
- Click
- Click
Create
- Ruleset Name:
Note: Required status checks will only be available to select after the relevant workflows have run at least once on a pull request.
Don't forget to add your team members!
- Select Settings (gear, top right) *> Collaborators and teams (under
Access) - Click
Add peopleorAdd teams - Use the search box to find people or teams
- Choose a role (read, triage, write, maintain, admin)
- Click Add
The stack includes a frontend (Vue.js, Vite, Caddy), backend (Express, Node) and Postgres database. See subfolder for source, including Dockerfiles and OpenShift templates.
Features:
- TypeScript strong-typing for JavaScript
- Express Nest/Node backend and frontend
- Crunchy Postgres Database
Crunchy is the default choice for high availability (HA) Postgres databases in BC Government.
- Automatic failover with Patroni
- Scheduled backups
- Monitoring
- Self-healing capabilities
- Horizontal scaling options (Read Replicas)
- Resource Allocation: Adjust the resources in crunchy helm chart values based on your application needs, since the defaults are just minimal.
- Environment Configuration: Create environment-specific configs from base values.yml as
values-test.ymlandvalues-prod.yml, Make sure there are at least 3 replicas in PRODUCTION. - DR Testing: Disaster Recovery Testing is
MANDATORYbefore go live.
To enable S3 backups/recovery, provide these parameters to the GitHub Action:
s3_access_keys3_secret_keys3_buckets3_endpoint
Important: Never reuse the same s3/object store, bucket path across different Crunchy deployments or instances (dev, test, prod)
For advanced configuration, see the re-usable GitHub Action that manages PR deployments and helm template upgrades.
If you encounter issues, check out the Troubleshooting Guide for quick solutions.
Need more help? Join the discussion in the CrunchyDB Rocket.Chat Channel to get support from the community and experts.
The database documentation is created and deployed to GitHub pages. See here.
After a full workflow run and merge can been run, please do the following:
- Select Settings (gear, top right) *> Pages (under
Code and automation) - Click
BranchorAdd teams - Select
gh-pages - Click
Save
- Flyway is used as Database Schema Migration tool
- Prisma is used as ORM layer
- The rationale behind using flyway to have schema first approach and let prisma generate ORM schema from the database, which would avoid pitfalls like lazy loading, cascading, etc. when defining entities in ORM manually.
- Run flyway in the docker compose to apply latest changes to Postgres database.
- Run npx prisma db pull from backend folder to sync the prisma schema.
- Run npx prisma generate to generate the prisma client which will have all the entities populated based on fresh prisma schema.
- If using VS Code, be aware of this issue
This repository is provided by NRIDS Architecture and Forestry Digital Services, courtesy of the Government of British Columbia.
- NRID's Kickstarter Guide (via. Confluence, links may be internal)
The architecture diagram provides an overview of the system's components, their interactions, and the deployment structure. It illustrates the relationships between the frontend, backend, database, and other infrastructure elements within the OpenShift environment.
Please contribute your ideas! Issues and Pull Requests are appreciated.


