Chrysolites Tech Academy

Short-Video App with React Native and Supabase · Course book

Chapter 1: Planning a Short-Video App

Pairs with Lesson 1: Planning the App and Its Stack

Short-video apps, where people scroll through a full-screen feed of clips, like them, comment, follow creators and chat with friends, look simple to use but combine almost every feature of modern mobile development. Before writing any code it pays to understand the whole system: what the app must do, which tools handle which jobs, how data moves between the phone and the back end, and how much storage and bandwidth videos really need. This chapter is that plan. It introduces the feature list, the technology stack of React Native with Expo, Supabase, TanStack Query and NativeWind, the architecture that connects them, a first estimate of storage costs, and the order in which the following chapters build the app.

What the app must do

A useful way to plan any app is to write its features as short user stories, then group them into the screens that deliver them. The finished app in this course covers the following.

  • A splash screen, then sign-up and login with email and password.
  • A full-screen, vertically scrolling video feed, where each clip plays when it is on screen and pauses when it leaves.
  • Likes, comments and sharing on each video, shown as icons over the video.
  • Recording videos with the camera or picking them from the phone's gallery, then uploading them.
  • Following other users, with friends defined as people who follow each other, and a feed of friends' videos.
  • A profile showing the user's photo, videos, likes and follower counts, with the ability to change the photo.
  • An inbox with an activity feed of likes, comments and new followers, and real-time chat with friends.

Writing the list first helps in two ways. It reveals the data the app must store, which shapes the database, and it gives a natural order for building: navigation and accounts first, because everything depends on them, then uploading, because the feed needs videos to show, then the social features that sit on top.

It also helps to decide what is not in the first version. Editing tools such as filters and music, algorithmic recommendations, monetisation and live streaming are each large projects in their own right. A clear first version, often called a minimum viable product, includes only what is needed for the core experience: post a clip, watch clips, react to them and talk to friends. Features can be added once that core works well, and real users can show which additions matter most.

Finally, set quality targets early. A feed should scroll smoothly, which on phones means drawing about 60 frames per second, leaving roughly 16 milliseconds per frame for all the work on screen. A video should start playing within a moment of appearing. And the app should cope with poor connections, showing clear messages rather than freezing. These targets influence choices later, such as how many videos to load at once and when to start downloading the next clip.

The technology stack

Each tool in the stack has a clear job, and knowing why each one was chosen makes later decisions easier.

ToolJob in the appWhy it suits this project
React Native with ExpoThe app itself, on iOS and AndroidOne JavaScript codebase; Expo provides the camera, video and image libraries and a fast development loop
Expo RouterScreens and navigationRoutes come from the folder structure, like a web framework
NativeWindStylingTailwind-style utility classes in React Native
SupabaseDatabase, authentication, file storage and real-time updatesA hosted PostgreSQL database with these services built in
PrismaDefining and migrating the database tablesReadable schema files and repeatable migrations
TanStack QueryFetching and caching data in the appHandles loading states, caching and refetching

The stack is a common pattern called backend as a service: rather than writing and hosting a custom server, the app talks directly to a managed service that provides the database, accounts and files through a client library. That saves a great deal of work, but it moves responsibility for security into the database's own rules, a theme that returns whenever data is read or written.

How the pieces connect

The app on the phone holds the interface and a small amount of state, such as the signed-in user. Everything else lives in Supabase. Videos are large binary files, so they go into storage buckets, while the database holds a row for each video containing its owner, title and the path of the file in storage. Likes, comments, follows and chat messages are rows in their own tables, each linked to users and videos by their ids.

Phone app Expo Router screensNativeWind stylesTanStack Query cacheAuth providercamera and video Supabase AuthenticationRealtimePostgreSQLStorage users, videos, likescomments, followerschatsvideo filesprofile photossigned or public URLs requests updates
Figure 1.1 — The app's architecture. The phone talks to four Supabase services through one client library; video files live in storage, and the database stores their paths.

