Catchment Context, Challenges and Values (CCCV)
You can check out the CCCV app at https://cccv.eop.gw.govt.nz/
Context
Ministry for the Environment required all regional councils to provide CCCV information in a complete and digestible way. This requirement aligned with EOP’s intention to maximise the value regional council’s get from their environmental data efforts, and provide clear, consistent and user-centric information to end-users of this data.
Freshwater users such as farmers are required to present plans to the government every five years showing how they will make use of ground and surface water resources and what steps they will take to protect and preserve these and other valuable resources within their catchment. The CCCV app neatly presents data and information about their catchment that they can use to inform their submission. It complements another application built by an external party that the farmers can use to actually create and submit their farm plan.
High-level architecture
The diagram below shows the high level technical architecture of the CCCV application
Key areas:
CCCV Application
This is the front-end UI that end-users interact with to view Plan Limits. It's deployed as static HTML/CSS/JS to AWS Amplify and served via AWS Cloudfront. It consumes data from the Management API, the Tile Server and LINZ Basemaps.
Key technologies:
- Typescript - Type safe language that transpiles to Javascript
- React - A JavaScript library for building user interfaces
- Tanstack Query - Data loading and state management library
- Tailwind CSS - CSS framework
- Mapbox GL - Mapping Library
Manager API
This is a server-side application that exposes APIs for the All of the EOP He Kākāno apps. The Manager provides endpoints to:
- Retrieve a list of Frashwater Management Units and their boundaries
- Retrieve Plan and Consent data related to each FMU
- Retrieve LINZ Basemaps
- Retrieve address matching information and address parcel data from AddressFinder and LINZ Basemaps
- Other council specific GIS data (pulled periodically from ARCGIS)
- Plan and Consent data, consumed from an internal Kafka Broker
The Manager API, like all EOP/He Kākāno backend components is deployed in Docker Containers using Amazon ECS. Key technologies include:
- Kotlin - A modern JVM language
- Spring Boot - A production grade Application Framework
- jOOQ and Flyway - Data access and management libraries
Ingest API
This server-side application exposes authenticated APIs to accept incoming Plan and Consent data from Councils, and persist this to a Kafka Broker. It's developed and deployed using the same technology stack as the Manager API.
Vector Tile Server
This is a simple containerised deployment of pg_tileserv, which connects to the database and serves NZ River GIS data directly to the Web Application as Vector Tiles.
Database
This is a Postgres database with PostGIS extensions installed deployed via AWS RDS.
Kafka Broker
This is a standard Kafka Broker deployed using AWS EKS.
Hosting
The solution is currently hosted on AWS leveraging managed services where possible, and making use Terraform to ensure infrastructure and configuration is defined as code.