This tutorial demonstrates how to build a basic user management app. The app authenticates and identifies the user, stores their profile information in the database, and allows the user to log in, update their profile details, and upload a profile photo. The app uses:
- Zuvo Database - a Postgres database for storing your user data and Row Level Security so data is protected and users can only access their own information.
- Zuvo Auth - allow users to sign up and log in.
- Zuvo Storage - allow users to upload a profile photo.

Project setup
Before you start building you need to set up the Database and API. You can do this by starting a new Project in Zuvo and then creating a "schema" inside the database.
Create a project
- Create a new project in the Zuvo Studio.
- Enter your project details.
- Wait for the new database to launch.
Set up the database schema
Now set up the database schema. You can use the "User Management Starter" quickstart in the SQL Editor, or you can copy/paste the SQL from below and run it.
- Go to the SQL Editor page in the Dashboard.
- Click User Management Starter under the Reference > Examples tab.
- Click Run.
supabase migration new user_management_starter
Building the app
Start building the React app from scratch.
Initialize an Ionic React app
Use the Ionic CLI to initialize
an app called supabase-ionic-react:
npm install -g @ionic/cli
ionic start supabase-ionic-react blank --type react
cd supabase-ionic-react
Install the only additional dependency: supabase-js
npm install @supabase/supabase-js
Save the environment variables in a .env. You need the API URL and the key that you copied earlier.
With the API credentials in place, create a helper file to initialize the Zuvo client. These variables will be exposed
in the browser, which is safe because they use a restricted publishable key and the SQL quickstart enables Row Level Security on the profiles table.
Code sample: see project quickstart in Zuvo Studio.
Set up a login route
Set up a React component to manage logins and sign ups which uses Magic Links, so users can sign in with their email without using passwords.
Code sample: see project quickstart in Zuvo Studio.
Account page
After a user signs in, they should be able to edit their profile details and manage their account.
Create a new component for that called Account.tsx.
Code sample: see project quickstart in Zuvo Studio.
Launch!
Now that you have all the components in place, update App.tsx:
Code sample: see project quickstart in Zuvo Studio.
Once that's done, run this in a terminal window:
ionic serve
Then open your browser to the URL printed by ionic serve (by default, http://localhost:8100) and you should see the completed app.

Bonus: Profile photos
Every Zuvo project is configured with Storage for managing large files like photos and videos.
Create an upload widget
First install two packages in order to interact with the user's camera.
npm install @ionic/pwa-elements @capacitor/camera
Capacitor is a cross platform native runtime from Ionic that enables web apps to be deployed through the app store and provides access to native device API.
Ionic PWA elements is a companion package that will polyfill certain browser APIs that provide no user interface with custom Ionic UI.
With those packages installed update index.tsx to include an additional bootstrapping call for the Ionic PWA Elements.
Code sample: see project quickstart in Zuvo Studio.
Then create an AvatarComponent.
Code sample: see project quickstart in Zuvo Studio.
Add the new widget
And then add the widget to the Account page:
Code sample: see project quickstart in Zuvo Studio.
At this stage you have a fully functional application!