-
Notifications
You must be signed in to change notification settings - Fork 31
Backend — Overview
The backend for the Giessdenkiez application consists of several services. At the heart of it we have an Application Programming Interface (API) written in Typescript running on a service called vercel.com that handles the communication with the Postgres database where the tree data and the interaction of the users is stored. The database is currently located on Supabase but could also be running on bare metal on your server, or on other services like Amazon Web Services (AWS) Relational Database Service (RDS), Google Cloud SQL, Microsoft Azure, render.com or Digitalocean, just to name a few possibilities.
User authenticating is handled via Supabase. To give the users the possibility to delete their accounts we have a secondary API, also running on vercel.com, that handles the communication with the Auth0's management API.
To store some additional files (the geojson that has all the trees locations and the rain data for vector tile creation on Mapbox our map provider) we use Supabase Storage.
Last we have two Python scripts (we call them harvesters) backed into Docker images. One that collects the information from Open Street Maps (OSM) about street pumps where people can get water. The other aggregates rainfall data from the Deutsche Wetter Dienst (DWD) in form of Radolan radar data and enriches the trees in our database with this information and also sends this via a S3 to Mapbox for the vector tiles. These are used in the mobile version of the application. These two scripts are run using GitHub actions on an defined schedule.
Below you can find a list of all our public repositories that contain the source code.
- Node.js (we recommend tools like nvm or asdf to manage versions)
- Git
- AWS CLI
- asdf
- Terraform
- vercel.com Account
- mapbox.com Account
- AWS Account
- GitHub Account
The instructions here are kept short. For some extended explanations see the README's from the referenced repositories.
Hint!: We use Terraform to maintain or infrastructure. This is optional. You can set this all up in the AWS console. Having all infrastructure as code makes it easier de develop, maintain and also to tear it down. If you like to use terraform, make sure to follow the AWS getting started guide to setup your credentials right and understand the underlying concept.
- Setup Mapbox
- Setup Supabase
- Setup Vercel (optional, for deploying the Frontend)
- Setup Pipedream (optional, for scheduling Github Actions)