DEV Community

Marco
Marco

Posted on

Coronavirus

Today is the sixth week of lock down in Italy because of covid. We are not allowed to go out without a valid reason (i.e. health, food shopping or necessary onsite work). Let me tell you that it sucks. Unfortunately, the lock down will last at least until the first week of May.

A common problem is food shopping. There is no shortage of food, but staying in a queue in a supermarket is not ideal if you want to avoid contagion. So many people are looking for home delivery services.

Big supermarkets offering this sort of service are stuck. They increased their offer, but, understandably, they cannot do much. Small local shops are working better and many started to offer home delivery.

There are several apps and maps listing shops offering this service. Since I have not found an open source app, I built one. It does not make sense to implement the same thing several times.

It is a simple React app that lists shops and farms offering home delivery service. Here is a version with some real data released by the province where I live. There are a few bugs, but it works decently.

The code is aGPL, so you can take it, change it and use it freely for your country, town or neighborhood. You need just a list of shops in JSON and a i18n file for your language. It is 100% static and works also on Github pages.

I wanted to build something that could work also during a zombie apocalypse. Very low tech, no complex infrastructure required, no Internet necessary.

At the beginning, I was going to use GCP for hosting and backend services. Then, I had some problems with my credit card on Google. I called their support, but they are slower than usual because of Covid. At that point, I realized that advanced technologies (GCP is a very interesting piece of machinery!) are fragile. So I refactored the code in such a way that it could work even offline (thanks to nextjs).

So you may argue that I should not have used React, since React is not exactly low tech. Some static HTML generated by a dump script would have been more resilient. Probably, you are right. There are two reasons why I used React. The first one is that I already had a React app with a GraphQL data layer that I was going to deploy on GCP. The second reason is that, ideally, I would like to build something useful even after the epidemic is over.

We changed our habits and discovered new living styles. This is not necessarily bad. The supermarket model is a social and environmental pest. If we can find alternatives to the supermarket, it would be better for humanity. So maybe there is something we can learn from this experience. How can we continue to buy local and build social bonds with our neighbors even after the crisis is over?

I do not have answers, but let me know what you think in comments!

Top comments (0)