Skip to content

An application to keep movements alive during self-isolation/lockdown.

Notifications You must be signed in to change notification settings

shapzka/heartbeat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

heartbeat

This is a hackathon PoC of an app that aims to keep movements alive and visible in times of lockdown. Users will be able to see a map of demonstrations for causes in their communities or around that world. Supporters will be able to register their heartbeat and help movements grow.

Development Setup

Golang

  1. Install Go (>1.11)

  2. Install MongoDB GoDriver

go get go.mongodb.org/mongo-driver
  1. Install Gorilla Mux
go get -u github.com/gorilla/mux
  1. Install Gorilla WebSocket
go get github.com/gorilla/websocket

React

  1. Install dependencies
cd ./client && npm install

Running the server

Start MongoDB locally and run:

cd ./server && go run main.go

Or pass a MongoDB URI to the server

cd ./server && go run main.go --db=<DB_URI>

Go to http://localhost:8080 in your browser.

Running the client

cd ./client && npm start

Testing APIs

Movements API

GET All Movements

curl -v http://localhost:8080/api/movements

Example Response:

[
    {
        "_id":"5e92d073035fc120f86d6462",
        "latitude":51.5074,
        "longitude":0.1278,
        "numberofparticipants":10,
        "summary":"testMovement summary",
        "title":"testMovement"

    },
]

POST Create Movement

curl -X POST -v http://127.0.0.1:8080/api/movements \
-d '{"title": "TestMovement","summary": "Power to the people.","latitude": 51.5074,"longitude": 0.1278}'

PATCH Vote for Movement

curl -X PATCH -v http://localhost:8080/api/movements/<id>/vote

About

An application to keep movements alive during self-isolation/lockdown.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published