Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
9e249ef
Add migration for price in parts table
chrisrycx May 5, 2025
c076ecf
SQL to split price out of parts notes
May 7, 2025
30c722e
Merge branch 'database_prices' into priceapi
chrisrycx May 9, 2025
e6c2f09
Add price to backend model and schema
chrisrycx May 12, 2025
ad9cea0
Add price to parts UI and fix bug with saving
chrisrycx May 12, 2025
3d093de
[App] Add /reports route
TylerAdamMartinez May 14, 2025
5ee516f
[Home & Reports] Refactor Home view & init Reports view
TylerAdamMartinez May 14, 2025
14b982d
[/views] Reactor views to have consisent theming
TylerAdamMartinez May 14, 2025
136edad
[Work Orders] Refactor page's style & action buttons
TylerAdamMartinez May 14, 2025
ea67024
[Activities] Refactor pages style & rm tabs
TylerAdamMartinez May 14, 2025
64519e4
[sidenav] Update links, text, & icons
TylerAdamMartinez May 14, 2025
7ad9b89
[NavLink] Refactor to its own component
TylerAdamMartinez May 14, 2025
620342f
Merge pull request #108 from NMWDI/priceapi
chrisrycx May 15, 2025
300762a
Merge pull request #109 from NMWDI/TAM-add-reports-page-and-refactor-…
chrisrycx May 16, 2025
7b6382b
[/Reports] Add init reports
TylerAdamMartinez May 16, 2025
9ee1051
[/Reports] Add forms to reports pages
TylerAdamMartinez May 20, 2025
0845604
[App][Topbar] Update app's layout
TylerAdamMartinez May 20, 2025
288fb0e
Merge pull request #110 from NMWDI/TAM-add-reports-page-and-refactor-…
chrisrycx May 20, 2025
d84f2b0
[index] First attempt at new autocomplete
TylerAdamMartinez May 22, 2025
1f12e54
[Reports/Inventory] Update Parts to be a mulitselect
TylerAdamMartinez May 22, 2025
25c9198
[App] Update app's layout to keep the topbar on top and sidenav on th…
TylerAdamMartinez May 22, 2025
5c4ea09
[reports/inventory] Add init data grid table to report page
TylerAdamMartinez May 22, 2025
84fa3d4
[reports/inventory] Fix the datagrid
TylerAdamMartinez May 22, 2025
ee93b4b
[reports/inventory] Update layout
TylerAdamMartinez May 22, 2025
dc06484
[/views] General UI patches
TylerAdamMartinez May 23, 2025
4eec517
[/frontend] Refactor codebase
TylerAdamMartinez May 23, 2025
0ec1065
[/views] Rm unused imports
TylerAdamMartinez May 27, 2025
a1358f1
Merge pull request #111 from NMWDI/TAM-complete-inventory-report
chrisrycx May 27, 2025
d2fc795
[parts] Add /parts/used endpoint
TylerAdamMartinez Jun 2, 2025
272c2c7
[parts] Update parts/used endpoint for better data management
TylerAdamMartinez Jun 2, 2025
def9b52
Merge pull request #112 from NMWDI/TAM-inventory-report-backend
chrisrycx Jun 3, 2025
2175a8f
Added register details to get part
chrisrycx Jun 3, 2025
883b257
Merge in dev??
chrisrycx Jun 3, 2025
27ba87e
Merge branch 'dev' of https://github.com/NMWDI/WaterManagerDB into dev
chrisrycx Jun 3, 2025
0b206e8
[Reports/PartsUsed] Add filter based on part type field
TylerAdamMartinez Jun 4, 2025
1c9e6dc
[api/routes/parts] Add endpoint for pdf generation
TylerAdamMartinez Jun 4, 2025
d294224
Merge pull request #113 from NMWDI/TAM-select-part-type-and-export-to…
chrisrycx Jun 5, 2025
53db6ea
Add weasyprint to dockerfile
chrisrycx Jun 6, 2025
e17fa17
[repairs -> maintenance] Update name & route
TylerAdamMartinez Jun 20, 2025
5d6a307
[package] Add @mui/x-charts
TylerAdamMartinez Jun 24, 2025
a3c7336
[Maintenance] Add dummy pie charts
TylerAdamMartinez Jun 24, 2025
a1a6fc1
[Maintenance] Add template data grid to report
TylerAdamMartinez Jun 24, 2025
5c55075
[maintenance] Init
TylerAdamMartinez Jun 25, 2025
2af0b36
[maintenance] Update get_maintenance_summary
TylerAdamMartinez Jun 25, 2025
838b24e
[maintenance] Add matplotlib for pie chart
TylerAdamMartinez Jun 25, 2025
b7e4de4
[Maintenance] Update frontend to call backend endpoint
TylerAdamMartinez Jun 25, 2025
a972d78
[api/main] Fix broken route bug
TylerAdamMartinez Jun 25, 2025
cce3ffd
[maintenance] Add guard to handle if all technicians were selected
TylerAdamMartinez Jun 25, 2025
114c466
[Maintenance] Fix broken table column
TylerAdamMartinez Jun 25, 2025
3a52266
[Maintenance] Force non-GUI for plot creation
TylerAdamMartinez Jun 25, 2025
90d6c66
[Maintenance] Add func to download the pdf version
TylerAdamMartinez Jun 25, 2025
cbd39e4
[requirements] Use pipreqs to regenerate requirements based on imports
TylerAdamMartinez Jun 26, 2025
2537c0e
[parts] Update report to only show in_use parts as options
TylerAdamMartinez Jun 27, 2025
ab9c747
[PartsUsed] Update partType => partTypes (now multi-select)
TylerAdamMartinez Jun 27, 2025
1b3adbd
[/templates] Refactor pdf templates to their own files
TylerAdamMartinez Jun 27, 2025
1c3f7a6
[maintenance] Add support for trss filtering
TylerAdamMartinez Jun 27, 2025
c0cbafa
Merge pull request #115 from NMWDI/TAM-maintenance-report
chrisrycx Jun 27, 2025
90b8280
[MonitoringWells] Fix toplevel UI
TylerAdamMartinez Jul 9, 2025
1cf01fb
[MonitoringWells] Add DataGrid & LineChart
TylerAdamMartinez Jul 9, 2025
0c3f345
[MonitoringWells] Add func to pull meters list
TylerAdamMartinez Jul 11, 2025
b31ba9a
[MonitoredWellsUtils] Mv separateAndSortMonitoredWells func to its ow…
TylerAdamMartinez Jul 11, 2025
ed3f1d6
[views] Refactor MonitoringWellsViews & update autpcomplete multi-select
TylerAdamMartinez Jul 11, 2025
e5e78fb
[MonitoringWells] Add styles present on the other page here
TylerAdamMartinez Jul 11, 2025
28ad5a3
[well_measurements] Update endpoint to accept one or more well_ids
TylerAdamMartinez Jul 11, 2025
ed62158
[MonitoringWellsView] Update the component to the new updated endpoint
TylerAdamMartinez Jul 11, 2025
43fe212
[MonitoringWells] Update table to display gathered results
TylerAdamMartinez Jul 11, 2025
be9746f
[MonitoringWells] Update chart to chart data from backend
TylerAdamMartinez Jul 11, 2025
6cac020
[MonitoringWells] Update series config to connect Nulls
Jul 14, 2025
88fb1a7
[well_measurements] Add new /waterlevels/pdf route for pdf generation
Jul 14, 2025
210cc3c
Merge pull request #117 from NMWDI/TAM-create-monitoring-report
chrisrycx Jul 14, 2025
959088c
[/workflows] Add pull_requests script
Jul 15, 2025
ec4734b
[/workflows/pull_requests] Add working-directory to workflow
Jul 15, 2025
212dac4
[/workflows/pull_requests] Update cache-dependency-path
Jul 15, 2025
a45a4e7
[/workflows/pull_requests] Update producation build script to use vit…
Jul 15, 2025
76c1a6e
[Reports/MonitoringWells] Add type assertion to renderTags to fix pro…
Jul 15, 2025
09ef0d1
[workflows/pull_requests] Update to check docker deployment
Jul 15, 2025
4f9c671
[api/Dockerfile] Fix ENVs sytax & add Cython install
Jul 15, 2025
6aa7705
[api/Dockerfile] Add openjdk-17 as sys dependency
Jul 15, 2025
ae916f0
[api/Dockerfile] Update python version
Jul 15, 2025
6fbb5e6
[api/requirements] Add Cython to the top of the list
Jul 15, 2025
1988c16
[requirements] Mv Cython so it will install before jnius
Jul 15, 2025
08f4a49
[Dockerfile & requirements.txt] Update dependencies & download order
Jul 15, 2025
a87915b
[workflows/pull_requests] Rm runners & now only check it a producatio…
Jul 15, 2025
b8169c8
Merge pull request #118 from NMWDI/TAM-create-deployment-github-actio…
TylerAdamMartinez Jul 16, 2025
5f62891
[/frontend] rm unneeded old dockerfiles
Jul 16, 2025
5e567e6
[docker-compose] Update file path for Dockerfile for the frontend
Jul 16, 2025
af8da6d
[deploy-to-gcp] init workflow
TylerAdamMartinez Jul 16, 2025
0576dc2
[deploy-to-gcp] Update script to account for the two envs & rm echos
TylerAdamMartinez Jul 17, 2025
477264c
[PartsUsed] Add toggle switch for in use parts
TylerAdamMartinez Jul 23, 2025
89759a9
[well_measurement] Update api to include isAveragingAllWells & isComp…
TylerAdamMartinez Jul 24, 2025
1052c72
[well_measurements] Patch 1970 average line points
TylerAdamMartinez Jul 24, 2025
37f8a80
[Reports/MonitoringWells] Update the graph date formatter & layout
TylerAdamMartinez Jul 24, 2025
57b27d5
[Reports/MonitoringWells] Mv the 1970 avg line up in time for better …
TylerAdamMartinez Jul 24, 2025
3998aff
[routes/well_measurements] Update the PDF route to include the isAver…
TylerAdamMartinez Jul 24, 2025
303a5b7
Merge pull request #122 from NMWDI/TAM-update-monitoring-report-page
TylerAdamMartinez Aug 11, 2025
4a57fcb
Merge pull request #121 from NMWDI/TAM-update-parts-used-report
TylerAdamMartinez Aug 11, 2025
addf92d
[MonitoringWells] Reverse yAxis on DofW over time lineChart
TylerAdamMartinez Aug 11, 2025
1467a64
[waterlevels_report] Update template & endpoint to include 1970 avg &…
TylerAdamMartinez Aug 11, 2025
c3b3963
Merge pull request #124 from NMWDI/TAM-monitoring-wells-report-patch
TylerAdamMartinez Aug 11, 2025
b6ab532
Merge pull request #119 from NMWDI/TAM-add-deploy-script
TylerAdamMartinez Aug 13, 2025
4a382fb
[workflows/deploy-to-gcp] pass the key directly to the SSH action
TylerAdamMartinez Aug 13, 2025
4a1023c
[api/Dockerfile] fix package names for Debian trixie update
TylerAdamMartinez Aug 13, 2025
02c8a52
[requirements] Update jnius from 1.1.0 to 1.6.1
TylerAdamMartinez Aug 13, 2025
0d13ddd
[requirements] patch for name change
TylerAdamMartinez Aug 13, 2025
fbfa0b3
Merge pull request #125 from NMWDI/TAM-deploy-patch
TylerAdamMartinez Aug 13, 2025
b3d3e58
[deploy-to-gcp] Add Show CI key fingerprint section
TylerAdamMartinez Aug 13, 2025
399dfa7
Merge pull request #126 from NMWDI/TAM-deploy-script-info-add
TylerAdamMartinez Aug 13, 2025
91820a1
[deploy-to-gcp] Fix string interpolation
TylerAdamMartinez Aug 13, 2025
0abf555
Merge pull request #127 from NMWDI/TAM-fix-string-interpolation-deplo…
TylerAdamMartinez Aug 13, 2025
c6be4af
[docker-compose.development] Path api path
TylerAdamMartinez Aug 13, 2025
293fe4c
Merge pull request #128 from NMWDI/TAM-fix-broken-path-end-backend
TylerAdamMartinez Aug 13, 2025
3dd6da1
[api/Dockerfile] Patch copying of imports
TylerAdamMartinez Aug 13, 2025
7f46aef
Merge pull request #129 from NMWDI/TAM-fix-api-imports
TylerAdamMartinez Aug 13, 2025
2b0d78c
update env
TylerAdamMartinez Aug 13, 2025
26ce510
Merge pull request #130 from NMWDI/tam=s
TylerAdamMartinez Aug 13, 2025
b7f6f7c
update compose https
TylerAdamMartinez Aug 13, 2025
f71db21
[docker-compose.development] Rm unused ENV
TylerAdamMartinez Aug 13, 2025
40204b9
[Reports/MonitoringWells] Add support for comparison year
TylerAdamMartinez Aug 14, 2025
38a57c8
[well_measurements] Add suport for comparison year in API
TylerAdamMartinez Aug 14, 2025
b75c9bb
[MeterSelectionMap] Add satellite basemap to meter information all me…
TylerAdamMartinez Aug 14, 2025
3e555b3
[MeterSelectionMap] Add cluster & increase cache time to improve pref…
TylerAdamMartinez Aug 15, 2025
9bea807
[routes/meters] Optimized /meters_locations endpoint
TylerAdamMartinez Aug 15, 2025
0bc462c
[MeterSelectionMap] Add ts-ingore flag for untyped module
TylerAdamMartinez Aug 15, 2025
6afc22a
Merge pull request #131 from NMWDI/TAM-compare-against-x-year
TylerAdamMartinez Aug 15, 2025
0920928
[LICENSE] Add Apache v2.0 License
TylerAdamMartinez Aug 15, 2025
6e00427
Delete LICENSE.md
TylerAdamMartinez Aug 15, 2025
ebfb01a
[README] Update sections & layout
TylerAdamMartinez Aug 15, 2025
03214b7
[CHANGELOG] init
TylerAdamMartinez Aug 15, 2025
bf51804
[routes/wells] Update endpoint to accept optional chloride_group_id s…
TylerAdamMartinez Aug 15, 2025
1b3079e
[WorkOrdersTable] Add Location Name & Water Users columns
TylerAdamMartinez Aug 18, 2025
0e7f1a2
[RegionMeasurementModals] Patch get region id on new measurement model
TylerAdamMartinez Aug 18, 2025
ec478b6
[MeasurementModal] Patch broken timestamps recall from form to backen…
TylerAdamMartinez Aug 18, 2025
bbf061a
[Reports/Chlorides] init prep work for Chlorides report
TylerAdamMartinez Aug 22, 2025
7881b33
[routes/chlorides] Refactor chlorides routes to have its own router
TylerAdamMartinez Aug 22, 2025
d2fad86
[Reports/Chlorides] Add map & route & display cards for report
TylerAdamMartinez Aug 26, 2025
97b434d
[SoutheastGuideLayer] Add new layer for as a visual aid
TylerAdamMartinez Aug 26, 2025
e265e0a
[SoutheastGuideLayer] Fix import error
TylerAdamMartinez Aug 26, 2025
31eae0e
[components/Layers] Refactor layers to their own components
TylerAdamMartinez Aug 26, 2025
9fa924d
[MeterSelectionMap] Add Satellite & SE Guide Layers; plus improved ca…
TylerAdamMartinez Aug 26, 2025
2ad30c2
[routes/wells] Add infiniteQuery to well map
TylerAdamMartinez Aug 26, 2025
afec946
[routes/chlorides] Add endpoint for pdf generation
TylerAdamMartinez Aug 26, 2025
499ca3e
Merge pull request #133 from NMWDI/TAM-create-chlorides-report
TylerAdamMartinez Aug 26, 2025
031af60
[Layers/SoutheastGuideLayer] Update layer based on chloride wells
TylerAdamMartinez Aug 26, 2025
878339e
[components] Update meter legend & add well legend
TylerAdamMartinez Aug 27, 2025
a7a2ec2
[routes/admin] Add /backup-db route
TylerAdamMartinez Aug 22, 2025
6310e47
[meter-manager] init daemon service
TylerAdamMartinez Aug 27, 2025
b2f7efe
[backup] init db shell script for cron job
TylerAdamMartinez Aug 27, 2025
6eb2bc4
Merge pull request #134 from NMWDI/TAM-corn-job-db-email
TylerAdamMartinez Aug 29, 2025
2c1ad4c
[AppLayout] Update app layout
TylerAdamMartinez Aug 29, 2025
c4bf0e9
[login] Improve UI & routing
TylerAdamMartinez Aug 29, 2025
01cfac1
[Topbar] Add role to profile menu
TylerAdamMartinez Aug 29, 2025
1074240
[Home] Patch broken styles on smaller screens
TylerAdamMartinez Aug 29, 2025
e401cb3
[WorkOrderTable] Fix work order table styles
TylerAdamMartinez Aug 29, 2025
9ff9503
[ActivitiesView] Fix broken styles on this view
TylerAdamMartinez Aug 29, 2025
8782aac
[Chlorides & MonitoringWells Views] Fix UI on smaller devices
TylerAdamMartinez Sep 2, 2025
5d81998
[frontend] Refactor frontend pages & add settings page
TylerAdamMartinez Sep 2, 2025
efa7483
[maintenance] Fix TRSS bug
TylerAdamMartinez Sep 2, 2025
b6bb395
[frontend] Rm broken imports
TylerAdamMartinez Sep 2, 2025
17ca0dc
Merge pull request #135 from NMWDI/TAM-trss-bug-fix
TylerAdamMartinez Sep 2, 2025
8aab830
[sidenav] Update drawer to be more responsive
TylerAdamMartinez Sep 2, 2025
0428904
[Settings] Commented out password reset for now
TylerAdamMartinez Sep 2, 2025
67b8963
[MonitoringWells] Patch styles on mobile
TylerAdamMartinez Sep 2, 2025
bc25f00
[views/Reports] Fix styling on reports for tablet & mobile
TylerAdamMartinez Sep 2, 2025
036570a
[Parts & UserManagement] Update pages to be tablet friendly
TylerAdamMartinez Sep 3, 2025
a4cc4df
[BackgroundBox] Stop the page contents to be bigger than xl
TylerAdamMartinez Sep 3, 2025
00db0ac
[AppLayout] Rm unneeded theme call
TylerAdamMartinez Sep 3, 2025
1d3b63a
[index] Update title
TylerAdamMartinez Sep 3, 2025
475fa07
Merge pull request #136 from NMWDI/TAM-create-settings-page
TylerAdamMartinez Sep 3, 2025
4a02495
[api/Dockerfile] Add postgresql-client to download list
TylerAdamMartinez Sep 3, 2025
7b8f001
[routes/admin] Patch /backup datetime typeerror
TylerAdamMartinez Sep 3, 2025
0e48dfd
[meter-manager.service] Update service to auto restart & not shutdown…
TylerAdamMartinez Sep 3, 2025
8ac5cba
[docker-compose.{ENV}] Will store acme.json files instead of asking f…
TylerAdamMartinez Sep 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/deploy-to-gcp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Deploy to GCP Compute VM

