Monotremata Interface

by Amir Yousefi : amir.yousefizanjanifard@un.org

Waterquality Data Management System @ Monotremata

Background

UNEP

SDG 632

GEMS

Open Source

Person

Amir Yousefi

M.Sc. Geoscience

B.Sc. Ressource Management

Software Developer

Consultant for IT & Hydrology


What I will present

  • The problem: proprietary systems, fragmented data, low budgets
  • Our solution: a Django CMS engine that generates full REST APIs from JSON schemas
  • Technical architecture and design philosophy
  • Implementation journey and key experiences
  • Benefits for technical integration and stakeholders
  • Live demo of the deployed stack

Agenda

  • Problem & Motivation
  • Technical Requirements
  • Solution Architecture
  • Iteration Journey
  • Key Experiences
  • Core Features & API
  • Benefits Checklists
  • Live Demo

Problem & Motivation

  • Water quality data management is constrained by multiple challenges
use system
use system
Data Aquisition
Data Aquisition
Data Preparation
Data Preparation
Data Processing
Data Processing
Data Publication
Data Publication
Geographic
Geographic
Relational
Relational
Non Relational
Non Relational
Storage
Storage
Timeseries
Timeseries
Stream
Stream
Static
Static
Sensor
Sensor
Archive
Archive
Vector
Vector
Wiki
Wiki
Repo
Repo
TableField
TableField
Field Permutation
Field Permutation
Class
Class
Validators
Validators
Storage
Storage
Parameter
Parameter
Argument
Argument
Relation
Relation
Metadata
Metadata
Table
Table
Model Permutation
Model Permutation
Middleware
Middleware
GIS backend
GIS backend
Lifecycle
Lifecycle
Class
Class
Function
Function
Property
Property
Module
Module
Component Permutation
Component Permutation
Model
Model
Serializers
Serializers
Renderers
Renderers
Views
Views
Urls
Urls
Admin
Admin
Organization
Organization
Project
Project
Domain / Namespace
Domain / Namespace
Application
Application
Version
Version
Permissions
Permissions
Roles
Roles
Management
Management
Database
Database
create update delete
single field of
database table
(automation options)
create update delete...
create update delete
single table
as ORM class
(automation options)
create update delete...
manage and configure
components based on 
deterministic
presets
manage and configure...
manage multiple
projects as: 
+ service
+ repository
+ configuration template
manage multiple...
Standardized API
Standardized API
Text is not SVG - cannot display

Core Problems

  • Lack of technical and operational capacity
  • Proprietary systems run under high license fees and are not developer-friendly
  • Fragmented datasets bring new specifications with each new participant
  • Individual configurations vary per stakeholder, creating complexity
  • online and offline capabilities

Constraints

  • Low budgets and limited infrastructure constrain open-source adoption
  • Data ownership and privacy concerns compound the challenge
  • Data sources are spread across multiple platforms and systems
  • Data schemas can change and systems has to be updated accordingly
  • Same code must be deployed accross platforms (crossplatform architecture)

Technical Requirements

The system had to meet both technical and domain-specific standards:

Category Requirement
Development Best practices for software development
Compliance Integrate stakeholder & compliance requirements
Standards Geoinformation standards (OGC, GEOS)
Architecture Decentralized architecture
Operations Cross-platform operation
Integration Increase interoperability with other systems
Maintenance Maintainable codebase
🏗
QWERTYUIOPASDFGHJKLZXCVBNM123.0987654321
Android
TMUX
Browser
Android...
Network
API
Network...
Offlie Capabilities
Offlie Capabilities
Cloud Capabilities
Cloud Capabilities
Data Synchonization
Data Synchonization
Network
Local
API
Network...
QWERTYUIOPASDFGHJKLZXCVBNM123.0987654321QWERTYUIOPASDFGHJKLZXCVBNM123.0987654321
A
A
B
B
Cloud
Cloud
Tenant
Tenant
Text is not SVG - cannot display

Technical Requirements Cloud

  • we include all possibilities
  • we have configurations for any desired stage
  • We manage and provide oure platform with open source tools

Solution Architecture ... Design a system that writes a system

What we needed

A way to rapidly generate maintainable, standards-compliant backends without starting from scratch each time.

1

Decompose

Break Complicated → Complex → Simple Chunks

2

Generate

Build backends from data schemas (user-defined)

3

Integrate

Base functionality around a Deployment model

4

Autonomy

Versioning independent of any platform; zip-based deployment options

Organization Tree

Organization
  └── Project
      ├── Application
      ├── Domain
      ├── Namespace
      └── Deployment

Option: AI Integration

MCP server communicates with OpenAPI REST framework. Backend hosts flatpages for user-defined instructions and documentation.

Iteration Journey | What happened since early 2025:

I

Initial Phase

  • Searched for solutions, standards, and best practices
  • Identified key use cases
    • GEMS/Water
    • SDG632
    • SensorThings
    • HydroSHEDS
    • Basic Formal Ontology
    • Water Related Ontologies
