2.5 KiB
GeoPub Architecture
This document describes the high-level architecture and ideas of GeoPub from the perspective of developers.
GeoPub is an Web application written in the OCaml programming language. The OCaml code is compiled to JavaScript via js_of_ocaml.
Functional Reactive Programming
GeoPub uses the React library for functional reactive programming.
UIs are in general not returned as static HTML elements, but as a time varying signal of HTML elements.
Components
GeoPub is organized into various smaller components. Components handle specific functionaity and may hold state. Components interact with each other over some clearly defined interface and should be as loosely-coupled as possible.
We use the archi library to manage components.
The system (collection of components) is started from the main.ml
module.
Ui
The user-interface of GeoPub. This listens for changes in the router view and loads the appropriate view to the DOM.
Router
Listens for changes in the navigator location.
Database
Store RDF data in an IndexedDB database.
Provides a Dataog interface for querying the database. Results are returned as signals (see section on functional reactive programming above).
Sample_data
Loads initial sample data.
User
Manages the user session, i.e. an user interface for an XMPP connection.
Inspector
Provides a view of RDF data.
Geopub_map
Handles the Leaflet map. As Leaflet does not provide a functional interface this component holds state so that the map appears functional to the rest of GeoPub.
Note: this is not called Map
to avoid clash with the OCaml standard library Map
.
Xmpp
XMPP functionality.
Xmpp.Connection
Manages the underlying XMPP connection.
Xmpp.Entity_capabilities
Handles entity capability requests. This is necessary to receive XMPP PubSub notifications.
Xmpp_rdf
Reads all incoming XMPP stanzas and attempts to parse RDF data from them. If some RDF data can be parsed it is added to the database.