SupaDB
Connect and play with Supabase REST API / Graphql easily Free • Open Source
? Features
- ? Free
- ? Unlimited API Request
- ? Alowed to use on other project
? About The Project
This is my Supabase Bring the Func(?) Hackathon 2022 submission!
SupaDB allows user that wanted to play with Supabase REST API/Grahql easily without having to manually seed the database.
SupaDB also allows Frontend Developer that wanted to focus on design to easily fetch the data without worrying about CORS stuff.
Architecture
Insert/Update Data
- CRON Job by GitHub action
- Vercel Serverless to scrap data
- Upsert data into Supabase Database
Fetch Data
- Create custom secret for every user
create or replace function generate_secret ()
returns text
language plpgsql
as
$$
begin
return substr(md5(random()::text), 0, 25);
end;
$$
-
Wrap the secret in JWT token, set as Authorization Key in header
-
RLS to verify secret token exist in request
create or replace function auth.verify() returns text as $$
select coalesce(
nullif(current_setting('request.jwt.claim.secret', true), ''),
nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'secret'
)::text
$$ language sql stable;
? Built With
? Local Development
Prerequisites
Yarn
-
npm install --global yarn
Development
- Clone the repo
git clone https://github.com/zernonia/supadb.git
- Install NPM packages
yarn install
- Run Development instance
yarn dev
➕ Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
? License
Not Associated with Supabase.
Distributed under the MIT License. See LICENSE
for more information.
? Contact
Zernonia – @zernonia – [email protected]
Also, if you like my work, please buy me a coffee ☕?