on:
push:
branches:
- pre-production
- production

jobs:
deploy:
name: Deploy to GCP VM
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set environment
run: |
if [[ "${GITHUB_REF_NAME}" == "production" ]]; then
echo "SSH_HOST=${{ secrets.GCP_PROD_SSH_HOST }}" >> "$GITHUB_ENV"
echo "COMPOSE_FILE=docker-compose.production.yml" >> "$GITHUB_ENV"
else
echo "SSH_HOST=${{ secrets.GCP_PREPROD_SSH_HOST }}" >> "$GITHUB_ENV"
echo "COMPOSE_FILE=docker-compose.development.yml" >> "$GITHUB_ENV"
fi

- name: Show CI key fingerprint
shell: bash
env:
KEY: ${{ github.ref_name == 'production' && secrets.GCP_PROD_SSH_PRIVATE_KEY || secrets.GCP_PREPROD_SSH_PRIVATE_KEY }}
run: |
set -euo pipefail
printf '%s\n' "$KEY" > key.pem
chmod 600 key.pem
echo -n "CI key fingerprint: "
ssh-keygen -yf key.pem | ssh-keygen -lf -

# Use a single SSH step; choose the key by branch
- name: Deploy to VM via SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ env.SSH_HOST }}
username: ${{ secrets.GCP_SSH_USER }}
key: ${{ github.ref_name == 'production' && secrets.GCP_PROD_SSH_PRIVATE_KEY || secrets.GCP_PREPROD_SSH_PRIVATE_KEY }}
script: |
set -e
cd ${{ secrets.DEPLOYMENT_PATH }}

