How to build an Instagram clone app
Build a photo-sharing app like Instagram with 9 prompts: sign up, photo posts, feed, likes, comments, and follows on Supabase, plus React Native code you own.
Rumeysa Saglam· Updated 
To build an Instagram clone app, you build it one feature at a time on a real backend: accounts first, then profiles, photo posts, a feed, likes, comments, and follows, with rules that keep each person’s data their own. We built every one of them in Draftbit in November 2026 by sending the agent 9 prompts, one feature at a time, and this post gives you every prompt, what each one cost, and the spots where things looked broken but weren’t.
This tutorial is for you if you want a working photo-sharing app for iOS, Android, and web without writing the code yourself, or if you searched for an “Instagram clone script” and want code you can actually take with you. By the end you’ll have Picbit, a small Instagram-style app with sign up, profiles with photos, photo posts, a feed of the people you follow, likes, comments, and a security check, running on a Supabase backend.
What you’ll build, and what it took us
Picbit is a React Native and Expo app with three tabs (Home, New Post, and Profile), backed by a managed Supabase database, authentication, and file storage. Here’s what each step added and what the agent’s runs cost us, measured in the build we did for this post:
| Step | Feature | Agent time | Credits |
|---|---|---|---|
| 1 | Accounts and the app shell | 13 min | 989 |
| 2 | Edit profile and avatar | 13 min | 1,056 |
| 3 | Photo posts | 16 min | 1,136 |
| 4 | Home feed | 15 min | 1,172 |
| 5 | Likes | 13 min | 1,017 |
| 6 | Comments | 15 min | 1,245 |
| 7 | Profiles and following | 18 min | 1,601 |
| 8 | Security check | 14 min | 1,444 |
| 9 | Sample data (optional) | 14 min | 1,247 |
In total, the agent worked for 2 hours and 12 minutes and used 11,063 credits, including the short planning step at the start. That’s agent time only: testing each step in the preview took us longer than the agent did, and we’d budget an afternoon for the whole thing. Each feature took two agent runs of 3 to 10 minutes each, for the reason explained in step 1. We used OpenAI Codex as the agent.
The app ran on Expo SDK 55, React Native 0.83, React 19.2, and supabase-js 2.95, as of November 2026.
Before you start
You’ll need a Draftbit account, and how far the Free plan takes you depends on how the agent runs. The whole build used about 11,000 credits, and a new Free account comes with a one-time grant of 5,000, which covered our first four steps. To finish on Free, you can connect your own Claude or ChatGPT subscription instead, so the agent runs don’t use Draftbit credits. On Free that’s 20 agent runs a week, and our build took about 20 (two per step, plus a few follow-ups), so plan on a week or a little more. Standard is $15 a month, as of November 2026, and doesn’t include credits: you either connect your own subscription, which has no weekly run limit on Standard, or add a monthly credit package, such as 15,000 credits for $15, which covers the whole build. See plans and pricing for the details.
Editing or downloading the code, which we cover near the end, also needs Standard and up.
Create a new project, choose Mobile App, and paste the step 1 prompt below as the description. When you’re asked about a backend, choose Create a new backend, then Supabase. For extras, we turned on file storage, because Picbit stores photos, and email.
Your project now has two apps: Picbit Mobile, which is the app people will use, and Supabase Backend, which holds the database. That split shapes every step below, so it’s worth knowing before you start.
Before building, the agent wrote a short plan (1 minute, 156 credits) and asked us to confirm three guesses: whether people confirm their email before first sign in, whether usernames are lowercase, and what the app should feel like. Then it showed four design directions. We picked Viewfinder, a light lavender look with photo-frame corners, and every screen in this post uses it.
When you click Finalize Designs & Start Building, the agent builds step 1 from the description you pasted, so don’t send that prompt again. Send steps 2 to 9 each in a New Thread in Picbit Mobile, and wait for the agent to finish before sending the next one. Each prompt asks for one change, which makes it much easier to see what broke when something does.
Step 1: Accounts and the app shell
Build Picbit, a photo-sharing mobile app like a simple Instagram, for iOS and Android.
For this first version, only build accounts and the app shell:
- Sign up with email and password, sign in, and sign out, using our Supabase backend.
- When someone signs up, create a profile for them with a unique username and a display name.
- After sign in, show three tabs: Home, New Post, and Profile. They can be placeholder screens for now.
- The Profile tab shows the username, display name, and a Sign Out button.
- Show clear error messages for a wrong password, an email that's already used, and a username that's taken.
Don't build posts, likes, comments, or following yet. No social login and no push notifications.
The agent built the sign in and sign up screens and the three tabs in about 7 minutes, then stopped and said the backend wasn’t ready yet. That’s expected, and it’s the pattern for every step in this post. The agent in Picbit Mobile builds the screens, then files an urgent task for the backend on the project’s Tasks board, because the database lives in the other app.
To finish the step, open Supabase Backend, open the urgent task, and start it. The backend agent creates the tables, the security rules, and the signup logic, tests them, and syncs them to Development, which is the environment you build in. In our run that took about 6 minutes.
One detail we liked: the backend agent made claiming a username a single step, so if two people try to take the same username at the same moment, one of them gets the “username is taken” error and no half-made account is left behind.
To check it: sign up, sign out, sign in with the wrong password, then try signing up with a username you’ve already used. You should see a clear message for each.
Looks wrong but is fine: you can sign in right after signing up without confirming your email. Email confirmation is off in Development so you can test quickly. Turn it on before you launch, because step 8 shows why it matters: open the Supabase panel, choose the Production environment, and under Authentication, turn on email confirmation for email and password sign in. The agent doesn’t change Staging or Production settings for you, so this is one you do by hand.
Step 2: Edit profile and a profile photo
On the Profile tab, add an Edit Profile screen where I can change my display name, a short bio, and my profile photo.
Let me pick the photo from my phone's library and store it in Supabase storage. Show the photo as a circle on the Profile tab, with a default avatar if I haven't added one. Only I should be able to change my own profile.
The mobile agent added the Edit Profile screen with a photo picker, a preview, and a default avatar, and it resizes each photo into a small square JPEG before uploading it. The backend task then made the storage bucket private, limited avatars to 5 MB, and made sure only you can change your own profile.
To check it: change your name, bio, and photo, save, and reload the preview. Then scan the QR code to open the app on your phone and pick a photo from your library.
Looks wrong but is fine: on iPhone, picking a photo doesn’t trigger a permission prompt. With the system photo picker, the app only receives the photo you choose, so there’s nothing for iOS to ask about.
Step 3: Photo posts
Build the New Post tab. I pick a photo from my library, see a square preview, add an optional caption, and tap Share.
Upload the photo to Supabase storage and save the post with the photo, caption, author, and time. While it uploads, show progress and disable the Share button so I can't post twice. After it's shared, take me to the Home tab.
This step got the most careful handling of the whole build. If the connection drops in the middle of an upload, the app retries with the same post ID, so you never end up with the same photo posted twice.
Looks wrong but is fine: until the backend task runs, the Share button stays disabled and the screen says why. After you run the task, you should see “Post shared. Your photo is saved.” and land on Home.
If it fails on your phone: on a weak connection we saw “We could not confirm your share” during one upload. Tapping Retry share finished it, and there was still only one post.
Step 4: The home feed
Build the Home feed. Show all posts, newest first. Each post shows the author's avatar and username, the photo, the caption, and how long ago it was posted.
Add pull to refresh. Load more posts as I scroll. If there are no posts yet, show a friendly empty state with a button to the New Post tab.
The feed loads 20 posts at a time, refreshes when you pull down (or tap Refresh on web), and keeps the posts it already has on screen if a refresh fails.
Looks wrong but is fine: before the backend task runs, Home shows “Your feed is on its way” with a Retry button instead of an empty feed. The agent built separate screens for “there are no posts yet” and “the backend isn’t connected yet”, so seeing this one means you still have the backend task to run.
To check it: share two posts, then check that the newest is on top and that pulling down refreshes the feed.
Step 5: Likes
Add likes to posts in the Home feed. Tapping the heart likes or unlikes the post, and double-tapping the photo likes it too. Show the like count under the photo.
Each person can like a post only once. Update the heart right away when I tap it, and undo it if saving fails.
The heart fills in as soon as you tap it, and it goes back if the save fails. On the backend, each person’s like is counted once, even if the same request arrives twice, and the list of who liked a post isn’t exposed.
If the preview crashes: right after the backend task finished, our first double tap on a photo showed “Something went wrong” with an error about like_count. Tapping again worked, and we never saw it again. If you see it, reload the preview before asking the agent to fix it.
To check it: like a post, unlike it, double-tap the photo, then reload. The heart and the count should stay the way you left them.
Step 6: Comments
Add comments. Under each post in the feed, show "View all N comments". Tapping it opens a Comments screen with the post's caption at the top, then the comments oldest first, each with the commenter's avatar, username, text, and time.
At the bottom there's a text box to add a comment. I can delete my own comments, but not anyone else's.
The Comments screen keeps your draft if posting fails, so you can try again without retyping it, and only your own comments show a Delete option, which asks you to confirm first.
To check it: add a comment, go back to the feed and check that the count went up, then delete your comment.
Step 7: Profiles and following
Make usernames tappable everywhere. They open that person's profile: avatar, display name, bio, post count, followers and following counts, and a 3-column grid of their photos. Tapping a photo opens the post.
Add a Follow / Following button on other people's profiles. Then change the Home feed to show posts from people I follow plus my own. If I don't follow anyone yet, suggest a few people to follow.
My own Profile tab uses the same layout, with Edit Profile instead of Follow.
This was the most expensive step (18 minutes and 1,601 credits), because it changes the feed, the profiles, and the backend rules at once. The backend agent’s first live test also caught a wrong assumption in its own test (an existing account had more posts than the test data), and it fixed the test before moving on.
You’ll need a second account to test this. Sign out, sign up as someone else, and share a photo. Then sign back in as yourself, open their profile, and tap Follow. Their post should appear on Home, and it should disappear when you unfollow.
Looks wrong but is fine: with only one account in the app, Home says “No suggestions yet”. Suggestions appear once there are other people to suggest.
Step 8: Check the security
Check the security of everything we built. Make sure people can only edit or delete their own profile, posts, comments, and likes, and that nobody can see another person's email address. Also let me delete my own post from the post's menu. Tell me what you changed.
We think this step is worth running on any app you build with AI, because it’s the one where the agent looks for problems instead of adding features. In our run, it confirmed that nobody could change another person’s profile, posts, comments, or likes, and that no email address was visible to other people. It also found a real problem: the sign up screen checked whether an email was already registered, which let anyone find out whether a given email had a Picbit account. The agent removed that check and made the duplicate-email message generic.
It added Post menu, then Delete post too, with a confirmation that warns the post’s likes and comments go with it.
What it couldn’t close: the agent told us that Supabase’s built-in sign up endpoint still returns a “user already exists” error for an email that’s registered. The fix is to turn on email confirmation before launch, which is the same setting from step 1. We’d rather the agent say this than claim the app was fully locked down.
Step 9 (optional): Add sample data
Add sample data to the Development database only: 5 demo users with avatars and short bios, about 15 photo posts with captions, and some likes, comments, and follows between them. Use placeholder photos that are free to use. Don't touch Staging or Production.
A feed with one person in it doesn’t look like Instagram, and we didn’t want our own photos in this post, so we asked for demo data. The agent prepared 5 demo profiles, 15 posts with free Unsplash photos, 37 likes, 20 comments, and 10 follows, all labeled “Demo”, in Development only.
The most likely snag: the demo accounts have to exist before the agent can fill them in. The agent asked us to add them with Add user in the Supabase panel’s Users section, but we didn’t see that option in our build, so we asked the agent whether we could sign up through the app instead. It checked, said yes, and gave us a username for each email. Signing up five times from the app’s own Sign Up screen, then telling the agent “All five accounts are added”, worked. If you don’t see Add user either, ask the agent the same question.
Looks wrong but is fine: right after the data loaded, Maya’s profile showed no avatar or bio. Reloading the preview brought them in.
Make a change by hand
Not every change needs the agent. When you know exactly what you want, clicking the element and changing it yourself is often faster, and it doesn’t use credits. To show the difference, we made the same small change both ways: a light circle behind the heart under each post.
Start by switching the canvas to Design with the button at the top left of the builder (or press ⌘I to switch between Preview and Design). In Design mode, app interactions are paused, so clicking the heart selects it instead of liking the post. A small toolbar opens on top of the preview with the layout controls for that element: which way its contents stack, the gap between them, and how they line up, plus buttons to select its parent, duplicate it, or delete it.
The panel on the right shows the rest of its styles. The heart is a Pressable with the classes h-11 w-11 items-center justify-center rounded-full active:bg-secondary, which means it only gets a background while you’re pressing it. We typed bg-secondary into Classes and pressed Enter, and the circle appeared in the preview straight away, with Background now showing the Secondary color.
That took a few seconds and no credits. When we opened Save, the change showed up as one file, PostLikeActions.tsx, with a commit title already drafted from it (“Add a background to the post like button”).
To compare, we discarded that change and sent the same request to the agent in a new thread:
Give the heart button under each post a light filled circle behind it, using the secondary color.
The agent made the same change in 43 seconds for 180 credits, and checked that liking still worked. It couldn’t check the result visually because the preview was on the sign in screen, so we looked at the feed ourselves.
That’s the pattern we’d follow. The agent is the better choice when a change touches several screens or the backend, such as following, which changed the feed, the profiles, and the database rules together. The visual tools suit small, exact changes on one screen, like a size, a color, or a label, where you can see the result as you click.
Can you get the code? (the “Instagram clone script” question)
Yes. Everything in Picbit is ordinary React Native and Expo code, and it belongs to you. On Standard and up, you can edit it in the builder’s Code Editor, download it, or push it to GitHub. On the Free plan you can build and preview the app, but not open or export the code.
That’s different from a script you’d buy and reskin: you get code written for the app you described, in a stack plenty of developers know, so you or anyone you hire can keep working on it outside Draftbit.
The fastest way to find the code for something on screen is to click it in the preview and open the code tab, which shows that element’s code and its file.
Here’s that like button from components/picbit/PostLikeActions.tsx, exactly as the agent wrote it (before the circle change above):
<Pressable
accessibilityRole="button"
accessibilityLabel={`${like.liked_by_me ? "Unlike" : "Like"} post by @${username}`}
accessibilityHint="Double-tapping the photo also likes this post."
accessibilityState={{ selected: like.liked_by_me, disabled: !ready }}
disabled={!ready}
onPress={() => onSetLiked(!like.liked_by_me)}
className="active:bg-secondary h-11 w-11 items-center justify-center rounded-full"
>
<Icon
name="Heart"
className={`h-6 w-6 ${like.liked_by_me ? "text-primary" : ready ? "text-foreground" : "text-muted-foreground"}`}
fill={like.liked_by_me ? theme.colors.primary : "none"}
/>
</Pressable>
The styles are Tailwind classes through NativeWind 4.2, and the screen reader labels and the 44-point tap target were added without us asking for them.
What to build next
If you’d rather start from something closer to the real Instagram, with feeds, stories, reels, and private messages, start from the Circlo template and use the prompts above to change it. If you built Picbit, a good next prompt is the one we skipped:
Add password recovery. On the sign in screen, add "Forgot password?". It asks for my email, sends a reset link, and lets me set a new password.
When we ran it, the agent added the screens in 4 minutes for 783 credits: Forgot password? asks for an email without revealing whether it’s registered, and the one-time link lets you choose a new password or request another if it has expired. Sending the reset email to a real inbox needs one more thing from you, though. The agent showed a card asking for your email provider’s SMTP settings (a sender address on your own domain, plus the host, port, user name, and password), which you enter under Emails, then Custom SMTP in the Supabase panel rather than in the chat.