Groundwater Accounting Platform

Enables water managers, landowners, and water users to track groundwater availability and usage with user-friendly dashboards and workflows.
https://github.com/esassoc/qanat-community

Category: Hydrosphere
Sub Category: Freshwater and Hydrology

Last synced: about 21 hours ago
JSON representation

Repository metadata

Welcome to the source code repository for the Groundwater Accounting Platform (codename "Qanat"). Qanat is a web application designed to help users monitor and understand their groundwater usage. By providing insights into water consumption and allocations, Qanat aims to promote sustainable water management practices.

README.md

Qanat Platform Documentation

Welcome to the Groundwater Accounting Platform (codename Qanat)! This guide provides comprehensive instructions for setting up and building the project locally. For any questions, please contact info@groundwateraccounting.org.


Developer Setup Instructions

Prerequisites

Ensure the following software is installed:

  1. Visual Studio 2022

  2. Visual Studio Code

  3. VS Code Extensions:

    • Angular CLI from Balram Chavan
    • Docker
    • npm support for VS Code from egamma
    • npm commands for VS Code from Florian Knop
    • npm Intellisense from Christian Kohler
  4. Node.js (Ensure Node.js 18 is used via NVM if needed)

  5. Docker

  6. Microsoft SQL Server

  7. .NET 8 SDK

Qanat API Setup

  1. Clone the repository:
    Clone the repository to C:/git/sitkatech on your development machine.

  2. Set up a SQL user:
    Create a SQL user (e.g., DockerWebUser) with the sysadmin role and the password password#1. Ensure that password policies are not enforced.

  3. Configuration files:
    Copy the template files and remove .template from their file name to produce the following environment variable files. Reach out if you need help filling these out, as they are secrets and should not be committed to the repository.

    • .env (from the docker-compose directory)
    • appsecrets.json (from the Qanat.API directory)
    • secrets (from the Build directory)
    • Create a folder on your machine at the following address:
      C:\sitka\Qanat\GeoServer
      • Create a file named geoserver-environment.properties in the above folder with the following contents:
      datastore-host = host.docker.internal
      datastore-password = password#1
      datastore-user = DockerWebUser
      datastore-database = QanatDB
      
  4. Update environment configuration:
    Copy [repo root dir]\docker-compose\.env.template to [repo root dir]\docker-compose\.env and update the values.

  5. Open the solution in Visual Studio 2022:
    Set docker-compose as the startup project. Press the green play button to start the API server.

Build Folder

  • Note for external developers: You will need to generate your own build folder based on your environment and infrastructure setup.
  • For internal ESA developers, please contact the development team for guidance.

Qanat Web Setup

  1. Open the web workspace:
    Open the qanat-web-workspace in Visual Studio Code ([repo root dir]\Qanat.Web).

  2. Install dependencies and start the server:
    In the VS Code terminal (or your favorite command line tool), run the following commands:

    • npm install
    • npm build
    • npm start
  3. Debugging:
    Press F5 to launch the web app in Google Chrome and debug JavaScript in Visual Studio Code.

    • You may need to set up a launch configuration to point to https://qanat.localhost.sitkatech.com.
  4. Generate models:
    Run npm run gen-model to generate models. If there’s an issue, use the following commands to resolve it:

    • npm install @openapitools/openapi-generator-cli -g
    • openapi-generator-cli version-manager set 5.3.0

Local SSL Setup (API and Web)

Local certificates should be generated automatically:

  1. API:

    • The Qanat.API.csproj file includes a post-build step during debugging that executes dotnet dev-certs https.
  2. Web:

    • The package.json file has a prestart script that checks for local development certificates and attempts to create them if they don't exist.

Tests

The automated tests can be run locally after creating an environment.json file within the Qanat.Tests project with the correct values. These tests are run on our CI builds and should be fixed as soon as possible to avoid bugs piling up.


Troubleshooting After a Period of Inactivity

If the project doesn't work after not working on it for a while, try the following:

  1. Run npm install:
    There might be updated or missing packages added by other developers.

  2. Download, Restore and Build the Database:
    Ensure your database matches the scaffolded entities by rebuilding your database.

  3. Update Environment Variables:
    Get the latest .env, appsecrets.json, build.ini files from a colleague as there may be environment variables added since the last time you ran the project.

  4. Reach out to a colleague:
    If you’re stuck, ask another developer who has recently worked on the project for help.


Configurations for Instances

Additional Front End Configuration:

  • In the Qanat.Web\src\environments folder, update the values in the following TypeScript files to point to your instances's resources:
    • environment.ts
    • environment.qa.ts
    • environment.prod.ts
  • In auth.config.ts, update the msalconfig section to reflect your instance's configuration details.

