From 50c080d5ef906c09861b6f8ab83667fdf8526437 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:50:45 +0000 Subject: [PATCH] Deployed 9cb4853 with MkDocs version: 1.6.1 --- .nojekyll | 0 404.html | 372 + api/index.html | 481 ++ architecture/index.html | 717 ++ assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.83f73b43.min.js | 16 + assets/javascripts/bundle.83f73b43.min.js.map | 7 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.el.min.js | 1 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.he.min.js | 1 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++++++ .../workers/search.6ce7567c.min.js | 42 + .../workers/search.6ce7567c.min.js.map | 7 + assets/stylesheets/main.0253249f.min.css | 1 + assets/stylesheets/main.0253249f.min.css.map | 1 + assets/stylesheets/palette.06af60db.min.css | 1 + .../stylesheets/palette.06af60db.min.css.map | 1 + deployment/index.html | 773 ++ images/architecture-back-end.drawio.svg | 295 + images/architecture-front-end.drawio.svg | 346 + images/architecture-system.drawio.svg | 216 + index.html | 412 + monorepo/index.html | 491 ++ search/search_index.json | 1 + sitemap.xml | 23 + sitemap.xml.gz | Bin 0 -> 241 bytes 56 files changed, 11404 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 api/index.html create mode 100644 architecture/index.html create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.83f73b43.min.js create mode 100644 assets/javascripts/bundle.83f73b43.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.el.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.he.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.6ce7567c.min.js create mode 100644 assets/javascripts/workers/search.6ce7567c.min.js.map create mode 100644 assets/stylesheets/main.0253249f.min.css create mode 100644 assets/stylesheets/main.0253249f.min.css.map create mode 100644 assets/stylesheets/palette.06af60db.min.css create mode 100644 assets/stylesheets/palette.06af60db.min.css.map create mode 100644 deployment/index.html create mode 100644 images/architecture-back-end.drawio.svg create mode 100644 images/architecture-front-end.drawio.svg create mode 100644 images/architecture-system.drawio.svg create mode 100644 index.html create mode 100644 monorepo/index.html create mode 100644 search/search_index.json create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/404.html b/404.html new file mode 100644 index 00000000..892ac96c --- /dev/null +++ b/404.html @@ -0,0 +1,372 @@ + + + +
+ + + + + + + + + + + + + + +The Mykomap API is used by front-end clients to interact with the back-end server.
+We define and implement the API using a lightweight library called ts-rest.
+The API is defined by the contract.ts
file in the
+@mykomap/common
library. In the contract, we list the API routes, including details about the
+requests (e.g. query parameters) and responses and their types (using
+Zod schemas).
In the front-end and back-end, we use the ts-rest
client and server libraries respectively. They
+consume the contract.ts
and provide fully type-safe API methods in Typescript, with runtime
+validation based on the Zod schemas.
From the contract.ts
, we can also generate an OpenAPI spec, using the
+generate-openapi
script.
We try to adhere to the Redux principle of having a single source of truth.
+We create a plain MapLibreGL component and use its API directly, rather than using a binding such as react-map-gl
. Although this
+ would integrate more nicely with React and Redux hooks, it adds overhead and we can't guarantee that the binding library will always be
+ maintained. Instead, we simply pass marker data and MapLibre click events through a MapWrapper React component. It is possible to avoid using a wrapper and
+ subscribe to the Redux store without React, but this would be more complicated.
All persistent data is stored on the back-end server as JSON files, in the following folder structure +as seen from the SERVER_DATA_ROOT location:
+├── datasets
+│ ├── some-dataset
+│ │ ├── locations.json (array of lng-lat coordinates for each initiative)
+│ │ ├── searchable.json (array of the property values and searchable strings for each initiative)
+│ │ ├── initiatives
+│ │ | ├── 0.json (full info of first initiative in the above aggregate JSONs)
+│ │ | ├── 1.json
+│ │ | ├── ...
+│ ├── other-dataset
+│ │ ├── ...
+│ ├── ...
+
+Additionally, for each dataset there's a config.json
. This contains config for displaying the map
+in the UI, including the vocabs (translations of data IDs), default sidebar panel, and popup
+appearance. This config is not generated into the above folder structure, but kept in source control
+in the @mykomap/config
library.
See the back-end test data
for example file contents.
The searchable.json
will be loaded into the back-end server's memory. Since there will be one row per item, with 100k items, every 10 characters adds a new megabyte. The really bulky bit is the text searchString part, so maybe it could be kept in its own plain text file, with one line per item. Searching it could be done by streaming it from disk, which avoids loading the entire file permanently into memory (for each dataset).
For instance, this SO thread has some sample stream-searching code, and a reference to a module which performs the streaming by what appears to be a fast non-buffering algorithm.
+These directories of JSONs, including the searchable strings in the searchable.json
files, need to be pre-generated by a script. This script will be written in JS/TS and live in the monorepo, to be run on the back-end server.
The script will take the full data CSV for a map (generated by the data factory) as inputs, and write the full data into the required JSON files in the directory structure specified above.
+We will need to manually copy the standard.csv
from the data factory server to the back-end. Maybe in the future, the data factory pipeline can be enhanced to write the JSON files to the back-end server so that no manual duplication is necessary (and maybe we can eventually get rid of the separate data server altogether). Or, the bacl-end server could be given a URL to the appropriate standard.csv
file(s) as published by the data factory and download it from there as part of a build-data
script (possibly when notified by a webhook, or possibly polling and checking the file modification date)
datasets
directory on server start, a dataset instance is created
+ by the Dataset service. Each Dataset instance has a:searchable
property, which is just the searchable.json
loaded as an in-memory objectgetItem
methodgetConfig
method, which includes the vocabsgetLocations
method, which returns a stream of the datasearch
method, which involves iterating through searchable
to find matching initiatives