II

Testing Phase

Cluster setup for open-source software testing. Collected solutions and analyzed dependencies.

III

Experimental Phase

  • Implementation of OGC / GEOS and geoinformation standards
  • Wrote PyPI packages and processed datasets:

Iteration Journey | What happened since early 2025:

IV

Workshop with WMO and CNR in Italy - multi tenant public cluster setup

  • online kubernetes cluster
  • pre installed applications and platforms for data science and development
  • ready to use notebooks and dependencies for fast prototyping of data schemas
  • integrated water quality management tools like qgis packages and mqtt endpoints
  • WMO partner api connection scripts
V

Prototyping Phase

Recognized bottlenecks → development process is highly inefficient per organization. Recurring problems needed automation:

  • Versioning and setup of code base
  • Individual configuration based on environment
  • Reusable code templates, dependencies, documentation, standards, processes

Key Experiences

Lessons learned from the iteration journey:

  1. It is hard to run, maintain, and future-proof systems from scratch — automation is essential
  2. Open source reuse pays off with proper preparation
  3. Do not solve every problem in one application — split into chunks
  4. Allow modifications and extensions in real time
  5. Enable multiple user interfaces, split into smaller independent chunks
  6. Maintain one parent backend as the blueprint for future child backends
OrganizationsProjectsApplicationsModulesTablesFieldsAppendix
Onboarding
Onboarding
WQDMS Tenant
WQDMS Tenant
Special Configs
Special Configs
Data Management / Processing
Data Management / Processing
Database Models and Tables, Lifecycle
Database Models and Tables, Lifecycle
Specify Database Fields and Relations
Specify Database Fields and Relations
General Configs
General Configs
Define Database Fields from CSV, XLMX, JSON, YAML 
Define Database Fields from CSV, XLMX, JSON, YAML 
Code Base Management
Code Base Management
Code Base Deployment
Code Base Deployment
Custom Module Renderer
Custom Module Renderer
Data Management
Data Management
Specifications
Specifications
Storage / Files / Static
Storage / Files / Static
User Interactions
User Interactions
Interface
Interface
New Tenant System based on User configuration -> Interoperable backend application
New Tenant System based on User configuration -> Interoperable backend application
Interface
Interface
Actor
Actor
Custom 
Service A
Backend
Custom...
standard endpoints
standard endpoints
DB
System
DB...
Custom 
Service B
Backend
Custom...
Custom 
Service C
Backend
Custom...
DB
System
DB...
DB
System
DB...
Actor
Actor
Actor
Actor
Text is not SVG - cannot display

Complicated → Complex → Simple Chunks → Reorganize to Complex → Bundle

Core Solution

How the code solves the challenge:

1

Declarative Schema-First (presetmodel)

Define Django models as JSON — fields, data types, parent classes, serializers, and viewsets. No Django boilerplate code needed. From schema → full REST API + admin + Swagger in one click.

2

EAV Model for Arbitrary Data Structures

Entity–Attribute–Value handles sparse, user-defined, and evolving data schemas at runtime — exactly what CSV, XML, and database schemas need without fixed design.

3

Deployment Model & Auto-Generated Scripts

Every deployment produces: cli.sh helm argocd Dockerfile docker-compose.yaml — ready to spin up anywhere.

4

Automated Git API

Programmatic creation and management of organizations and repositories — versioned independently of any platform, with zip-based deployment.

5

Pre-built Domain Libraries

PyPI packages for specialized domains: django-sensorthings django-hydrosheds django-ct-ontology — reuse without reinventing infrastructure standards.

6

Organization → Project → Application Architecture

Multi-tenant hierarchy: OrganizationProject (app, domain, namespace) → standalone or bundled zip downloads at every level.

Write a system that writes a system -> MONOTREMATA

The Solution: Monotremata Interface

The Monotremata. Our software solution design is inspired by these lovely creatures. That's why we named our package after it. It symbolizes that a system can consist of the best solutions that are available across species.

EIER LEGENDE WOLL MILCH DAX ENTE
EIER LEGENDE WOLL MILCH DAX ENTE
Is a Mammal
Is a Mammal
Lays Eggs
Lays Eggs
Lives in Water
Lives in Water
Is venomous 
Is venomous 
Sense of Electrolocation
Sense of Electrolocation
Duck-billed
Duck-billed
Beaver-tailed
Beaver-tailed
Cute
Cute
Furry
Furry
Text is not SVG - cannot display

picture and diagram from: https://ihp-itp.blogspot.com/2019/10/monotremata-ordo-mamalia-bertelur.html

Core API Resources

The generated backend exposes a REST API with these core endpoints:

Endpoint Purpose
GET /domain/ Logical grouping / metadata namespace
GET /namespace/ Npaces tied to domains
GET /organization/ Top-level organization container
GET /document/ document upload, download, process schema
GET /project/ Projects with apps and domain config
GET /application/ Application definitions
GET /presetmodel/ Declarative model definitions (className, classParent, fields)
GET /presetmodelfield/ Model fields (CharField, JSONField, GeometryField, etc.)
GET /deployment/ Deploy records (auth required)

Core Framework Resources

Django Project
Models & ORM
Serializers
ViewSets
REST Routes
Unit Tests
Management Commands
Settings
OpenAPI Specs
MCP AI (comming soon)
Forgejo: Git Platform
Linux
Python
Jupyter
Podman
Docker
Kubernetes
Argocd

Custom PyPI Packages

django-sensorthings  →  django-hydrosheds  →  django-ct-ontology

Technical Benefits Checklist

Integration

  • Basic setup for participants to onboard
  • Versioning system enabled
  • User Requirements Specifications for Endpoints
  • Dataset Up & Download multiple formats
  • REST API + OpenAPI specification auto-generated
  • OGC / GEOS geoinformation standards
  • Authentication built-in
  • GIS integration ready
  • Multiple database engines supported
  • PyPi integration (current dev)

Time & Cost Reduction

  • No code repetition — declarative schema only
  • Automated API endpoint generation
  • Auto-generated serializers & viewsets
  • Auto-generated OpenAPI/Swagger docs
  • Auto-generated unit tests
  • Zip-based deployment (no platform lock-in)
  • Reusable templates across projects
  • Reduced maintenance overhead

Benefits for Stakeholders, Developers & Data Scientists

🏢 Stakeholders

  • Lower total cost of ownership
  • No vendor lock-in — open source, zip deployment
  • Data ownership stays in-house
  • Open, auditable codebase
  • Compliance-ready with standards
  • Scalable across regions/organizations

💻 Developers

  • Write schema, get full Django project
  • Rest framework + admin panel auto-generated
  • CLI tools: setup, git, parser
  • Git API for automated repo management
  • Modular — split into independent chunks
  • Cross-platform architecture

📊 Data Scientists

  • Arbitrary/unknown property structures at runtime (EAV)
  • Data import/export: CSV, XML, XLSX
  • Flatpages for custom documentation
  • Jupyter Notebooks (coming soon)
  • AI integration via MCP server
  • Geospatial data support (GeometryField)

🔧 Operations

  • ArgoCD applicationset.yaml generated
  • Dockerfile and docker-compose auto-generated
  • Kubernetes-ready deployment
  • Independent versioning per deployment
  • Management commands for all common tasks

What's next ...

Real World Application

  • Publication on PYPI, Github, Codeberg
  • Produce reusable datasets for WESR Platform
  • Solve real problems with data schemas
  • Develope SDG632 data schema with community and integrate it in WQDMS
  • Develope WQDMS reusable and transparent projects for Stakeholders
  • Enhance WQDMS Software Ecosystem with the Monotremata tool
  • Integrate more Standards and Best-Practices in Monotremata project

Software & User Experience

  • Introduce software project to partners
  • Conduct Workshops with partners
  • Organize short and midterm events for user feedback
  • Organize IT resources for Infrastructure
  • Deploy Production Pipeline for Workshops
  • Quality Assurance
  • Refine and plan Enhancements
  • Refactor and Develope towards next version 1.0.1

What's next ... Timeline

enable participants to create backends around their data
enable participants to create backends around their data
iterate over existing backends, enhance and extend existing data schemas 
iterate over existing backends, enhance and extend existing data schemas 
Manage
Manage
collect published data
collect published data
Automation Processes
Automation Processes
Develope / Reuse
Develope / Reuse
Kick-Off / Short Term
Kick-Off / Short Term
Pilot Phase / Medium Term 
Pilot Phase / Medium Term 
Quality Assurance / Review and Planning
Quality Assurance / Review and Planning
Desired Results / Long Term
Desired Results / Long Term
Kick-Off / Short Term
Kick-Off / Short Term
National Backends
National Backends
Basin Backends
Basin Backends
Lake Backends
Lake Backends
River Backends
River Backends
Participant A
Participant A
Participant B
Participant B
Specialized / Individual Backend
Specialized / Individual Backend
Quality Assurance / Review and Planning
Quality Assurance / Review and Planning
Iteration possible
Iteration possible
extract
extract
unified datamodel from standard backends
unified datamodel from standard b...
Data
Data
Groundwater Backends
Groundwater Backends
Text is not SVG - cannot display

Live Demo Reference

Quick live demonstration of the deployed software stack:

Deployment Stack

Kubernetes
🡸
ArgoCD
Forgejo
🦔
Monotremata
  • Interface
  • CSV upload
  • Deployment

Let me show you the deployed system in action

The stack runs Monotremata as the parent backend with child backends generated
from deployment configs, all managed through ArgoCD on Kubernetes, source-controlled in Forgejo.

Thank you!

Questions?