Secrets:

  • For internal ESA developers, please contact the development team to get the appropriate secret files.
  • For external developers, you will need to generate your own secrets according to your infrastructure setup (e.g., Azure, Google Cloud, AWS, self hosted etc.).

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).

You may obtain a copy of the License at:

https://www.gnu.org/licenses/agpl-3.0

By using this project, you agree to the terms and conditions of this license, which ensure that any derivative works based on this project must also be open-source and made available to the public under the same terms.

Copyright California Water Data Consortium, Environmental Defense Fund, and Environmental Science Associates. Source code licensed under the AGPL 3.0.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 4 days ago

Total Commits: 75
Total Committers: 7
Avg Commits per committer: 10.714
Development Distribution Score (DDS): 0.547

Commits in past year: 67
Committers in past year: 6
Avg Commits per committer in past year: 11.167
Development Distribution Score (DDS) in past year: 0.493

Name Email Commits
Travis Hinkelman t****n@e****m 34
raynardlee r****e@y****m 21
John Henry Burns J****s 8
Mikey Knowles m****s@e****m 6
MackPetersESA m****s@e****m 4
Jamie 9****h 1
Andrew Lovseth 1****a 1

Committer domains:


Issue and Pull Request metadata

Last synced: 4 months ago

Total issues: 0
Total pull requests: 2
Average time to close issues: N/A
Average time to close pull requests: less than a minute
Total issue authors: 0
Total pull request authors: 1
Average comments per issue: 0
Average comments per pull request: 0.0
Merged pull request: 1
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 2
Past year average time to close issues: N/A
Past year average time to close pull requests: less than a minute
Past year issue authors: 0
Past year pull request authors: 1
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/esassoc/qanat-community

Top Issue Authors

Top Pull Request Authors

  • raynardlee (2)

Top Issue Labels

Top Pull Request Labels


Dependencies

Qanat.API/Dockerfile docker
  • base latest build
  • build latest build
  • mcr.microsoft.com/dotnet/aspnet 8.0 build
  • mcr.microsoft.com/dotnet/sdk 8.0 build
Qanat.GDALAPI/Dockerfile docker
  • base latest build
  • build latest build
  • ghcr.io/osgeo/gdal ubuntu-full-3.8.5 build
  • mcr.microsoft.com/dotnet/sdk 8.0 build
Qanat.Swagger/Dockerfile docker
  • base latest build
  • build latest build
  • mcr.microsoft.com/dotnet/aspnet 8.0 build
  • mcr.microsoft.com/dotnet/sdk 8.0 build
Qanat.Web/Dockerfile docker
  • base latest build
  • build latest build
  • mcr.microsoft.com/dotnet/aspnet 8.0 build
  • mcr.microsoft.com/dotnet/sdk 8.0 build
Qanat.Web/docker-compose/docker-compose.override.yml docker
Qanat.Web/docker-compose/docker-compose.vs.debug.yml docker
  • qanat/web latest
Qanat.Web/docker-compose/docker-compose.vs.release.yml docker
  • qanat/web latest
Qanat.Web/docker-compose/docker-compose.yml docker
  • qanat/web latest
docker-compose/docker-compose-test.yml docker
  • mcr.microsoft.com/mssql/server latest
docker-compose/docker-compose.override.yml docker
  • kartoza/geoserver 2.25.2
  • qanat/api latest
  • qanat/swagger latest
docker-compose/docker-compose.yml docker
  • qanat/api latest
  • qanat/gdalapi latest
  • qanat/swagger latest
Qanat.Web/package-lock.json npm
  • 1363 dependencies
