bcgov / nr-bcmi

0 stars 0 forks source link

BCMI (mem-mmti-public)

https://mines.nrs.gov.bc.ca/

Introduction

The Ministry of Energy, Mines, and Low Carbon Innovation (EMLI), Ministry of Environment and Climate Change Strategy (ENV), and Environmental Assessment Office (EAO) have collaborated to make information on the Province’s oversight of major mines in British Columbia accessible.

The application is being developed as an open source solution.

Table of Contents

  1. Getting Started
  2. Running tests
  3. Architecture
  4. How to Contribute
  5. License
  6. Additional Documentation

Getting Started

To get a local copy up and running follow these steps.

Prerequisites

Git commit signing is required for commits. How to setup git commit signing

Software Requirements

Installation

To run/develop using docker:

  1. Run docker compose up

To run the frontend locally:

  1. Install angular/cli npm i -g @angular/cli
  2. cd bcmi
  3. npm install
  4. npm run start

    To run Strapi locally:

  5. create an .env file in the cms folder using the .env.template, find secrets in openshift
  6. cd cms
  7. npm install
  8. npm run develop
  9. Login to strapi admin at http://localhost:1337/admin
  10. See graphql queries at http://localhost:1337/graphql (ensure the strappi content has the 'find' role enabled)

(back to top)

Running tests:

Unit tests

Set up via Jest.

  1. Run npm test to execute the unit tests.

End-to-end functional tests

Set up with BDDStack and BrowserStack. Modify GebConfig.groovy to customise your preferred browser. Configured remotes, confirmed to work with current tests include Chrome, Firefox, and Edge. Internet explorer and Safari are available as well, but tests fail due to driver compatiblity with current tests.

BrowserStack Config

Open Source projects have free access to Browserstack Live and Automate, for up to 5 team members. To run tests with Browserstack you need to set the following environemnt variables:

  1. BROWSERSTACK_USERNAME
  2. BROWSERSTACK_TOKEN
  3. DEBUG_MODE (true or false)

Run tests against local application:

Note, e2e functional testing requires Java 10+.

Run tests against remote application:

  1. Determine the URL at which the application is running.
  2. Update the baseurl to the URL from step 1:
    • Either modify the GebConfig.groovy baseUrl directly.
    • Or set a BASEURL environment variable
  3. See functional-tests/readme.md for how to execute the tests.

See the BDDStack Wiki for more information.

(back to top)

Architecture

BCMI is built using TypeScript and Angular for the front end, with Jest for testing. It employs PostgreSQL for database management and Node.js for the server, alongside Bootstrap and jQuery for design and interactivity. GraphQL facilitates data querying, while Strapi acts as the headless CMS.

Our production and staging environments run on an OpenShift container platform cluster. OpenShift templates for services are located in the openshift/ folder, along with more information about dev and staging environments on our cluster.

(back to top)

How to Contribute

Feel free to create pull requests from the default "master" branch, click here to create one automatically: https://github.com/bcgov/mem-mmti-public/pull/new/master

Contributing

Government employees, the public and members of the private sector are encouraged to contribute. Check the BC Developer Exchange website, where paid opportunities to build features are posted. Please read and follow our Code of Conduct.

All contributors retain original copyright, but are granting a world-wide, royalty-free, perpetual, irrevocable, non-exclusive, transferable license to all users. This project is covered by an Apache v2.0 license.

(back to top)

License

Code released under the Apache License, Version 2.0.

(back to top)

Additional Documentation

More documentation for the repository can be found in the following places

(back to top)