Free YouTube Transcribe

Video transcript

How I Turned an Open Source AI Repo Into a SaaS in One Evening (Lovable | Supabase |Stripe Tutorial)

Derek Cheung | AI Agents Automation · 1,761 words · 9 min read

Want to search this transcript, jump the video from any line, or download it as TXT, SRT, or VTT?

Open in the transcript tool

Full transcript

0:00GitHub is a gold mine for

0:01entrepreneurial ideas. With brilliant

0:03projects and proven appeal, the

0:05explosion of GitHub stars for a

0:07repository suggests that a market

0:08already exists.

0:10Many of these repositories are

0:11essentially unfinished products waiting

0:13for a better user interface or a SaaS

0:15model to make them accessible. Yet, most

0:18builders don't even consider this.

0:20Mirofish is a perfect example.

0:22It is a multi-agent prediction engine.

0:25You upload a document and it generates

0:26hundreds of AI agents, runs them through

0:29a dual social simulation, and produces a

0:31structured report.

0:33I turned it into a SaaS in a single

0:35evening, complete with Google login, a

0:37free tier, and Stripe billing. Let me

0:39show you how.

0:41I used four tools. Let me explain the

0:43purpose of each one. Before we look at

0:45the different components, let me give

0:47you a live demo. This is the SaaS that I

0:49built using the Mirofish Git repo. Here

0:52is the pricing page, which is hooked up

0:54live to Stripe. There are two tiers,

0:56free and pro, and I can sign in.

0:58To sign in, I use Google Auth, so I can

1:01log in right with Google. It will

1:03authenticate me and log me in.

1:05At this dashboard, I can do a new run.

1:07If I select new run here and describe

1:09our prompt, I'll just put Shopify store.

1:12Then I'll go ahead and start it. This

1:14will bring up the simulation dashboard.

1:16I can upload files and then ask for the

1:18simulation. I've already started some

1:20here, so I'll show you what this looks

1:22like. I'll take a look at the graph

1:23build. You can go into the app that does

1:26the simulation, and I can continue with

1:27that simulation, generate the agents,

1:30and then run the simulation based on

1:31that generation.

1:33Comment below, what would you simulate

1:35with this? Let's build in public. I

1:37reply to every comment. Also, check the

1:39description for a free starter kit as a

1:41thank you for engaging.

1:44Let's talk about the tech stack.

1:46Lovable is an AI-powered full-stack app

1:48builder. You describe what you want, and

1:50it writes the code, wires up your back

1:52end, and deploys it all in one place.

1:55What makes it stand out is its native

1:57Supabase integration. It connects

1:59directly to your project and generates

2:01code against your real back end,

2:03automatically handling authentication,

2:05database tables, and row-level security

2:08out of the box.

2:09Supabase serves as the trust anchor for

2:12the entire stack, providing

2:13authentication, a Postgres database, and

2:16edge functions on a single platform.

2:19Every service in this architecture

2:21verifies user identity through it.

2:23Stripe handles checkouts and

2:24subscriptions with a single webhook into

2:27Supabase, keeping the entire billing

2:29system lean and centralized.

2:31Finally, Replit hosts the Mirofish

2:34Python simulation engine. With a single

2:36prompt in Lovable, we added JWT

2:39authentication, ensuring that only

2:41verified, signed-in users can access it.

2:44Here's how the pieces fit together. On

2:47the dashboard front end, we are using

2:48Lovable for the interface and Google

2:50authentication. It integrates

2:52automatically with Supabase, which

2:54stores user profiles, supports Google

2:56authentication under the hood, and

2:58tracks Stripe payment data to

3:00differentiate between pro and free

3:01status.

3:03Lovable then calls my Replit URL housing

3:05the Mirofish Python code. I'm

3:08refactoring that code to add an

3:09authentication layer, allowing the front

3:11end to communicate securely with the

3:12back end. We will use JSON web tokens to

3:15ensure the back end is protected,

3:17meaning users must have a valid plan or

3:19tokens to gain access.

3:22Supabase will issue these tokens to

3:23facilitate secure communication. We are

3:26going to start building with Lovable

3:27first, then add the JWT handshake to the

3:30Mirofish back end on Replit. All right,

3:32I'm in my Lovable dashboard, and I'm

3:34going to type my prompt. This prompt

3:36will be, build Mirofish, a SaaS

3:38dashboard that accesses an AI simulation

3:41back end.

3:42We will give it a placeholder URL for

3:44the Replit app that we are going to

3:45stand up shortly.

3:47It is going to use Google sign-in via

3:49the Lovable cloud for authentication,

3:51and the plans will include a free tier

3:53and a pro tier.

3:55The free tier will have three

3:56simulations per month, and the pro tier

3:58will have an increased amount.

4:00As for the pages, I wanted to build a

4:02landing page, a login page, pricing, and

4:05a protected dashboard.

4:07I also want a monthly usage progress bar

4:10and a new run button that launches the

4:12simulation.

4:13Here is how the workflow works. The user

4:16submits a prompt into the dashboard. The

4:18server checks the quota and logs the

4:20run. Then it opens the Replit app in a

4:22new tab with the prompt and the user's

4:24authentication token in the URL.

4:27It then calls Replit to start the

4:28simulation session.

4:30In terms of data, the profiles,

4:32subscriptions, and simulations will all

4:35have row-level security.

4:37I want a clean, modern SaaS design, so