git fetch origin --prune
git checkout "${{ github.ref_name }}"
git pull --ff-only origin "${{ github.ref_name }}"

docker compose -f "${{ env.COMPOSE_FILE }}" down
docker compose -f "${{ env.COMPOSE_FILE }}" up -d --build

docker image prune -f
35 changes: 35 additions & 0 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: PRs Docker Build Test

on:
pull_request:

jobs:
docker-build:
name: Test Production Docker Builds
runs-on: ubuntu-latest

services:
docker:
image: docker:24.0.5
options: --privileged
ports:
- 5173:80
- 8000:8000
- 8080:8080

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Build Frontend Production Image
- name: Build Frontend Docker Image
run: |
docker build -t frontend-prod -f frontend/Dockerfile ./frontend

# Build Backend Production Image
- name: Build API Docker Image
run: |
docker build -t api-prod -f api/Dockerfile ./api
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Changelog

All notable changes to **Meter Manager** will be documented in this file.

| Version | Changes |
|-----------|---------|
| v0.2.0 | Parts-used report functional with PDF download |
| v0.1.52 | Deploy chlorides for admin testing |
| v0.1.51.1 | Increased frontend signout to 300 minutes |
| v0.1.51 | Improved monitoring well page |
| v0.1.50 | Fixed wells map bug and update register if part used |
| v0.1.49 | Added outside recorder wells to monitoring page |
| v0.1.48 | Changed well owner to be meter water users |
| v0.1.47 | Add TRSS grids to meter map and fixed meter register save bug |
| v0.1.46 | Change how data is displayed in Wells table |
| v0.1.45 | Color code meter markers on map by last PM |
| v0.1.44 | Fix bug in continuous monitoring well data and added data to OSE endpoint |
| v0.1.43 | Fix navigation from work orders to activity, add OSE endpoint for "data issues" |
| v0.1.42 | Fix pagination, add 'uninstall and hold' |
| v0.1.41 | Add UI for water source on wells and some other minor changes |
| v0.1.40 | Add register to UI on meter details |
| v0.1.39 | Default share ose when workorder, OSE access to register information |
| v0.1.38 | Change logout time to 8 hours, show work order count in navigation |
| v0.1.37.1 | Fix various work order bugs |
| v0.1.37 | Update OSE API to include ose_request_id and new endpoint |
| v0.1.36 | Improved work orders, testing still needed |
| v0.1.35.1 | Fix bug with well search failing on certain inputs |
| v0.1.35 | Update continuous data stream IDs for monitoring wells |
| v0.1.34 | Work orders ready for alpha testing, reordered monitoring wells |
| v0.1.33 | Add Meter Status Filter to Meters Table |
| v0.1.32 | Fix Monitoring Wells so that table updates after change |
| v0.1.31 | Added note "verified register ratio" and made it appear by default |
| v0.1.30 | Admin can edit monitoring well data (note that monitoring well table still not updating automatically) |
| v0.1.29 | Fixed bug preventing meter type change |
| v0.1.28 | Full admin UI on meter page |
| v0.1.27 | Give admin ability to add out of order activities, fix zoom on map, other minor changes |
| v0.1.26 | Add functional merge button for admin |
| v0.1.25 | Fix datesort on meter history, give techs limited well management |
| v0.1.24 | Add non-functional merge button for initial testing |
| v0.1.23 | Prevent duplicate activities from being added |
| v0.1.22 | Change ownership so there is now water_users and meter_owner |
| v0.1.21 | Implement Degrees Minutes Seconds (DMS) for lat/long |
| v0.1.20 | Fix monitoring wells sort |
| v0.1.19 | Updated OSE endpoint to have activity_id, reorganized data returned |
| v0.1.18 | Only require well on install activity, display OSE tag |
| v0.1.17 | Restructure security code to prevent database connection problems |
| v0.1.16 | Fixed bug where status is changed when clearing well from meter |
| v0.1.15 | Updated backend to use SQLAlchemy 2 (resolve connection issue?) |
| v0.1.14 | Display RA number instead of well name, well distance is now observation, new default observations |
| v0.1.13 | Add checkbox for sharing activities with OSE |
| v0.1.12 | Change lat/long to DMS, reorder observation inputs, block out of order activities |
| v0.1.11 | Remove all async code to see if it fixes deadlock issue |
| v0.1.10 | Fix owners and osetag on Wells page |
| v0.1.9 | Add owners to Meters table, fix various bugs |
| v0.1.8 | Fix bug in meter selection autocomplete |
| v0.1.7 | Fixed bugs in Add Meter |
| v0.1.6 | Various fixes and meter search via map UI |
| v0.1.5 | Various minor bug fixes |
| v0.1.4 | Updated "current installation" section of activities to match Meters page |
| v0.1.3 | Added user admin, improved appearance, fixed OSE endpoint scope |
| v0.1.2 | Added an initial parts inventory and minor meter installation UI improvements |
| v0.1.1 | Initial version with new clean database |
| v0.0.0 | Initial minimum viable product |
File renamed without changes.
97 changes: 24 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,80 +1,31 @@
# WaterManagerDB
# Meter Manager