Qanat.Web/package.json npm
  • @angular-devkit/build-angular ^17.3.11 development
  • @angular-eslint/builder ^17.3.11 development
  • @angular-eslint/eslint-plugin ^17.3.11 development
  • @angular-eslint/eslint-plugin-template ^17.3.11 development
  • @angular-eslint/schematics ^17.3.11 development
  • @angular-eslint/template-parser ^17.3.11 development
  • @angular/cli ^17.3.11 development
  • @angular/compiler-cli ^17.3.12 development
  • @angular/language-service ^17.3.12 development
  • @compodoc/compodoc ^1.1.19 development
  • @fortawesome/fontawesome-free ^5.13.0 development
  • @openapitools/openapi-generator-cli ^2.4.26 development
  • @types/file-saver ^2.0.7 development
  • @types/geojson ^7946.0.10 development
  • @types/node ^13.13.50 development
  • @typescript-eslint/eslint-plugin ^6.0.0 development
  • @typescript-eslint/eslint-plugin-tslint ^6.0.0 development
  • @typescript-eslint/parser ^6.0.0 development
  • @typescript-eslint/types ^6.19.0 development
  • eslint ^8.51.0 development
  • eslint-config-airbnb-base ^15.0.0 development
  • eslint-config-airbnb-typescript ^17.1.0 development
  • eslint-config-prettier ^8.3.0 development
  • eslint-plugin-import ^2.25.2 development
  • eslint-plugin-prefer-arrow ^1.2.3 development
  • eslint-plugin-simple-import-sort ^10.0.0 development
  • eslint-plugin-unused-imports ^3.0.0 development
  • install ^0.13.0 development
  • npm ^10.6.0 development
  • prettier ^3.4.2 development
  • ts-node ~8.9.1 development
  • typescript ^5.2.0 development
  • @angular/animations ^17.3.12
  • @angular/cdk ^17.1.0
  • @angular/common ^17.3.12
  • @angular/compiler ^17.3.12
  • @angular/core ^17.3.12
  • @angular/elements ^17.3.12
  • @angular/forms ^17.3.12
  • @angular/localize ^17.3.12
  • @angular/platform-browser ^17.3.12
  • @angular/platform-browser-dynamic ^17.3.12
  • @angular/platform-server ^17.3.12
  • @angular/router ^17.3.12
  • @azure/msal-angular ^3.0.6
  • @azure/msal-browser ^3.0.0
  • @datadog/browser-logs ^5.15.0
  • @ng-select/ng-select ^12.0.0
  • @popperjs/core ^2.11.6
  • @tinymce/tinymce-angular ^8.0.1
  • ag-grid-angular ^32.0.0
  • ag-grid-community ^32.0.0
  • color-scheme ^1.0.1
  • core-js ^3.6.5
  • esri-leaflet ^3.0.10
  • esri-leaflet-renderers ^3.0.0
  • file-saver ^2.0.5
  • font-awesome ^4.7.0
  • google-palette ^1.1.0
  • iso8601-js-period ^0.2.1
  • leaflet ^1.7.1
  • leaflet-gesture-handling ^1.2.2
  • leaflet-loading ^0.1.24
  • leaflet.fullscreen ^2.1.0
  • leaflet.markercluster ^1.5.3
  • ng-recaptcha ^13.2.1
  • ngx-mask ^18.0.0
  • ngx-pagination ^5.1.1
  • ngx-select-dropdown ^3.3.0
  • rxjs ^7.0.0
  • set-value >=4.0.1
  • style-loader ^3.3.3
  • tinymce ^7.6.1
  • tslib ^2.3.1
  • vega ^5.24.0
  • vega-embed ^6.21.3
  • vega-lite ^5.6.1
  • webpack ^5.30.0
  • zone.js ~0.14.0
Qanat.API/Qanat.API.csproj nuget
  • Microsoft.EntityFrameworkCore.Design 8.0.7 development
  • Azure.Storage.Blobs 12.21.2
  • ClosedXML 0.102.3
  • CsvHelper 33.0.1
  • Google.Apis.Drive.v3 1.68.0.3508
  • Hangfire.AspNetCore 1.8.14
  • Hangfire.Core 1.8.14
  • Hangfire.SqlServer 1.8.14
  • IdentityServer4.AccessTokenValidation 3.0.1
  • MaxRev.Gdal.Core 3.9.1.247
  • MaxRev.Gdal.LinuxRuntime.Minimal 3.9.1.247
  • Microsoft.AspNetCore.Authentication.OpenIdConnect 8.0.7
  • Microsoft.AspNetCore.Mvc.NewtonsoftJson 8.0.7
  • Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore 8.0.7
  • Microsoft.Identity.Web 3.0.1
  • Microsoft.VisualStudio.Azure.Containers.Tools.Targets 1.21.0
  • NetTopologySuite.IO.GeoJSON 4.0.0
  • Newtonsoft.Json 13.0.3
  • SendGrid.Extensions.DependencyInjection 1.0.1
  • Serilog.AspNetCore 8.0.2
  • Serilog.Expressions 5.0.0
  • Stateless 5.16.0
  • Swashbuckle.AspNetCore 6.7.0
  • Swashbuckle.AspNetCore.Annotations 6.7.0
  • Swashbuckle.AspNetCore.Newtonsoft 6.7.0
  • System.Data.SqlClient 4.8.6
Qanat.Common/Qanat.Common.csproj nuget
  • Microsoft.EntityFrameworkCore.Design 8.0.7 development
  • Microsoft.EntityFrameworkCore.Tools 8.0.7 development
  • Microsoft.AspNetCore.Http.Features 5.0.17
  • Microsoft.EntityFrameworkCore 8.0.7
  • Microsoft.EntityFrameworkCore.Relational 8.0.7
  • Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite 8.0.7
  • NetTopologySuite.Features 2.1.0
  • NetTopologySuite.IO.GeoJSON 4.0.0
  • NetTopologySuite.IO.GeoJSON4STJ 4.0.0
  • ProjNET 2.0.0
