gwells
Groundwater Wells and Aquifers application for the Ministry of Environment
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.7%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Groundwater Wells and Aquifers application for the Ministry of Environment
Basic Info
- Host: GitHub
- Owner: bcgov
- License: apache-2.0
- Language: Python
- Default Branch: release
- Homepage: https://apps.nrs.gov.bc.ca/gwells/
- Size: 125 MB
Statistics
- Stars: 31
- Watchers: 13
- Forks: 36
- Open Issues: 102
- Releases: 8
Topics
Metadata Files
README.md
Groundwater Wells and Aquifers (GWELLS)
https://apps.nrs.gov.bc.ca/gwells/
Introduction
The Ministry of Environment receives and processes groundwater data and information related to the construction, alteration and decommissioning of groundwater wells. Well construction and reporting requirements are regulated under the Water Sustainability Act and Groundwater Protection Regulation. The information collected and stored is used by government and other users to help inform decisions related to the management of the groundwater resource in B.C.
GWELLS, the new groundwater data repository, aims to improve the user experience when submitting and searching for well information, to improve the quality of the data being submitted, and to improve the overall functionality of the system to meet user and regulatory requirements.
The application is being developed as an open source solution.
Table of Contents
Using the GWELLS API
GWELLS maintains a REST API where public data relating to wells is made available for other applications and services.
Our Swagger documentation is available at https://apps.nrs.gov.bc.ca/gwells/api/. Some examples of GWELLS endpoints:
Wells:
```sh
all wells (paginated)
curl https://apps.nrs.gov.bc.ca/gwells/api/v1/wells
all wells in an area bounded by swlat, swlong, nelat, and nelong
curl https://apps.nrs.gov.bc.ca/gwells/api/v1/wells?swlat=51.599253&swlong=-128.220340&nelat=52.108192&nelong=-127.150547 ```
Aquifers:
```sh
all aquifers
curl https://apps.nrs.gov.bc.ca/gwells/api/v1/aquifers ```
See the Swagger documentation for more examples.
DataBC Export
GWELLS Api is used by DataBC to export model information and provide well information on the DataBC website.
The command located in app/backend/gwells/management/commands/export_databc.py is used to pull data from the gwells database and export it for consumption in DataBC.
If a new field(s) are needed for export, this exportdatabc.py has raw sql queries that need to be updated with the required fields. Descriptions are also needed for the swagger documentation that are pulled from the dbcomment fields in the django models. Both the raw sql queries and the db_comment field on the model need to be updated for new fields.
Developing GWELLS
Setup Prerequisites
Software Requirements
- Docker Desktop
- Node
Actions to take:
- Connecting to Minio
- CSSO Authentication
- You will need to login to artifactory with your IDIR so a member of Sustainment Team can add you.
Connecting to Minio
For gwells to interact with your local instance of Min.IO add the appropriate settings to your local machines HOSTS file:
127.0.0.1 minio-public
127.0.0.1 minio-private
Authentication
Some GWELLS pages (submitting new well reports, adding or editing aquifers, or adding or editing qualified well drillers to the registry) require authentication. Authentication uses the Province's Single Sign-On system. A GWELLS team member can request access for collaborators if needed.
Running the GWELLS application locally
- Clone the GWELLS repository
- From the gwells folder run
docker-compose up -d
Login to Artifactory for pulling the backend base image:
sh
docker login -u <svc-usn> -p <svc-pwd> artifacts.developer.gov.bc.ca/g26e-backend-docker-local
Replace svc-usn and svc-pwd with Artifactory service account credentials obtained from Openshift (under artifacts-default-tulivf secrets)
Then, run the application with Docker:
sh
cd gwells
docker-compose up
Running GWELLS locally with a connection to Staging's Database
To have a more complete dataset while running locally, you can opt to point the backend at GWELLS' staging database while using the BC Government VPN. This will provide a more robust dataset for debugging or feature testing.
Duplicate
.env.templateand rename the new file as.env.testUsing the database secrets from GWELLS' staging namespace on OpenShift, replace the variables in your new
.env.testfile. You'll need to changeENVIRONMENTto 'test' as well to ensure the propercommandis run from theapp/scripts/backend-command-script.shfile.Note: to get the
GWELLS_SERVICE_HOSTandGWELLS_SERVICE_PORT, use theocCLI and login to GWELLS' test namespace; run the following command to view theTransportServerfor the staging database:``` oc project 26e83e-test
oc -n 26e83e-test get ts ```
This should print out a
VIRTUALSERVERADDRESS(theGWELLS_SERVICE_HOST) and aVIRTUALSERVERPORT(theGWELLS_SERVICE_PORT)NAME VIRTUALSERVERADDRESS VIRTUALSERVERPORT POOL POOLPORT IPAMLABEL IPAMVSADDRESS STATUS AGE yourservice-tsc 142.34.194.68 65555 yourservice 8000 None Ok 21dYour
.env.testfile should look something like this:```
.env for test environment
ENVIRONMENT=test APITARGET=http://backend:8000/ DATABASEUSER=
DATABASEPASSWORD= GWELLS SERVICEHOST=142.34.194.68 GWELLSSERVICE_PORT=``` Once
.env.testhas the proper environment variables, run thedocker-compose upcommand with the--env-fileflag:docker-compose --env-file ./.env.test up
You should now have a local build with a backend that points to staging's database. Be mindful when saving or changing data to the staging database.
If you're encountering any issues with the build, ensure that your VPN is connected and working properly.
Minio doesn't download while connected using the VPN. This is a known issue.
Running GWELLS in Debug Mode
Ensure you have a launch.json file in the .vscode directory.
json
{
"version": "0.2.0",
"configurations": [
{
"name": "Remote Django App",
"type": "python",
"request": "attach",
"pathMappings": [
{
"localRoot": "${workspaceFolder}/app/backend",
"remoteRoot": "/app/backend"
}
],
"port": 3000,
"host": "localhost"
}
]
}
In VS Code, press F5 or go to Run > Start Debugging to run in debug mode.
You can now add breakpoints within GWELLS - more information about debugging in VS Code here.
Connecting to PGAdmin
Information in this section reflects docker-compose as of
Nov 8th, 2023
PG Admin is setup in the docker-compose up and requires no additional installations
Steps:
- Connect to Pgadmin through localhost
- Login using username:
admin@gwells.com, password:admin - Right click
Server->Register->Server - Enter any meaningful name in
Name - Under the
Connectiontab supply the following values
| Field | Value |
| ------------------- | -------- |
| Host name / address | db |
| Port | 5432 |
| Username | gwells |
| Password | test1 |
Visit the following links to browse the API and frontend applications:
- Django REST API development server: http://localhost:8000/gwells/api/
- Vue frontend development server: http://localhost:8080/
Running tests:
For comprehensive testing information visit the Wiki
Postman API tests:
Import the json test collections in the api-tests/ folder into Postman.
Import a Shapefile
Single shapefile, with aquifer ID specified in CLI.
docker-compose exec backend python manage.py import_shapefile 2 aquifers/fixtures/shp/shapefile.zip
Bulk import, requires the AQ_NUMBER attribute on each polygon. Requires a folder with shapefiles to be prepared and passed in (zipped or not). Note: if DEBUG=True, all geometries will be uploaded to a random aquifer instead of the one matching its' number, so we can test locally with a development database.
``` mkdir app/backend/bulk mv DATABCEXPORTFILE.zip app/backend/bulk/
docker-compose exec backend python manage.py importbulkshapefile bulk ```
Importing Licences
To download new licence data from DataBC and merge it into your DB, do
docker-compose exec backend python manage.py import_licences
Making pull requests
Pull requests made from branches in the bcgov/gwells repo will kick off a dev pipeline, which runs tests and deploys a preview environment containing your changes. The pull request page will update when the environment is deployed and mandatory checks (unit tests, etc.) pass or fail.
Architecture
GWELLS uses PostgreSQL (with PostGIS), Django REST Framework, and Vue.js. We also use both AWS S3 and a self-hosted Minio service for storing documents.
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.

Contributing
Government employees, the public and members of the private sector are encouraged to contribute. 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.
Code With Us
Many of our features have been developed by members of the community. Check the BC Developer Exchange website, where paid opportunities to build features for GWELLS and other applications are posted.
License
Code released under the Apache License, Version 2.0.
Additional Documentation
More documentation for the repository can be found in the following places
New pipeline deployment instructions
Dev Environment
Steps before merging Pull Request into 'release': 1. Login to OpenShift
- Navigate to '26e83e-tools' in projects

- Make sure you are in the administrator view

- Go to Builds -> BuildConfigs

- Find 'gwells-frontend'

- Click on the YAML tab

- Find the 'VITEAXIOSBASE_URL' environment variable and change the url to include 'dev'. (It may currently already say dev, or test or prod)

- Hit 'save'

You can now merge the Pull Request
A build for the frontend and backend will now be triggered and automatically deploy to the dev environment once built.
Test Environment - Steps before merging Pull Request into 'release': 1. Login to OpenShift
- Navigate to '26e83e-tools' in projects

- Make sure you are in the administrator view

- Go to Builds -> BuildConfigs

- Find 'gwells-frontend'

- Click on the YAML tab

- Find the 'VITEAXIOSBASE_URL' environment variable and change the url to include 'test'. (It may currently already say dev, or test or prod)

- Hit 'save'

- You can now merge the Pull Request
Steps after merging Pull Request into 'release':
- Once the frontend and backend builds are complete navigate to Pipelines -> Pipelines

- Then select 'promote-to-test'

- Finally Select Actions -> Start

- The frontend and backend will then deploy to the test environment
Prod Environment - Steps before merging Pull Request into 'release': 1. Login to OpenShift
- Navigate to '26e83e-tools' in projects

- Make sure you are in the administrator view

- Go to Builds -> BuildConfigs

- Find 'gwells-frontend'

- Click on the YAML tab

- Find the 'VITEAXIOSBASE_URL' environment variable and change the url to include 'prod'. (It may currently already say dev, or test or prod)

- Hit 'save'

- You can now merge the Pull Request
Steps after merging Pull Request into 'release':
- Once the frontend and backend builds are complete navigate to Pipelines -> Pipelines

- Then select 'promote-to-prod'

- Finally Select Actions -> Start

- The frontend and backend will then deploy to the prod environment
Owner
- Name: bcgov
- Login: bcgov
- Kind: organization
- Email: Developer.Experience@gov.bc.ca
- Location: Canada
- Website: https://github.com/bcgov/BC-Policy-Framework-For-GitHub
- Repositories: 2,150
- Profile: https://github.com/bcgov
This is the home for code that is open
GitHub Events
Total
- Create event: 98
- Issues event: 81
- Watch event: 2
- Delete event: 91
- Member event: 1
- Issue comment event: 54
- Push event: 165
- Pull request review comment event: 7
- Pull request review event: 13
- Pull request event: 178
Last Year
- Create event: 98
- Issues event: 81
- Watch event: 2
- Delete event: 91
- Member event: 1
- Issue comment event: 54
- Push event: 165
- Pull request review comment event: 7
- Pull request review event: 13
- Pull request event: 178
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Steve Hillier | s****r@g****m | 1,687 |
| Derek Roberts | d****s@g****m | 668 |
| Sybrand Strauss | s****s@g****a | 518 |
| Gary Wong (BC Gov) | g****g@g****a | 410 |
| Roland Stens | r****s@g****m | 410 |
| AlexZorkin | a****x@b****s | 396 |
| Séamus O'Connor | s****r@p****m | 328 |
| Fieran Mason | f****n@g****m | 310 |
| sgreylyn | s****n@g****m | 229 |
| Dallas Richmond | d****d@g****a | 183 |
| LocalNewsTV | 6****V | 163 |
| Louie | C****E@B****V | 120 |
| Cole Maclean | hi@c****o | 110 |
| Ryan Barber | r****b@s****u | 102 |
| Aaron | a****n@c****a | 95 |
| Clark Van Oyen | c****k@c****a | 85 |
| Dan | d****n@b****o | 84 |
| calouie | c****e@g****a | 82 |
| acatchpole | a****e@g****m | 74 |
| Rodolfo Carvalho | r****o@g****m | 73 |
| Brock Anderson | b****k@b****a | 71 |
| Daine Trinidad | d****d@g****a | 57 |
| David | 6****u | 57 |
| garywong-bc | g****g@g****a | 51 |
| Sanjay Babu | s****u@g****m | 50 |
| kuanfandevops | 3****s | 45 |
| Your Name | y****u@e****m | 45 |
| GeorgeWalker | g****r@q****m | 44 |
| Norris Ng | 1****c | 38 |
| Clécio Varjão | 1****o | 34 |
| and 41 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 307
- Total pull requests: 2,256
- Average time to close issues: 2 months
- Average time to close pull requests: 6 days
- Total issue authors: 29
- Total pull request authors: 45
- Average comments per issue: 0.94
- Average comments per pull request: 0.52
- Merged pull requests: 1,852
- Bot issues: 3
- Bot pull requests: 80
Past Year
- Issues: 61
- Pull requests: 206
- Average time to close issues: 20 days
- Average time to close pull requests: 13 days
- Issue authors: 10
- Pull request authors: 7
- Average comments per issue: 0.49
- Average comments per pull request: 0.11
- Merged pull requests: 150
- Bot issues: 0
- Bot pull requests: 39
Top Authors
Issue Authors
- LolandaE (64)
- QSu-2023 (51)
- jakemorr (36)
- Keegnan (32)
- fergmac (32)
- LocalNewsTV (20)
- carmenriddel (11)
- lunamoonmoon (10)
- dallascrichmond (8)
- acatchpole (7)
- sanjaytkbabu (6)
- raarielgrace (5)
- Rebecca-MDS (5)
- bcdevex (4)
- norrisng-bc (4)
Pull Request Authors
- stephenhillier (332)
- garywong-bc (221)
- DerekRoberts (209)
- rstens (208)
- seamus-oconnor (186)
- dallascrichmond (160)
- AlexZorkin (159)
- Sybrand (157)
- fieranmason (124)
- dependabot[bot] (89)
- LocalNewsTV (85)
- SethGreylyn (40)
- danbigthink (35)
- fergmac (35)
- acatchpole (29)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 9
proxy.golang.org: github.com/bcgov/gwells
- Documentation: https://pkg.go.dev/github.com/bcgov/gwells#section-documentation
- License: apache-2.0
-
Latest release: v1.54.0
published almost 7 years ago
Rankings
Dependencies
- junit:junit 4.12 testCompile
- 1479 dependencies
- @vue/cli-plugin-babel ^3.7.0 development
- @vue/cli-plugin-eslint ^3.7.0 development
- @vue/cli-plugin-unit-jest ^3.7.0 development
- @vue/cli-service ^3.7.0 development
- @vue/eslint-config-standard ^4.0.0 development
- @vue/test-utils 1.0.0-beta.29 development
- babel-core 7.0.0-bridge.0 development
- babel-eslint ^10.0.1 development
- babel-jest ^23.6.0 development
- eslint ^5.16.0 development
- eslint-plugin-vue ^5.0.0 development
- jest-transform-stub ^2.0.0 development
- jquery ^3.4.1 development
- moxios ^0.4.0 development
- node-sass ^4.9.0 development
- sass-loader ^7.1.0 development
- vue-template-compiler ^2.5.21 development
- @geolonia/mbgl-gesture-handling ^1.0.13
- @mapbox/mapbox-gl-geocoder ^4.5.1
- @sentry/browser ^5.7.1
- @sentry/integrations ^5.7.1
- axios ^0.21.1
- bootstrap-vue ^2.0.0-rc.2
- browser-update ^3.3.8
- chart.js ^2.9.4
- deep-diff ^1.0.2
- lodash-es ^4.17.15
- mapbox-gl ^1.10.0
- papaparse ^5.2.0
- proj4 ^2.4.4
- smoothscroll ^0.4.0
- vue ~2.6.10
- vue-analytics ^5.16.4
- vue-chartjs ^3.4.2
- vue-matomo ^4.0.1
- vue-moment ^4.1.0
- vue-router ^3.0.1
- vue-select ^3.1.0
- vuejs-noty ^0.1.3
- vuex ^3.0.1
- GDAL >=2.4,<3.0
- coverage >=4.4.2
- cryptography ==3.3.2
- deepdiff >=4
- django >=2.2,<2.3
- django-cors-headers ==2.2.0
- django-crispy-forms >=1.6.1
- django-debug-toolbar >=1.7
- django-extensions ==2.0.6
- django-filter >=2.0.0,<2.1
- django-formtools >=2.0
- django-rest-multiple-models ==2.1.0
- django-reversion ==2.0.13
- django-settings-export >=1.2.1
- djangorestframework >=3.11.2,<3.12
- djangorestframework-csv ==2.1.0
- djangorestframework-jwt ==1.11.0
- drf-yasg ==1.20.0
- geojson ==2.4.1
- gevent ==1.2.2
- gunicorn ==19.9.0
- lxml ==4.6.3
- minio >=4.0.16
- openpyxl ==2.5.11
- psycopg2-binary >=2.7.1,<2.9
- requests ==2.21.0
- urllib3 >=1.24,<1.25
- whitenoise >=4.1.2
- inflection ==0.5.0
- joblib ==0.15.1
- numpy ==1.18.5
- profanity-check ==1.0.3
- profanityfilter ==2.0.6
- scikit-learn ==0.22.2.post1
- scipy ==1.4.1
- threadpoolctl ==2.1.0
- crunchydata/crunchy-postgres-gis centos7-12.2-4.2.2
- gwells/backend latest
- node 8.9.4
- pramsey/pg_tileserv latest
- registry.access.redhat.com/rhscl/python-36-rhel7 1 build
- alpine latest build
- minio/minio RELEASE.2020-11-25T22-36-25Z build
- registry.access.redhat.com/rhscl/postgresql-12-rhel7 1-10 build
- alpine latest build
- BuildConfig latest build
- alpine latest build
- actions/labeler v4 composite
- registry.access.redhat.com/ubi8/ubi 8.7 build
- bcdata >=0.4.5
- geopandas >=0.10
- jupyterlab >=3.2.1
- python-levenshtein ==0.12.2
- rasterio *
- requests >=2.26
- thefuzz ==0.19.0