g0v / vaccinate

vaxx.tw is a tool to find COVID-19 Vaccine Appointments near you
http://vaxx.tw
MIT License
33 stars 20 forks source link

Explore serverless deployment #53

Open kevinjcliao opened 3 years ago

kevinjcliao commented 3 years ago

On-prem management is exhausting and we don't need it. @yorkxin is exploring alternatives.

yorkxin commented 3 years ago

I'll start with automated deployment, then see if it's possible to run without server.

yorkxin commented 3 years ago

Now that people are trying to figure out what features will be necessary in the foreseeable future, I think it's better to think conservatively in terms of architecture -- maybe we will still need a server. Although for now all the data I can imagine are static-ish and can be refreshed periodically.

yorkxin commented 3 years ago

Ok, at least I got the scraper working on GitHub Actions now. It produces a JSON and pushes to gh-pages branch (which can eventually be merged into React.js front-end code)

The next challenge is to extract static code and deploy to GitHub Pages:

  1. All the React.js code can be generated and deployed statically (easy)
  2. Replace GET /hospital endpoint with a JSON that is a combination of hospitals.csv and availability.json. (hard)
    • This also removes the requirement of Redis to store availability info.
  3. Alternatively, if we can turn hospitals.csv into hospitals.json then let the frontend to merge & display two dataset, then it'll be easier to manage data. hospitals.json can be generated as a part of static site generation. Its change rate is much less than availability.json.

https://github.com/yorkxin/vaccinate/blob/gh-pages/data/availability.json