/webclient

Web client providing different views including a map of events.

Primary LanguageClojureMIT LicenseMIT

We Feed Us

Motivation

This repository contains a prototype mapping app for the global food system. The goal of this project is a global, comprehensive, open source mapping of our food supply chains including the demand side. From comparable past economic crises such as the great depression of the 1930s we can predict market failures in allocating essential goods in the next months not just in poor countries. Compared to the 1930s most of our goods depend critically on international supply chains and hence our chronic lack of international governance bodies that can intervene to coordinate national efforts against market failures render us arguably worse prepared than the nation states of the 1930s.

Signs of the market failures are already visible as ripple effects popping up as food dumps and destruction in the media, besides the horrific messages about pending hunger catastrophies in poor countries such as India, East African states or parts of Latin America. As the economic downturn of the global economy sharpens the effects on supply chains become very hard to predict even for corporate actors. By explicitly mapping supply and demand of food related goods we want to facilitate direct allocation and interventions through governance bodies and direct collective coordination to minimize food shortages. A systematic effort to quantifying the goods flowing through our global economy is therefore required. This project is about providing tooling for such efforts.

Preconditions

  • Contributors care about food security and do not want to blindly trust that this crisis is managed well by some people without having public transparency.
  • Contributors want to coordinate globally to map food supply chains.
  • Technical contributors have access to a Unix machine with node.js support and are willing to setup a shadow-cljs workflow. To run the server they need to have leiningen and a JDK >= 8 installed.

Postconditions

  • We have a set of publicly available services at hand to map food supply chain information and do quantitative account to ensure integrity of the supply chain.
  • We have not let millions of people starve because of a lack of coordination and the ignorance of the media bubbles in first world countries.
  • We have collected crucial information to tackle the biggest problems of the 21st century such as climate change.

Target audience

This is an early effort, yet the urgency and uncertainty of the situation convinced us to push as much as possible while iteratively rethinking on the way. We cannot yet expose this tool to a large audience, but we want to make it accessible as soon as possible. If you have constructive or critical suggestions please join our chat or open an issue here. Our tooling is deliberately not aimed at direct automation, e.g. firehosing news sources onto the map, since this will obscure how the tools will be used. Instead we need to figure the processes out with our community of users (read: you! :) ). We have experience in building scalable systems and will be able to scale up quickly once we know what we need. In particular we are able to provide modern economic tools for compositional game theory, probabilistic simulations and planning. To get to a state were we can benefit from this technology we need to systematically measure and quantify what is going on though. If you think this is a good investment of your time in these “interesting times”, join us!

Technology

We will provide P2P real time streams on our horizontally read scalable database technology. We are in the process of creating a globally addressable registry of such databases which track important public information in form of knowledge commons. If you are interested in providing such a database, please open up an issue here.

We use the pragmatic functional programming language Clojure which emphasizes short feedback cycles and interactive development. To setup an interactive development environment for this web frontend, please take a look at shadow-cljs.

This prototype uses datahike-server as a backend, which will probably be replaced by a dedicated backend with geo indexing support in the next iterations.

You need to clone the datahike server repository and run it locally by executing

lein run

in the cloned directory.

To build the static fields for the frontend you have to clone the repository and then run the following commands in the directory:

npm install
npx shadow-cljs compile app

Any static web server will do it. If you have Python installed you can start a simple web server:

cd resources/public && python -m http.server 8080

To build an optimized, bundled release run:

npx shadow-cljs release app

Development log

Load leaflet

Roundtrip basic markers

  • TODO fix bug in result serialization

Input form for marker

Selection UI

  • range selector cannot show full date in label
  • so we just use date selectors for now
  • filtering happens client-side right now
  • this will require adaptation once we have more data

Highlight supply and demand markers

  • requires custom marker designs with CSS

Add tag browsing support

Deploy first iteration

Define name

  • We Feed Us for now, problem is WeFeedUs Inc.
  • Plan B is next stage

Add Telegram Chat

Check UI roundtrip

Tune optics

Factor static project

Build instructions
  1. npm install
  2. npx shadow-cljs compile app
  3. cd resources/public && python -m http.server 8080
  4. npx shadow-cljs release app

Push static files

Add at least 20 markers all over the globe

Open Issues

Copyright © 2020 Christian Weilbach and contributors

Distributed under the MIT license.