gwells
Groundwater Wells and Aquifers application for the Ministry of Environment in British Columbia.
https://github.com/bcgov/gwells
Category: Natural Resources
Sub Category: Water Supply and Quality
Keywords
bcgov-csnr dds django env groundwater-data vuejs
Keywords from Contributors
tran transfer fuel empr flnr carbon nrm award cre cred
Last synced: about 2 hours ago
JSON representation
Repository metadata
Groundwater Wells and Aquifers application for the Ministry of Environment
- Host: GitHub
- URL: https://github.com/bcgov/gwells
- Owner: bcgov
- License: apache-2.0
- Created: 2017-02-28T17:22:23.000Z (about 8 years ago)
- Default Branch: release
- Last Pushed: 2025-04-17T21:06:00.000Z (13 days ago)
- Last Synced: 2025-04-18T00:09:40.209Z (13 days ago)
- Topics: bcgov-csnr, dds, django, env, groundwater-data, vuejs
- Language: Python
- Homepage: https://apps.nrs.gov.bc.ca/gwells/
- Size: 128 MB
- Stars: 30
- Watchers: 12
- Forks: 36
- Open Issues: 101
- Releases: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/codeowners
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.
TEST COMMENT
Table of Contents
Using the GWELLS API
Test
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:
# all wells (paginated)
curl https://apps.nrs.gov.bc.ca/gwells/api/v1/wells
# all wells in an area bounded by sw_lat, sw_long, ne_lat, and ne_long
curl https://apps.nrs.gov.bc.ca/gwells/api/v1/wells?sw_lat=51.599253&sw_long=-128.220340&ne_lat=52.108192&ne_long=-127.150547
Aquifers:
# 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 export_databc.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 db_comment 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:
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:
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.template
and rename the new file as.env.test
-
Using the database secrets from GWELLS' staging namespace on OpenShift, replace the variables in your new
.env.test
file. You'll need to changeENVIRONMENT
to 'test' as well to ensure the propercommand
is run from theapp/scripts/backend-command-script.sh
file.Note: to get the
GWELLS_SERVICE_HOST
andGWELLS_SERVICE_PORT
, use theoc
CLI and login to GWELLS' test namespace; run the following command to view theTransportServer
for 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 21d
Your
.env.test
file should look something like this:# .env for test environment ENVIRONMENT=test API_TARGET=http://backend:8000/ DATABASE_USER=<db-user> DATABASE_PASSWORD=<db-password> GWELLS_SERVICE_HOST=142.34.194.68 GWELLS_SERVICE_PORT=<port-number>
-
Once
.env.test
has the proper environment variables, run thedocker-compose up
command with the--env-file
flag: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.
{
"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
Connection
tab 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 DATABC_EXPORT_FILE.zip app/backend/bulk/
docker-compose exec backend python manage.py import_bulk_shapefile 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
Owner metadata
- Name: bcgov
- Login: bcgov
- Email: Developer.Experience@gov.bc.ca
- Kind: organization
- Description: This is the home for code that is open
- Website: https://github.com/bcgov/BC-Policy-Framework-For-GitHub
- Location: Canada
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/916280?v=4
- Repositories: 2150
- Last ynced at: 2024-12-16T17:13:08.511Z
- Profile URL: https://github.com/bcgov
GitHub Events
Total
- Create event: 70
- Issues event: 56
- Watch event: 1
- Delete event: 62
- Member event: 1
- Issue comment event: 41
- Push event: 83
- Pull request review comment event: 7
- Pull request review event: 13
- Pull request event: 123
Last Year
- Create event: 70
- Issues event: 56
- Watch event: 1
- Delete event: 62
- Member event: 1
- Issue comment event: 41
- Push event: 83
- Pull request review comment event: 7
- Pull request review event: 13
- Pull request event: 123
Committers metadata
Last synced: 1 day ago
Total Commits: 6,835
Total Committers: 70
Avg Commits per committer: 97.643
Development Distribution Score (DDS): 0.753
Commits in past year: 153
Committers in past year: 7
Avg Commits per committer in past year: 21.857
Development Distribution Score (DDS) in past year: 0.464
Name | Commits | |
---|---|---|
Steve Hillier | s****r@g****m | 1687 |
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 |
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 |
Dallas Richmond | d****d@g****a | 82 |
acatchpole | a****e@g****m | 74 |
Rodolfo Carvalho | r****o@g****m | 73 |
Brock Anderson | b****k@b****a | 71 |
David | 6****u | 57 |
Daine Trinidad | d****d@g****a | 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 40 more... |
Committer domains:
- redhat.com: 11
- gov.bc.ca: 8
- countable.ca: 2
- quartech.com: 2
- snyk.io: 1
- me.com: 1
- sample.com: 1
- olivewoodsoftware.com: 1
- compunique.com: 1
- bandersgeo.ca: 1
- bigthink.io: 1
- escapesystems.com: 1
- skyscraper.nu: 1
- cole.io: 1
- pneumaticweb.com: 1
- bigthink.solutions: 1
- zte.com.cn: 1
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 325
Total pull requests: 2,168
Average time to close issues: 2 months
Average time to close pull requests: 6 days
Total issue authors: 30
Total pull request authors: 45
Average comments per issue: 0.9
Average comments per pull request: 0.56
Merged pull request: 1,773
Bot issues: 3
Bot pull requests: 65
Past year issues: 116
Past year pull requests: 103
Past year average time to close issues: 18 days
Past year average time to close pull requests: 17 days
Past year issue authors: 14
Past year pull request authors: 9
Past year average comments per issue: 0.37
Past year average comments per pull request: 0.31
Past year merged pull request: 68
Past year bot issues: 0
Past year bot pull requests: 25
Top Issue Authors
- LolandaE (70)
- QSu-2023 (57)
- fergmac (48)
- jakemorr (38)
- LocalNewsTV (25)
- Keegnan (16)
- carmenriddel (11)
- acatchpole (9)
- dallascrichmond (7)
- sanjaytkbabu (7)
- davidclaveau (4)
- bcdevex (4)
- norrisng-bc (4)
- Rebecca-MDS (3)
- repo-mountie[bot] (3)
Top Pull Request Authors
- stephenhillier (331)
- garywong-bc (221)
- rstens (208)
- DerekRoberts (206)
- seamus-oconnor (186)
- AlexZorkin (158)
- Sybrand (157)
- fieranmason (124)
- LocalNewsTV (69)
- dependabot[bot] (64)
- dallascrichmond (53)
- SethGreylyn (40)
- danbigthink (35)
- GeorgeWalker (29)
- fergmac (26)
Top Issue Labels
- Task (180)
- Ready (147)
- Tech Debt (63)
- User Story (57)
- bug (18)
- Spike (16)
- New Bug (13)
- Old Bug (11)
- Duplicate (11)
- Good first issue (9)
- Cancelled (7)
- No Longer Needed (6)
- Frontend (5)
- Epic (4)
- PO Follow-Up (4)
- Retro Action (3)
- Pipeline (1)
- Contract (1)
- Questions (1)
- Backend (1)
Top Pull Request Labels
- Frontend (175)
- Backend (87)
- dependencies (64)
- javascript (45)
- Docker (39)
- OpenShift (25)
- python (17)
- Testing (17)
- Scripts (8)
- Database (2)
- GitHub Actions (2)
- General (1)
Package metadata
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 9
proxy.golang.org: github.com/bcgov/gwells
- Homepage:
- Documentation: https://pkg.go.dev/github.com/bcgov/gwells#section-documentation
- Licenses: apache-2.0
- Latest release: v1.54.0 (published about 6 years ago)
- Last Synced: 2025-04-29T16:31:46.509Z (1 day ago)
- Versions: 9
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 6.999%
- Average: 8.173%
- Dependent repos count: 9.346%
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
Score: -Infinity