This repo is deprecated and will be archived. All Supabase config for giessdenkiez.de is now located in the giessdenkiez-de-postgres-api repository.
Running the giessdenkiez.de stack on supabase. WIP please ignore.
- Supabase account
- Docker
- Supabase CLI installed
- Clone this repo
- install dependencies with
npm ci
- Login into supabase with
supabase login
- Create a project on supabase.com
- Configure your GitHub actions to deploy all migrations to staging and production. See .github/workflows/deploy-to-supabase-staging.yml and .github/workflows/deploy-to-supabase-production.yml for an example. We are using actions environments to deploy to different environments. You can read more about it here: https://docs.github.com/en/actions/reference/environments.
- Needed variables are:
DB_PASSWORD
PROJECT_ID
SUPABASE_ACCESS_TOKEN
- Needed variables are:
- (Not recommended but possible) Link your local project directly to the remote
supabase link --project-ref <YOUR PROJECT REF>
(will ask you for your database password from the creation process) - (Not recommended but possible) Push your local state directly to your remote project
supabase db push
(will ask you for your database password from the creation process)
if you want to use the DWD Radolan harvester you need to prepare some data in your database
- Update the table
radolan_harvester
with a time range for the last 30 days
INSERT INTO "public"."radolan_harvester" ("id", "collection_date", "start_date", "end_date")
VALUES (1, (
SELECT
CURRENT_DATE - INTEGER '1' AS yesterday_date),
(
SELECT
(
SELECT
CURRENT_DATE - INTEGER '31')::timestamp + '00:50:00'),
(
SELECT
(
SELECT
CURRENT_DATE - INTEGER '1')::timestamp + '23:50:00'));
- Update the table
radolan_geometry
with sql file radolan_geometry.sql This geometry is Berlin only. - Populate the table radolan_data with the content of radolan_data.sql
This process is actually a little blackbox we need to solve.
- Run
supabase start
to start the supabase stack - Run
supabase stop
to stop the supabase stack (all changes not included in a migration will be lost) - make changes to your db using sql and run
supabase db diff --file <MIGRATION FILE NAME> --schema public --use-migra
to create migrations - Run
supabase gen types typescript --local > ./scripts/db-types.ts
to generate typescript types for your db
- Run
npm test
to run the tests
Before you create a pull request, write an issue so we can discuss your changes.
Thanks goes to these wonderful people (emoji key):
Fabian Morón Zirfas 📖 💻 🚇 |
||||||
|
This project follows the all-contributors specification. Contributions of any kind welcome!
Made by
|
A project by
|
Supported by
|