4:39let's go ahead and do that. The plan is

4:41here, so let's get started. As part of

4:44the planning process, it asks me a few

4:46different questions. First, what is the

4:48Replit back end? I'll just use a

4:50placeholder for now.

4:52What token should it use for

4:53verification? Let's use a JWT token.

4:57When should the monthly quota reset?

4:59Let's set it to a rolling 30 days. And

5:02how built out should the landing pages

5:03be? Let's go with a single focus, single

5:06session landing. We will select that and

5:08submit. Now it's generating a plan.

5:11Let's take a look.

5:16This looks pretty good. A gated SaaS

5:18front end with a hosted Replit back end

5:20and Google user sign-in.

5:22It uses Auth and a database, and it

5:24gives all the details here.

5:26Everything looks good, so let's approve

5:28it. It has the plan and is now enabling

5:31the Lovable cloud while it builds. I

5:33will pause the recording to let it

5:35process, and we will come back in a

5:36couple of minutes. All right, after it's

5:38built for a minute or two, it's asking

5:40for additional details.

5:42This is for Stripe payments. I want to

5:44be able to accept payments globally, and

5:45these are the features it's asking to

5:47include. I'll just hit continue.

5:49That's going to continue building it all

5:51out. It found a Stripe product already

5:53created from a previous build. So, I'll

5:55just reuse Mirofish Pro at $39 per

5:58month.

5:59I'll go ahead and allow that.

6:03All right, so now the app is built. You

6:05can see here that Mirofish is ready to

6:07be tested. It has created the cloud

6:09database and includes information for

6:10authentication, payments, and pages.

6:13You can even see that the pricing is all

6:15working.

6:16If I go into the cloud settings, we can

6:18see that the database has already

6:19created profiles for us.

6:21This is all running on Supabase.

6:23The profile section is where user data

6:26will be stored as accounts are created.

6:28This is also where we are going to keep

6:30information regarding subscriptions.

6:32As people sign up for the free or pro

6:34tiers, it will add that data through the

6:36Stripe integration.

6:37We also have a counter to keep track of

6:39all the simulation runs. All of that is

6:41enabled.

6:42You can see here that Supabase is under

6:44the hood, so we can write our own SQL in

6:46here if we want. It also shows all the

6:49different edge functions that have

6:50already been created. It is pretty cool

6:52that it has already done all of this.

6:56Next, I'm going to use Supabase to issue

6:59and control the JWT.

7:01So, I'm going to say, please give me the

7:03Supabase URL.

7:05This is what it created, so I want the

7:07URL for that and also the publishable

7:09key so I can share it with my Replit

7:11back end. So, I'll go ahead and do that.

7:14I'll copy this information into my

7:16Replit. All right, so I am in my

7:18Mirofish deployment on Replit. This is

7:20my Python Flask application. And what I

7:23am going to do is a remix. This allows

7:25me to create a new version of the

7:26project, so I will name it SaaS-JWT

7:30and click remix.

7:32This creates a new version that I can

7:34build upon.

7:35Now I need to create one additional

7:37thing to securely connect to the Lovable

7:39front end or dashboard. It already has

7:41some functionality, but I need that

7:43specific connectivity, so I'm going to

7:45enter this prompt.

7:47I want to lock down my Flask back end by

7:50validating a Supabase JWT. I have the

7:53details here, and I'm going to pass it

7:55the Supabase URL.

7:57This is where I use Supabase to verify

7:59that I have a valid token for the front

8:01end.

8:02On the view front end, I will strip the

8:04token from the address bar and attach it

8:06as a bearer token on every call, passing

8:09in the information I gathered earlier.

8:12Now I will go ahead and run that.

8:16Now that I have successfully completed

8:18that, the only thing left to do is copy

8:20this URL.

8:21This is just for testing, but for

8:23deployment, I would publish it first and

8:25then copy that URL.

8:27So, we will copy the URL and go back to

8:29my Lovable instance.

8:31I'm going to say, please connect to this

8:33Replit URL.

8:34We will let that build. All right, now

8:36that it's finished building, we can test

8:37it. I can see that the pricing page

8:39works, a free level and pro level.

8:42I'll log in with Google and type my

8:44password.

8:48All right, I'm going to allow, and I'm

8:50taken to my dashboard.

8:52I'm going to do a new run,

8:54and I'm going to give it a prompt and do

8:57a launch.

8:58Now I'm in my Mirofish app with all the

9:00functionality of the open source repo.

9:02So, to recap, this is the ultimate

9:05blueprint for turning any open source

9:06repo into a profitable startup SaaS. In

9:09a single evening, with just four tools,

9:12we've built a production-ready business.

9:14We've got Google OAuth setup and a free

9:16tier that's actually enforced at the

9:18database level.

9:19We've got Stripe billing that triggers a

9:21single row update the second a payment

9:24clears.

9:25We're using a JWT handoff, so Replit

9:28never has to trust the front end. It

9:30only trusts Supabase.

9:32And we added that quota edge function to

9:34block runs without needing a full round

9:36trip to the application logic.

9:38If this saved you some time, go ahead

9:40and hit like. It really helps other

9:42developers find the video. And make sure

9:44to subscribe so you don't miss the next

9:46one.

Recently added transcripts

Browse the whole transcript library

This transcript was generated from the captions YouTube publishes for this video. Get the transcript of any YouTube video atfreeyoutubetranscribe.com, free, unlimited, no sign-up.