[![Unittests](https://github.com/NMWDI/WaterManagerDB/actions/workflows/testing.yml/badge.svg)](https://github.com/NMWDI/WaterManagerDB/actions/workflows/testing.yml)
[![Format code](https://github.com/NMWDI/WaterManagerDB/actions/workflows/format_code.yml/badge.svg)](https://github.com/NMWDI/WaterManagerDB/actions/workflows/format_code.yml)
### Purpose

## Versions
- V0.1.52 - Deploy chlorides for admin testing
- V0.1.51.1 - Increased frontend signout to 300 minutes
- V0.1.51 - Improved monitoring well page
- V0.1.50 - Fixed wells map bug and update register if part used
- V0.1.49 - Added outside recorder wells to monitoring page
- V0.1.48 - Changed well owner to be meter water users
- V0.1.47 - Add TRSS grids to meter map and fixed meter register save bug
- V0.1.46 - Change how data is displayed in Wells table
- V0.1.45 - Color code meter markers on map by last PM
- V0.1.44 - Fix bug in continuous monitoring well data and added data to OSE endpoint
- V0.1.43 - Fix navigation from work orders to activity, add OSE endpoint for "data issues"
- V0.1.42 - Fix pagination, add 'uninstall and hold'
- V0.1.41 - Add UI for water source on wells and some other minor changes
- V0.1.40 - Add register to UI on meter details
- V0.1.39 - Default share ose when workorder, OSE access to register information
- V0.1.38 - Change logout time to 8 hours, show work order count in navigation
- V0.1.37.1 - Fix various work order bugs
- V0.1.37 - Update OSE API to include ose_request_id and new endpoint
- V0.1.36 - Improved work orders, testing still needed
- V0.1.35.1 - Fix bug with well search failing on certain inputs
- V0.1.35 - Update continuous data stream IDs for monitoring wells
- V0.1.34 - Work orders ready for alpha testing, reordered monitoring wells
- V0.1.33 - Add Meter Status Filter to Meters Table
- V0.1.32 - Fix Monitoring Wells so that table updates after change
- V0.1.31 - Added note "verified register ratio" and made it appear by default
- V0.1.30 - Admin can edit monitoring well data (note that monitoring well table still not updating automatically)
- V0.1.29 - Fixed bug preventing meter type change
- V0.1.28 - Full admin UI on meter page
- V0.1.27 - Give admin ability to add out of order activities, fix zoom on map, other minor changes
- V0.1.26 - Add functional merge button for admin
- V0.1.25 - Fix datesort on meter history, give techs limited well management
- V0.1.24 - Add non-functional merge button for initial testing
- V0.1.23 - Prevent duplicate activities from being added
- V0.1.22 - Change ownership so there is now water_users and meter_owner
- V0.1.21 - Implement Degrees Minutes Seconds (DMS) for lat/long
- V0.1.20 - Fix monitoring wells sort
- V0.1.19 - Updated OSE endpoint to have activity_id, reorganized data returned
- V0.1.18 - Only require well on install activity, display OSE tag
- V0.1.17 - Restructure security code to prevent database connection problems
- V0.1.16 - Fixed bug where status is changed when clearing well from meter
- V0.1.15 - Updated backend to use SQLAlchemy 2 (resolve connection issue?)
- V0.1.14 - Display RA number instead of well name, well distance is now observation, new default observations
- V0.1.13 - Add checkbox for sharing activities with OSE.
- V0.1.12 - Change lat/long to DMS, reorder observation inputs, block out of order activities
- V0.1.11 - Remove all async code to see if it fixes deadlock issue
- V0.1.10 - Fix owners and osetag on Wells page
- V0.1.9 - Add owners to Meters table, fix various bugs
- V0.1.8 - Fix bug in meter selection autocomplete
- V0.1.7 - Fixed bugs in Add Meter
- V0.1.6 - Various fixes and meter search via map UI
- V0.1.5 - Various minor bug fixes
- V0.1.4 - Updated "current installation" section of activities to match Meters page
- V0.1.3 - Added user admin, improved appearance, fixed OSE endpoint scope.
- V0.1.2 - Added an initial parts inventory and minor meter installation UI improvements
- V0.1.1 - Initial version with new clean database
- V0.0 - Initial minimum viable product
**Meter Manager** is a web application designed to help **PVACD** manage its water data. It provides tools for spatial visualization, maintenance tracking, and regulatory reporting.

## Purpose
This web app facilitates reporting of water management operations to other organizations. The initial goal is to help water conservation districts communicate with local and state governments. However, the interface may eventually be developed to be more general.
---

## Installation
The app is built with the following components:
* PostgreSQL database with PostGIS extension
* Python FastAPI backend for interfacing with database
* React based frontend
### Features

App components are organized into Docker containers, but it can also be run locally.
- 🗺️ Interactive map UI for meters and wells
- 🔧 Meter activities, maintenance history, and preventive maintenance (PM) tracking
- 📦 Inventory and part usage tracking
- 📋 Work order and technician assignment system
- 📑 OSE-compliant reporting endpoint
- 🛠️ Admin features for editing, merging, and managing records
- 👥 Role-based access control (techs, admins, etc.)
- 🛰️ TRSS grid overlays for spatial reference
- 💧 Continuous monitoring support for observation wells

To run the app, clone the repository and use Docker Compose to run:
```
/watermanagerdb >> docker compose -f docker-compose.dev.yml --build
```
---

The API component will need several environmental variables that should be specified in the file 'api/.env'. See api/.env_example for an example. The PostgreSQL environmental variables should match the database settings.
### Tech Stack

| Layer | Technology |
|---------------|----------------------|
| **Frontend** | React + TypeScript |
| **Backend** | FastAPI (Python) |
| **Database** | PostgreSQL + PostGIS |
| **Container** | Docker Compose |
| **CI/CD** | GitHub Actions |
36 changes: 25 additions & 11 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
#
FROM python:3.10
FROM python:3.12.11

#
WORKDIR .
WORKDIR /app

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1

#
# Install system dependencies (trixie) + JDK (default is 21) + PostgreSQL client
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libpango-1.0-0 \
libcairo2 \
libgdk-pixbuf-2.0-0 \
libffi-dev \
default-jdk-headless \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*

# Make Java headers discoverable by builds
ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
ENV JDK_HOME=$JAVA_HOME
ENV PATH="${JAVA_HOME}/bin:${PATH}"
ENV PYTHONPATH=/app

# Now install the rest of the requirements
COPY ./requirements.txt .
RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
&& pip install --no-cache-dir -r requirements.txt

#
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY . /app/api

#
COPY . .
19 changes: 0 additions & 19 deletions api/Dockerfile_dev

This file was deleted.

16 changes: 10 additions & 6 deletions api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
from api.schemas import security_schemas
from api.models.main_models import Users

from api.routes.meters import meter_router
from api.routes.well_measurements import well_measurement_router
from api.routes.activities import activity_router
from api.routes.admin import admin_router
from api.routes.chlorides import chlorides_router
from api.routes.maintenance import maintenance_router
from api.routes.meters import meter_router
from api.routes.OSE import ose_router
from api.routes.parts import part_router
from api.routes.admin import admin_router
from api.routes.well_measurements import well_measurement_router
from api.routes.wells import well_router

from api.security import (
Expand Down Expand Up @@ -126,11 +128,13 @@ def login_for_access_token(

# =======================================

authenticated_router.include_router(meter_router)
authenticated_router.include_router(activity_router)
authenticated_router.include_router(well_measurement_router)
authenticated_router.include_router(part_router)
authenticated_router.include_router(admin_router)
authenticated_router.include_router(chlorides_router)
authenticated_router.include_router(maintenance_router)
authenticated_router.include_router(meter_router)
authenticated_router.include_router(part_router)
authenticated_router.include_router(well_measurement_router)
authenticated_router.include_router(well_router)

add_pagination(app)
Expand Down
2 changes: 2 additions & 0 deletions api/models/main_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Parts(Base):
note: Mapped[Optional[str]]
in_use: Mapped[bool] = mapped_column(Boolean, nullable=False, default=True)
commonly_used: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
price: Mapped[Optional[float]] = mapped_column(Float)

part_type_id: Mapped[int] = mapped_column(
Integer, ForeignKey("PartTypeLU.id"), nullable=False
Expand Down Expand Up @@ -580,6 +581,7 @@ class meterRegisters(Base):
__tablename__ = "meter_registers"
brand: Mapped[str] = mapped_column(String, nullable=False)
meter_size: Mapped[float] = mapped_column(Float, nullable=False)
part_id: Mapped[int] = mapped_column(Integer, ForeignKey("Parts.id"))
ratio: Mapped[str] = mapped_column(String)
dial_units_id: Mapped[int] = mapped_column(Integer, ForeignKey("Units.id"), nullable=False)
totalizer_units_id: Mapped[int] = mapped_column(Integer, ForeignKey("Units.id"), nullable=False)
Expand Down
Loading