Qanat.EFModels/Qanat.EFModels.csproj nuget
  • Microsoft.EntityFrameworkCore.Design 8.0.7 development
  • Microsoft.EntityFrameworkCore.Tools 8.0.7 development
  • Microsoft.EntityFrameworkCore 8.0.7
  • Microsoft.EntityFrameworkCore.Relational 8.0.7
  • Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite 8.0.7
  • NetTopologySuite.IO.GeoJSON 4.0.0
  • Stateless 5.16.0
Qanat.EndpointTests/Qanat.EndpointTests/Qanat.EndpointTests.csproj nuget
  • coverlet.collector 3.1.2 development
  • IdentityModel 6.0.0
  • MSTest.TestAdapter 2.2.10
  • MSTest.TestFramework 2.2.10
  • Microsoft.Extensions.Configuration 6.0.1
  • Microsoft.Extensions.Configuration.Abstractions 6.0.0
  • Microsoft.Extensions.Configuration.Json 6.0.0
  • Microsoft.NET.Test.Sdk 17.2.0
Qanat.GDALAPI/Qanat.GDALAPI.csproj nuget
  • Azure.Storage.Blobs 12.21.2
  • NetTopologySuite.Features 2.1.0
  • NetTopologySuite.IO.GeoJSON4STJ 4.0.0
  • Swashbuckle.AspNetCore 6.7.0
Qanat.Models/Qanat.Models.csproj nuget
  • CsvHelper 33.0.1
  • Microsoft.AspNetCore.Http.Features 5.0.17
  • NetTopologySuite.IO.GeoJSON 4.0.0
  • Newtonsoft.Json 13.0.3
  • ProjNET 2.0.0
  • System.ComponentModel.Annotations 5.0.0
Qanat.Swagger/Qanat.Swagger.csproj nuget
  • Microsoft.EntityFrameworkCore.Design 8.0.7 development
  • Microsoft.AspNetCore.Authentication.OpenIdConnect 8.0.7
  • Microsoft.AspNetCore.Mvc.NewtonsoftJson 8.0.7
  • Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore 8.0.7
  • Microsoft.VisualStudio.Azure.Containers.Tools.Targets 1.21.0
  • NetTopologySuite.IO.GeoJSON 4.0.0
  • Serilog.AspNetCore 8.0.2
  • Serilog.Expressions 5.0.0
  • Swashbuckle.AspNetCore 6.7.0
  • Swashbuckle.AspNetCore.Annotations 6.7.0
  • Swashbuckle.AspNetCore.Newtonsoft 6.7.0
Qanat.Tests/Qanat.Tests.csproj nuget
  • coverlet.collector 6.0.2 development
  • coverlet.msbuild 6.0.2 development
  • Google.Apis.Drive.v3 1.68.0.3508
  • Humanizer.Core 2.14.1
  • MSTest.TestAdapter 3.5.1
  • MSTest.TestFramework 3.6.0
  • MaxRev.Gdal.Core 3.9.1.247
  • MaxRev.Gdal.WindowsRuntime.Minimal 3.9.1.247
  • Microsoft.Extensions.Configuration.Json 8.0.0
  • Microsoft.NET.Test.Sdk 17.10.0
  • Microsoft.SqlServer.DacFx 162.3.566
  • Verify 26.4.5
  • Verify.MSTest 26.4.5
Qanat.UnitTest/Qanat.UnitTest.csproj nuget
  • MSTest.TestAdapter 2.2.3
  • MSTest.TestFramework 2.2.3
  • Microsoft.NET.Test.Sdk 16.9.4
  • coverlet.collector 3.0.2
Qanat.Web/Qanat.Web.csproj nuget
  • Newtonsoft.Json 12.0.3
  • Serilog.AspNetCore 7.0.0
Qanat.CommunityAPI/Examples/Qanat.R/DESCRIPTION cran
  • R >= 4.1.0 depends
  • askpass * imports
  • glue * imports
  • httr2 * imports
  • knitr * suggests
  • rmarkdown * suggests
  • sf * suggests
Qanat.PDFGenerator/Qanat.PDFGenerator.csproj nuget
  • Serilog 4.3.0
  • VegaLite.NET 1.3.22
SitkaCaptureService/SitkaCaptureService.csproj nuget
  • Microsoft.AspNetCore.Mvc 2.3.0
  • Microsoft.Extensions.DependencyInjection 9.0.8
  • Serilog 4.3.0

Score: 4.025351690735149