Skip to content

redis-developer/RedisResourceMap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RedisResourceMap

COVID-19 Resource Dashboard is a project leveraging the power of Redis Search, RedisGears, and Redis PubSub to create a live-updating, crowdsourced dashboard to connect places with excess supply of masks, oxygen, and vaccines to places lacking in such supplies. Users can add locations to indicate both excess supply and required resources, and the RedisGears matching engine will utilize the power ofRedis Searchgeospatial querying to match up supplies with requirements.

How data is stored

  • Resource and location data are stored as documents in theRedis Searchformat. They contain the fields:
    • masks (Numerical)
    • vaccines (Numerical)
    • oxygen (Numerical)
    • updated (Numerical)
    • coords (Geo)

How data is processed

  • Data is inserted (asRedis Searchdocuments) using the HSET command. Details on query construction are abstracted away with the Redis Search Python API, but the fields are as mentioned above
  • Data is queried using FT.SEARCH:
    • Since this uses geospatial querying, heavy use of GEORADIUS/geospatial query syntax is used
    • Example query: FT.SEARCH @coords[long lat radius km] FILTER masks 1 10000 INKEYS 1 -76,40
  • Update are published with PUBLISH and read with SUBSCRIBE
    • New data is processed with RedisGears async jobs, and sent via Redis PubSub on either the new_data channel or match_data channel (if a resource is matched)
    • Example: PUBLISH new_data "{masks: 10, ...}", SUBSCRIBE new_data

Screenshots

Architecture Diagram

Architecture

Main Page Match graph

Instructions

  • Run the Redis labs RedisModules docker image: docker run -p 6379:6379 redislabs/redismod
  • Using pip and python 3.7, install the requirements in requirements.txt, or create a Conda environment using conda env create --file conda_env.yml and then run conda activate redis to activate the environment.
  • Run python server.py from backend/. This will create a server accessible at localhost:5000
  • Install node.js and npm if you do not already have it installed (see https://nodejs.org/en/download/). Then run npm install and npm start from frontend/, and the React frontend should appear in your web browser at localhost:3000/admin/dashboard

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 45.3%
  • SCSS 38.9%
  • JavaScript 11.9%
  • Python 3.1%
  • HTML 0.8%