Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/technologiestiftung/zms-supabase

Supabase backend and db setup for the ZMS project
https://github.com/technologiestiftung/zms-supabase

Last synced: 30 days ago
JSON representation

Supabase backend and db setup for the ZMS project

Awesome Lists containing this project

README

        

![](https://img.shields.io/badge/Built%20with%20%E2%9D%A4%EF%B8%8F-at%20Technologiestiftung%20Berlin-blue)

[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)

# ZMS Bürgeramt Prototyp Supabase Backend

This is the backend for the ZMS Prototyp Bürgeramt project.

## Prerequisites

- Docker
- Supabase Account
- Supabase CLI

## Installation

1. Clone the repository
2. Run supabase start

## Usage or Deployment

1. Link to existing supabase project or create a new one `supabase link --project-ref 123qwertz`
2. Start the local database `supabase start`
3. Push the local state to the remote

## Realtime

To make realtime subscriptions to the tables work you need to run this sql query in the database:

```sql
-- See https://supabase.com/docs/guides/realtime/postgres-changes
BEGIN;
-- remove the supabase_realtime publication
DROP publication IF EXISTS supabase_realtime;
-- re-create the supabase_realtime publication with no tables
CREATE publication supabase_realtime;
COMMIT;

-- add a table to the publication
ALTER publication supabase_realtime
ADD TABLE processes;

ALTER TABLE processes REPLICA IDENTITY
FULL;

```

## Cron Jobs for score Computation

Adding the cron extension [to the migrations](supabase/migrations/20221005135333_cron.sql) did create some errors in local development. To fix this, the following steps are necessary:

When you have a remote database running got to the database settings under `https://app.supabase.com/project//database/extensions` and enable the cron extension.

Then run the following SQL query in the database:

```sql
SELECT
cron.schedule ('update processes scores every minute', '* * * * *', $$
SELECT
public.compute_scores () $$);
```

This creates a new cronjob that runs the function `public.compute_scores` every minute.

## Development

## Tests

## Contributing

Before you create a pull request, write an issue so we can discuss your changes.

## Contributors

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):



Fabian Morón Zirfas
Fabian Morón Zirfas

📖 💻 🎨 🚇 🤔
Lucas Vogel
Lucas Vogel

📖 🤔 👀 💻
Ingo Hinterding
Ingo Hinterding

📖 🤔 👀

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

## Content Licencing

Texts and content available as [CC BY](https://creativecommons.org/licenses/by/3.0/de/).

Illustrations by Maria Musterfrau, all rights reserved.

## Credits



Made by








A project by








Supported by







## Related Projects