<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Marc Duby on Medium]]></title>
        <description><![CDATA[Stories by Marc Duby on Medium]]></description>
        <link>https://medium.com/@marcduby?source=rss-f57d26da4972------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*flR6ZVnN72YgpnYYaGmFgA.png</url>
            <title>Stories by Marc Duby on Medium</title>
            <link>https://medium.com/@marcduby?source=rss-f57d26da4972------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 22:06:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@marcduby/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Foregoing offspring for the climate]]></title>
            <link>https://marcduby.medium.com/foregoing-offspring-for-the-climate-93c52e04818d?source=rss-f57d26da4972------2</link>
            <guid isPermaLink="false">https://medium.com/p/93c52e04818d</guid>
            <category><![CDATA[vasectomy]]></category>
            <category><![CDATA[life-decisions]]></category>
            <category><![CDATA[overpopulation]]></category>
            <category><![CDATA[childfree]]></category>
            <category><![CDATA[parents]]></category>
            <dc:creator><![CDATA[Marc Duby]]></dc:creator>
            <pubDate>Wed, 21 Apr 2021 06:32:36 GMT</pubDate>
            <atom:updated>2021-04-29T08:59:47.460Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Why choosing to live child-free and becoming a parent should be equally respected decisions</strong></h3><p>I am 33 years old and recently had a vasectomy. The reactions of those around me: many questions, little understanding.</p><p><em>By Marc Fehr</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HuaphRq2fsV4HrzX3NkjOg.jpeg" /><figcaption>For me it was clear early on: if children, then adoption. Now I decided on a life without offspring. (Photo: Peer Füglistaller)</figcaption></figure><p>October 2020, I’m sitting in a hospital bed, parked in a ward at Kingsbury Hospital in Cape Town. “This procedure is considered a permanent sterilisation, there is no guarantee that it can be reversed,” the urologist explains to me earnestly. “Do you consent?” After my firm “yes”, the doctor shifts his focus to filling in the final blank spaces on his form. “Well then, I’ll see you in the theatre [operating room] shortly.”</p><blockquote>This story was originally published in German by <a href="https://www.tagesanzeiger.ch/">Tages-Anzeiger</a>: <br><a href="https://www.tagesanzeiger.ch/warum-ich-keine-kinder-zeugen-will-587735430741">Warum ich keine Kinder zeugen will</a> (8 April 2021)</blockquote><p>I lean back in my bed and use the waiting time for a few minutes of self-reflection. I remember the many conversations in which I remarked: “No, I really don’t want any children”, and how I often was advised condescendingly: “Oh, you’re still young” or “Just wait, that will come”. Even when intentions are good, it’s the general assumption that people make that bothers me — that the romantic idea of ​​one’s own offspring is simply a question of time, not one that can be based on one’s personal ideals. So many people see the decision to have children as a marker of social maturity, the climax of life, a decision that one cannot, will not, regret. The reality is that I have never wanted children — and soon I won’t be able to reproduce myself anymore.</p><p>There are various factors that drove this decision, to name a few: I like my independence and active lifestyle; I believe that the planet is already overpopulated, and doesn’t need more humans added to it; I am concerned about the environment and climate change, and while I choose to eat meat, and take the occasional flight, I believe that not having children has a big impact on my environmental footprint.</p><h3>Questioning is not permitted</h3><p>The first ultrasound image of a foetus, shared between family and friends, is usually followed by reactions like: “Congratulations, I’m so happy for you!” or “… oh my gosh how exciting …”. The great, collective excitement begins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*664DaJKVkjGMHMty92dymQ.jpeg" /><figcaption>My partner Zoe, me and our van “Ed” during a recent trip to my home country Switzerland. (Photo: Marc Fehr)</figcaption></figure><p>I have rarely heard reactions such as “Are you really sure you want this?”, “Have you considered what this means for your future?”, or “Oh wow, are you feeling ok about this?” . If you announce a pregnancy, delight and goodwill are required. It is not socially acceptable to openly question this this decision, and demand a justification for it — and <em>that</em> bothers me.</p><p>Although I perceive parenthood to be a difficult and exhausting journey, everyone seems to generally equate pregnancy with happiness. Life. Joy. Determination. As parents, it’s socially taboo to speak openly about your parenting struggles, and about how challenging everyday life with children can be. If you deliberately decide to forego biological offspring, as I did, you are constantly expected to justify your decision. The traditional “family path” is firmly rooted in our basic social values. The question is: how appropriate is it today?</p><p>“Why is it believed that the decision to have children might one day not be equally regretted as the decision not to?”</p><p>For me, it’s increasingly inappropriate as I consider ways my personal decisions impact the future of our planet and society. As a measure to limit one’s own CO2 emissions, a consciously chosen child-free life is often frowned upon, classified as morally questionable or offensive. A pragmatic thought experiment: if I have a child, I cannot predict how many children will result from it. Thus, for every child I conceive, an unknown number of offspring could one day grow up, which is why I, in purely theoretical terms, have to attribute their emissions to myself. It is my responsibility.</p><p>If it comes to personal sacrifice for protecting the environment, we all set ourselves different priorities: some forgo animal products, many renounce fossil fuels, others may recycle as much as they can. The intrinsic motivation to keep a human habitat that is worth living in available to our offspring is noble. I am happy to join the mothers and fathers of this world in this: Let us take care of the planet. My biggest contribution: a life without biological children.</p><h3>There is a charge of egoism</h3><p>At age 33 I decided to give up the possibility of biological offspring. Here I am now, a couple of minutes away from my vasectomy, with no children, without ever having frozen or donated semen.</p><p>Years ago I decided to live a child-free life, but I was always advised (“You might regret that one day”) against a surgical procedure. Why is it believed that the decision to have children might one day not be equally regretted? Hardly anyone said “What a good idea” or “Thank you, that’s very considerate of you”. On the contrary, I have been accused of selfishness and misanthropy for my attitude. Is it really selfish when I openly and honestly speak out and say that I don’t want to spend my life raising children? That I can give my existence a meaning even without offspring?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FRy41sIEdZGDh7sU7RwVcA.jpeg" /><figcaption>Bouldering is one of our shared passions: My partner and I on a bouldering trip in Spain. (<em>Photo: Tatjana Baleta)</em></figcaption></figure><p>Conversely, I ask myself: Is it less selfish to insist on one’s right to have children, even though there are already too many people in the world? Does such a right even exist? I am thinking of same-sex couples, for example. For obvious biological reasons they are unable to reproduce through sexual intercourse. However, according to Swiss law, my home country, they are still not allowed to adopt children.</p><p>It’s different in South Africa, my chosen country of residence. It seems a common thing for same-sex couples to adopt children. This may be related to the fact that the social inequality and the number of children available for adoption here are much higher than in Switzerland, but I also believe that people here seem to think about this topic less conservatively.</p><h3>Pregnancy is a risk</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I-iHMf60SVYAAuIev0vzxQ.jpeg" /><figcaption>“I love children, but I don’t want to dedicate my life to them. I’d rather spend time doing things I really love, like, for example, bouldering.” –Marc (Photo: Zoe Duby)</figcaption></figure><p>I like children and I am good with them. As a teenager, I loved the Swiss <em>“Youth+Sports” </em>mountaineering guide courses, I looked after children in skiing camps and later financed my studies as a ski instructor with great pleasure. The carefree and inquisitive energy of children and young people inspires me. Although I’ve made a conscious decision to not become a parent at all, it had already been already clear by then: if children, then adoption.Firstly, because pregnancies involve great risks. They mean physical and mental strain for everyone involved. Will childbirth lead to complications? Will my baby be healthy?</p><p>Secondly, because I like the thought of being a father to a child who might otherwise not have the opportunities that I would be able to provide it with. And, thirdly, because a child not conceived by me would not have a negative impact on my own ecological footprint.</p><h3>“I wish that a ‘no’ to procreation will find more social acceptance”</h3><p>This topic may well always remain purely theoretical for me, as I currently have no plans to adopt children either. I must admit, the right question at the right time in my life might have altered that decision in earlier years. But today I am very satisfied with the path I have chosen. My partner and I feel comfortable with our decisions and enjoy our child-free life together.</p><p>In my mind I can hear the beer-fuelled discussions amongst the male peers of my youth: “A real man doesn’t get himself sterilised” or “Why would I care, I’m not the one who gets pregnant!”. But the amount of time and stress our female partners take on to ensure reliable contraception is often ignored. Taking hormonal drugs for years, for example, hardly seems to be a comparable alternative to me — after all, a vasectomy is such a small and in most cases even reversible procedure. The attack on the male ego seems much more dramatic to me, which is why vasectomy is rarely considered as a contraceptive.</p><p>I would like to emphasize, however, that I do not condemn those who have a heartfelt desire to have children or those who oppose children altogether. Nor do I judge the decisions of vegans, animal rights advocates, or climate activists. I only wish that we as individuals in this society are encouraged to make these big decisions in life more consciously. That the pressure to conform to a social norm, be it from parents, friends, or acquaintances, disappears. That choosing a life path without our own offspring will become less judged and more acceptable.</p><p>When, at the age of 27, I explained to my mother that I did not want to bring children into this world, she made it clear that she fully understood. My parents never put pressure on me. I was always allowed to be who I was and to become what I wanted. That, dear parents, is extraordinary and wonderful — I wish this freedom to choose to become a reality for all of your children and grandchildren.</p><p>I am now in the hospital theatre. “We’ll be injecting the local anesthetic, this will burn a bit,” the doctor explains to me calmly. The procedure itself is a bit like a visit to the dentist: First there is an injection, then, for half an hour, you don’t know exactly what is happening, and then it’s all over. “That’s it, please don’t ejaculate for the next ten days, and I’ll see you for a semen analysis in about two months time.”</p><p>Today I cannot say whether I will ever regret this half hour. What I do know, however, is that my ecological footprint will not outlive me. And that means a lot to me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dzVrytx9phza9EPZzAQXOA.jpeg" /><figcaption>Happiest around lots of animals — Zoe and Marc on a dog walk on the beach, only a couple of minutes from their home in Muizenberg. (Photo: Hanna Duker)</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93c52e04818d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build a fast and reliable community mapping tool with GatsbyJS and Firebase]]></title>
            <link>https://marcduby.medium.com/how-to-build-a-fast-and-reliable-community-mapping-tool-with-gatsbyjs-and-firebase-74a0fa6b5b83?source=rss-f57d26da4972------2</link>
            <guid isPermaLink="false">https://medium.com/p/74a0fa6b5b83</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[coronavirus]]></category>
            <category><![CDATA[maps]]></category>
            <category><![CDATA[gatsby]]></category>
            <dc:creator><![CDATA[Marc Duby]]></dc:creator>
            <pubDate>Mon, 23 Mar 2020 16:59:39 GMT</pubDate>
            <atom:updated>2020-03-30T06:30:24.738Z</atom:updated>
            <content:encoded><![CDATA[<p>What acrazy time to be alive. Following the coronavirus pandemic, I became aware how crucial a connected community can become once everybody has to stay in self-isolation.</p><blockquote><strong><em>About this project</em><br></strong><em> This community map has initially been </em><strong><em>developed by </em></strong><a href="https://medium.com/u/c344907bfb36"><strong><em>Simon Huwiler</em></strong></a><strong><em>,</em></strong><em> who works as a developer for the </em><a href="https://twitter.com/tagi?lang=en"><em>Zurich editorial team</em></a><em> at </em><a href="https://www.tages-anzeiger.ch/"><em>Tages-Anzeiger</em></a><em>, which is lead by </em><a href="https://medium.com/u/5e5f9dc7bf5b"><em>Mario Staeuble</em></a><em>. The map </em><strong><em>was built</em></strong><em> on the TA Interaktiv React Base which was designed and maintained by </em><a href="https://medium.com/u/dda946e2a579"><em>Kaspar Manz</em></a><em> for the </em><a href="https://interaktiv.tagesanzeiger.ch/"><em>Tages-Anzeiger Interaktiv Team</em></a><em> over the last couple of years. I’m utterly grateful for all money and time that has been spoken and invested to build this map tool––once it was published, I was granted access to the repository and </em><strong><em>transformed it into this open source GatsbyJS site</em></strong><em>––which I’ll explain to you in this article.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a1PRGivjXt8ASs0Ead9yVw.png" /><figcaption>An open source community mapping project for isolated times: <a href="http://www.whozinberg.org/">whozinberg.org</a></figcaption></figure><p>Having been a part for the <a href="https://interaktiv.tagesanzeiger.ch/">Interaktivteam</a> at <a href="https://www.tagesanzeiger.ch/">Tages-Anzeiger</a> in Zurich for a few years, their project called <a href="https://interaktiv.tagesanzeiger.ch/2020/zurich-liefert">“Zurich Delivers”</a> instantly caught my attention. Its main piece is an interactive map (I know, nobody likes interactive maps anymore), filled with home-delivery services available in Zurich:</p><h3>Let’s begin!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CpLr0CNJ_SEioS4qN9bstg.png" /><figcaption>The “Zurich Delivers” map that was created by the Interaktivteam in Zurich.</figcaption></figure><p>So far, so good. <a href="https://medium.com/u/19048b9bd971">Marc Brupbacher</a>, who is leading the Interaktivteam, justified the need for an interactive map on <a href="https://twitter.com/MarcBrup/status/1240568090884259841">Twitter</a>. <em>“We all need to support near-by services, that’s why we put together a map — even if I personally hate interative maps”.</em></p><p>I then started adapting the project for the needs in our small community in Muizenberg, South Africa, where we’re now just about to get ready to isolate against the coronavirus. This is the result: <a href="https://www.whozinberg.org/">https://www.whozinberg.org</a></p><p>The feedback inside the community was really good––what made me think that this should become an open source project, so other developers in other neighbourhoods can set it up themselves. And here we are––follow the tutorial and set up your own “Community Isolation Map”.</p><p><strong>What the map, what it is not:</strong></p><ul><li>It’s made for small communities––so it stays manageable for few people to run it, rather than having over-engineered solutions that get out of hands quickly.</li><li>It’s currently not optimal for finding help if someone is in need because it’s showing all the information on a map. I have the intention to build a “I need help” function soon, but this will be covered in a second tutorial.</li><li>It’s built on a solid foundation using free web technolgies and thus should be expendable in any direction you want it to go––and free to run.</li><li>It’s free for all––and here to help. Let’s support the communities!</li></ul><p><strong>The steps we’ll walk through:</strong></p><ol><li>Clone the repository from Gitlab</li><li>Install packages, get all up and running with Gatsby JS using Node</li><li>Create and configure a Google Firebase Realtime Database</li><li>Get your own token for the Map on Maptiler (we’ll use Mapbox GL)</li><li>Adjust map and content settings to fit your community</li></ol><p>Get your own copy by either cloning or forking the project from Gitlab:<br><a href="https://gitlab.com/marc.fehr/community-isolation-map">https://gitlab.com/marc.fehr/community-isolation-map</a></p><p><strong>Node environment</strong></p><p>Because I often ran into problems with different Node and NPM versions, I implemented a file called .nvmrc in the main folder of the project. If you have the <a href="https://medium.com/@faith__ngetich/locking-down-a-project-to-a-specific-node-version-using-nvmrc-and-or-engines-e5fd19144245">Node Version Manager (nvm)</a> installed, the first thing you should do, is</p><pre># Change into your projects folder<br>cd community-isolation-map</pre><pre># Set up Node to use the version defined in .nvmrc<br>nvm use</pre><p><strong>Install project dependencies</strong></p><p>I’m using yarn, but if you’re the npm kind of person, this will also work:</p><pre># Install using yarn<br>yarn install</pre><pre># Install using npm<br>npm install</pre><p>This will take a little while, but should work without any errors. If so, you’re ready to run into some trouble trying to start the Gatsby site!</p><p><strong>Starting up Gatsby JS (…or at least we try)</strong></p><p>You can now try to run, but you’ll see few errors in the gatsby-config.js. We’ll have to fix those first. But we see in the error, at least, that it’s about the gatsby-config.</p><pre># Start local development server<br>gatsby develop</pre><pre># Result:</pre><pre>We encountered an error while trying to load your site&#39;s gatsby-config. Please fix the error and try again.</pre><pre>TypeError: Cannot read property &#39;replace&#39; of undefined</pre><p>This file is in the main directory of your project (gatsby-config.js)</p><p><strong>The gatsby-config.js</strong></p><p>The first couple of lines can stay as they are for now, but you’ll eventually want to change the trackingId on line 40 to your own Google Analytics tracking project, if you want to use Google Analytics:</p><pre># Change to your own Google Analytics account<br>trackingId: &quot;UA-XXXXXXXXX-X&quot;,</pre><p>Then we’ll have a closer look to line 47 where it says</p><pre>databaseURL: process.env.FIREBASE_URL</pre><p>I am using these process.env variables to make sure that any sensitive credentials from services we’re using are never going to be published via Git. In the .gitignore file, you’ll see that there is a rule to ignore all files starting with .env, which is good.</p><p>Later, when you’ll deploy this website, the bots on Netlify (or Gitlab, or whatever service) will be given these variables––they won’t get it from your repository.</p><p>But if you’re working on your localhost, using <strong>gatsby develop</strong> like we just tried, you can write all these .env variables into a file you’ll have to create yourself now. It should be called <strong>.env.development</strong></p><pre># Create new file in the main directory called<br>.env.development</pre><p>Now define all the variables you will need for this project, like this, in your .env.development file:</p><pre>FIREBASE_URL=<br>FIREBASE_TYPE=<br>FIREBASE_PROJECT_ID=<br>FIREBASE_PRIVATE_KEY=<br>FIREBASE_CLIENT_EMAIL=<br>FIREBASE_CLIENT_ID=<br>FIREBASE_AUTH_URI=<br>FIREBASE_TOKEN_URI=<br>AUTH_PROVIDER_X509_CERT_URL=<br>CLIENT_X509_CERT_URL=</pre><p>That’s it for now, let’s go online to set up a database.</p><p><strong>Firebase Realtime Database</strong></p><p>Go to <a href="https://firebase.google.com/products/realtime-database">https://firebase.google.com/products/realtime-database</a> and sign in with your Google Account. Set up your own Firebase Realtime Database by clicking “Go to Console’” (top right of the window), or click <a href="https://console.firebase.google.com/u/0/">here</a>. Start with “add project”, give it a name and click through the steps. You can decide whether you want the database to be linked to any of your Google Analytics accounts or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2EXneNQw_JaS1JCKthMtkg.png" /><figcaption>Once your database is ready, click continue..</figcaption></figure><p>On the left hand side, click on Database, then choose Realtime Database and click “Create Database”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LppNZbZFq2ptMfm1e192tQ.png" /><figcaption>Click on Database (left) then “Create Database” under Realtime Database.</figcaption></figure><p>You can start in “locked mode” for now, and then go to “Rules” to adjust the security settings as follows, and press Publish:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AdzOefu9K3KluQvRQKVHKg.png" /><figcaption>This is not the most secure option, but let’s talk about this later. Set “.write” to true.</figcaption></figure><p>Go back to the Data tab, and enter any random value to where it says <strong>null</strong>, otherwise the database will be deleted [because it is empty]:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*gjgEYzrWZhNYtlvH1CAMTw.png" /><figcaption>Add something where it says <strong>null</strong> to make sure the database will not be deleted.</figcaption></figure><p>Also, take the URL just above that and add it to your local <strong>.env.development </strong>file as <strong>FIREBASE_URL:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*RSjdiGrBkbEkFY84dRJHsw.png" /><figcaption>Copy this URL as your FIREBASE_URL in your .env.development file.</figcaption></figure><pre>FIREBASE_URL=<a href="https://whozinberg.firebaseio.com/">https://whozinberg.firebaseio.com/</a></pre><p>Next, click on the settings wheel, top left, and choose “Users and permissions”, to create a user that can later access the data in Gatsby via GraphQL:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jb_xNOQGyoFWPE_anlNfqg.png" /><figcaption>We’ll create a user for our GatsbyJS site to grab the data.</figcaption></figure><p>Go to “Service Accounts”, and click on “Generate new private key”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dfh0vJljkcbOA1x94pd5PQ.png" /><figcaption>Generate key for Service Account by clicking the blue button.</figcaption></figure><p>Confirm, and your browser will download a .json file with your credentials. This is how it looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q8ejqbzveC971gIvC-jl6Q.png" /><figcaption>Firebase credentials .json file.</figcaption></figure><p>Go ahead and copy-paste the values from this file into the .env.development file we created earlier. The first line was already filled few steps before. Make sure you don’t forget anything, save. Important: Don’t copy the “, only the bare values, without anything.</p><p>Last step, we import some example data into our database, just to make sure that the Gatsby JS project will find some data, otherwise it will throw an error. Take the file from your repository in ~/src/data/exampleData.json or download it from <a href="https://gitlab.com/marc.fehr/community-isolation-map/-/blob/master/src/data/exampleData.json">here</a>.</p><p>In Firebase, click on Import JSON, choose the testData.json file, and confirm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L1iIgIWttTd_Rh8ruV-leQ.png" /><figcaption>You can import any valid JSON file into Firebase. Use exampleData.json to import a first data point.</figcaption></figure><p>Voilà, this is how your database now looks. Please note, importing JSON does always <strong>overwrite</strong> the database. Make sure you exported the JSON before in case you will need it again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fIttSGUE0UeBtuSwWX11wA.png" /><figcaption>This is one entry in your database, imported as JSON.</figcaption></figure><p>Note: As you see, this entry has <strong>approved: true</strong>, but later, new entries will be entered with <strong>approved: false</strong>. This is how you will have control over which entries are online, and which are not. All those who are set to <strong>approved: true</strong> will be visible after a next deploy of the website.</p><p><strong>Start Gatsby Localhost again</strong></p><p>Now you’re ready to give Gatsby JS another go. Back in your terminal, go to the main folder of your project, and</p><pre># Start Gatsby development server<br>gatsby develop</pre><p>And, besides few es-lint warnings, you should see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*btTTrEdZ22b7QI5uwLstHQ.png" /></figure><p>Go and check <a href="http://localhost:8000/">http://localhost:8000/</a> in your browser, and you should see one first data point on the map:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YfE8WGsz3xTL8N2n11_71w.png" /></figure><p>That’s it, you did it! Now, let’s try to also add a new point to the database. In your browser, click on the link “Add more information to the map” or add /add to the url like: <a href="http://localhost:8000/add">http://localhost:8000/add</a>––activate the map, set a point, fill in some data, and click “Send form”.</p><p>And, as you can see, my data has been saved in my database — there are now two entries:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vtCH5xK06JbIsKVmGuj7hg.png" /></figure><p>And, as mentioned before, the new entry does have the <strong>approved: false</strong> state.</p><p><strong>Maptiler Access Token</strong></p><p>The repository is shipped with some Maptiler keys, but please don’t use those. Every project should have its own <em>Maptiler </em>Access Token.</p><p>Go to <a href="https://docs.mapbox.com/help/how-mapbox-works/access-tokens/">M</a>aptiler, create an account, login, and create a key (under “keys”, left hand side under “Account”). Copy this key and replace it in your repository. <em>Hint: You can also restrict access to your key by adding the domains the traffic is allowed to come from.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1sxmGhHCgNzxSHJ_omW9wg.png" /><figcaption>Create your own account on Maptiler and get a Key for your app.</figcaption></figure><p>In your repository, go to ~/src/data/map-styles.js and add the token to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qA0_oCO8hlr36787So8EYg.png" /></figure><p><strong>Adjust the app to your needs</strong></p><p>Now it’s all about finding out what your community needs. You can start with changing all the details about the project in gatsby-config.js, play around with the ~/components/categories.js (and the categories.css), or whatever.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1y91GSqZVR1P7WOKoCL0Xg.png" /></figure><p><strong>Update:</strong> Also, make sure you set the boundaries for your neighbourhood correctly. Check the file gatsby-config.js in the main folder to set the boundaries for the map itself. Further, go to:</p><pre>~/src/data/reverse_cpt_boundaries.js</pre><p>… and adjust the mask that’s overlaying the map. It’s done with the “turf” npm package, you can drop any valid geoJSON polygon and it will be automatically inverted and used as a map overlay. In the example, it’s simply a rectangle that masks everything but the Muizenberg area in Cape Town:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9VhfO7GtWNBgxsrkWFZtw.png" /><figcaption>Masking a polygon on your map with the turf npm package in ~/src/data/revers_cpt_boundaries.js.</figcaption></figure><p><strong>Deploy the website to Netlify</strong></p><p>Now it is all running on your localhost, but it’s not on the interwebs, yet. To do so, you’ll have to create a new repository on <a href="https://docs.gitlab.com/ee/gitlab-basics/create-project.html">Gitlab</a> (or Github), push the whole project folder up.</p><p>Then, sign up on Netlify, a platform for hosting static websites. Netlify has got a free tier, you’ll be given 100GB traffic each month without paying. Which I think is amazing.</p><p>On Netlify, start a new project, link it to your Gitlab (or Github) repository. Click “New Site from Git”. Go through the steps, set the master branch for triggering deploys. <strong>gatsby build</strong> as deploy action and public/ for the directory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JuVoxxdZjacUEz_Ijo3gMg.png" /><figcaption>Settings on your Netlify project.</figcaption></figure><p>Netlify is now deploying your site from your Git repository. And, it will re-deploy it after every push to the master branch. But for now, the first build will fail — because we didn’t specify our .env variables on Netlify. To do so, go to Settings &gt; Build &amp; Deploy &gt; Environment, and add all the variables you have inside the local .env.development file. Netlify will use these while building your page, but people won’t ever see them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ubzG0SXzeUMKXSbK22wHnw.png" /><figcaption>Add all the environment variables to Netlify so it can grab the Firebase data while deploying your site.</figcaption></figure><p>Go back to deploys, and trigger a re-deploy of your site, after all environment variables have been declared:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mHgS87aYeZuVJidOnWEUWQ.png" /><figcaption>Trigger a re-deploy of the Netlify site.</figcaption></figure><p>Once Netlify is done, you’ll se an URL for your project. Go, check it out. You can now even add custom domains to Netlify (point your nameservers there or add CNAME DNS entries to your hoster), and also use free SSL certificates.</p><p>This is now online. Well done! Every new entry will have to be approved manually in Firebase. Go to your Firebase database view, check through the new entries, and if you want them on the map, change the <strong>approved: false</strong> to <strong>true. </strong>Once done, re-deploy your website, and Netlify will grab a new set of data from Firebase.</p><p>Again, every push to the master branch on Gitlab (or Github) will also trigger a deploy. Always make sure that the deploys don’t fail, otherwise you’ll not see the updates :)</p><p>Thanks for sharing — let’s help our local communities! Any feedback on this is very welcome.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qbsa4NtJ2p3Sl8Z59qsdCw.png" /><figcaption>The end result of the map.</figcaption></figure><p><strong>Spread the map––further instances I know of</strong></p><p>Thanks to the open source community <strong>❤ </strong>for adapting this community map for their local neighbourhoods. Check out these amazing projects:</p><p><strong>St.Gallen hilft</strong>––<a href="https://helfen.sg/">https://www.helfen.sg/</a></p><p><strong>Zizers hilft!</strong>––<a href="https://zizers-hilft.netlify.com/">https://zizers-hilft.netlify.com/</a></p><p><strong>Zäme starch</strong>––<a href="https://zaemestarch.ch/">https://zaemestarch.ch/</a></p><p><strong>Chur hilft Chur</strong>––<a href="https://churhilftchur.ch/">https://churhilftchur.ch/</a></p><p>––If you build one, too, let me know! Stay safe everyone!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74a0fa6b5b83" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>