Reading data follows one pattern throughout. A screen asks TanStack Query for some data, such as the feed; the query function calls Supabase; the result is cached under a key; and the screen renders it. Writing follows another: an action, such as liking a video, inserts or deletes a row, and the related queries are refreshed so every screen shows the new state. Chat adds a third pattern: the app subscribes to new rows and Supabase pushes them as they arrive.

Security runs through all three patterns. Because the phone talks to the database directly, the database must decide, row by row, what each signed-in user may read and change, using rules called row level security policies. A user should be able to insert a like only in their own name, delete only their own comments and read chat messages only in conversations they belong to. Storage buckets have similar rules: anyone signed in might read public videos, but only the owner may upload into or delete from their own folder. Planning these rules alongside the tables, rather than as an afterthought, avoids the common mistake of an app that works perfectly but lets anyone change anyone's data.

Estimating storage and bandwidth

Video dominates the cost of an app like this, so it is worth estimating early. A video file's size is roughly its bitrate, the amount of data per second, multiplied by its duration. Bitrates are usually quoted in megabits per second, and there are 8 bits in a byte.

Worked example. A 15-second clip recorded at 6 megabits per second is 15 × 6 / 8 = 11.25 megabytes. A 20-second clip at 5 megabits per second is 20 × 5 / 8 = 12.5 MB. If users upload 5,000 such clips, they need 5,000 × 12.5 = 62,500 MB, about 61 gigabytes, using 1,024 megabytes per gigabyte. Bandwidth matters as much as storage: if each clip is watched 20 times, serving them transfers twenty times as much data, 1,250,000 MB, or about 1.2 terabytes.
24.4 GB61.0 GB 0204060 01,0002,0003,0004,0005,000 videos uploadedstorage (GB)
Figure 1.2 — Storage needed for 20-second clips at 5 megabits per second. Every 1,000 videos adds about 12.2 GB.

These numbers lead to sensible design choices: limit clip length, record at a reasonable resolution and bitrate rather than the camera's maximum, and check the free and paid storage and bandwidth allowances of the back-end plan before launching. Hosted services publish these limits, and they change, so check the current figures for your plan.

Bandwidth also affects viewers. On a mobile connection delivering 10 megabits per second, a 12.5 MB clip takes 12.5 × 8 / 10 = 10 seconds to download in full, far too long to wait. Video players avoid this by starting playback as soon as the first part has arrived and downloading the rest while it plays, so the practical requirement is that the connection delivers data faster than the clip's bitrate: 10 megabits per second comfortably exceeds a 5 megabit clip.

The build plan

The chapters that follow build the app in a deliberate order, each step relying on the previous ones.

  1. Set up Expo, then add NativeWind styling, Expo Router navigation and the tab bar icons.
  2. Create the Supabase project, define the tables with Prisma and add authentication with an auth provider.
  3. Add the camera, the gallery picker and uploads to storage.
  4. Build the home feed with automatic playback, then the overlay of icons, comments, likes and follows.
  5. Add the activity feed and real-time chat, then finish the profile and the friends feed.
  6. Prepare the app for the App Store, with the safety features that platforms require for user-generated content.

Working in this order means there is always something runnable on the phone, which makes mistakes easy to spot as soon as they appear. Commit to version control after each step, so that any experiment can be undone.

Check your understanding

  1. Compute the file size of a 30-second clip at 6 megabits per second, and of a 60-second clip at 4 megabits per second.
  2. How much storage do 10,000 clips of 12.5 MB each need, in gigabytes?
  3. Why are video files kept in storage buckets rather than in database rows?
  4. Explain what "backend as a service" means and one responsibility it shifts onto the database.
  5. Which data does the app read with queries, and which does it receive through a real-time subscription?
  6. Why does the build plan add authentication before the video feed?

Install Chrysolites Tech Academy

Android / Chrome / Edge: open the browser menu and choose Install app or Add to Home screen.

iPhone / iPad (Safari): tap the Share button, then Add to Home Screen.