Git Product home page Git Product logo

supa-image-generator's Introduction

Supabase image generator with Kobble

License Status

This example SaaS project demonstrates how to build a simple SaaS with Kobble and Supabase.

  • Supabase is used for the database and server side code execution (using edge functions).
  • Kobble is used for authentication and monetization.

Deploy with Vercel Preview

Getting Started

Using npm in your project directory run the following command:

npm install

Compile and Hot-Reload for Development

npm run dev

Configure Kobble

Create an Application in your Kobble Dashboard.

Make sure your application can handle your localhost callback URL (see section below).

Note the Client ID and your Portal Domain values.

Update environment

Copy the .env.example file to .env and update the values with your Kobble Application details.

cp .env.example > .env

Example:

VITE_KOBBLE_DOMAIN=**********
VITE_KOBBLE_CLIENT_ID=**********
VITE_KOBBLE_REDIRECT_URI=http://localhost:5173/callback
VITE_SUPABASE_URL=**********
VITE_SUPABASE_API_KEY=**********

Configure Supabase

Create a new project on Supabase.

Add the correct RLS policies to the tables and storage (docs coming soon).

Asks us for more details if you need help.

Allow user's images read access

create policy "read user images" on "public"."Images" as permissive for select to authenticated using ((request_user_id() = user_id));

Allow service_role (edge function) to persist images

create policy "insert images from service_role" on "public"."Images" as permissive for insert to service_role with check (true);

Update Supabase environment

Supabase functions are located in the same repo.

Copy the supabase/functions/.env.example file to supabase/functions/.env and update the values with your details.

DEZGO_API_KEY=GENERATE_FROM_YOUR_DEZGO_DASHBOARD
KOBBLE_SECRET_KEY=GENERATE_FROM_YOUR_KOBBLE_DASHBOARD

Note: the Dezgo API Key can be generated on the Dezgo Dashboard and is used to generate images from the Edge Function Backend.

Deploy Supabase Edge Functions

Deploy the Supabase functions to your Supabase project.

cd supabase/functions

npm run supabase:deploy # will deploy environment and functions

Raise an issue

To provide feedback or report a bug, please raise an issue on our issue tracker.

What is Kobble?

Kobble Logo

Kobble is the one-stop solution for monetizing modern SaaS and APIs. It allows to add authentication, analytics and payment to any app in under 10 minutes.

supa-image-generator's People

Contributors

kevinpiac avatar

Stargazers

Vince Fulco--Bighire.tools avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.