A React Native 0.76+ starter kit with Expo, TypeScript, and Supabase Authentication, designed to speed up the creation of new projects. This template comes with ESLint, Prettier, Jest, and GitHub Actions, ensuring code quality and best practices.
- Node.js >= 22
- npm >= 10
- Expo CLI (
npm install -g expo-cli)
-
Clone this repository:
git clone https://github.com/yourusername/react-native-supabase-boilerplate-2025.git cd react-native-supabase-boilerplate-2025 -
Install dependencies:
npm install
-
Setup your Supabase environment:
-
Create a project on Supabase.
-
At Supabase, create 'users' table and add the following columns:
- id (uuid)
- creeated_at (timestampz)
- name (text)
- last_name (text)
- profile_picture (text)
- email (text)
- updated_at (timestampz)
-
Add a foreign key on users table:
- Schema: auth
- table to reference: users
- public.users "id" => auth.users "id"
-
At "Authentication">Polices create a new policy:
-
Name: allow all access for auth users
-
Table: public.users
-
Policy Command: Select "ALL" option
-
Target Roles: auth.authenticated
-
Script:
alter policy "allow all access for auth users" on "public"."users" to authenticated using (true);
-
-
At "SQL Editor" add and run a new script to create a function and trigger:
-- inserts a row into public.users create function public.handle_new_user() returns trigger language plpgsql security definer set search_path = public as $$ begin insert into public.users (id, name, last_name, email, updated_at) values ( new.id, coalesce(new.raw_user_meta_data ->> 'first_name', ''), coalesce(new.raw_user_meta_data ->> 'last_name', ''), -- coalesce(new.raw_user_meta_data ->> 'profilePicture', ''), new.email, now() ); return new; end; $$; -- trigger the function every time a user is created create trigger createAuthUser after insert on auth.users for each row execute procedure public.handle_new_user(); -- insert test. -- insert into auth.users (id, email, raw_user_meta_data) -- values ( -- gen_random_uuid(), -- 'jane.doe2@example.com', -- '{"name": "Jane", "last_name": "Doe"}' -- ); --> -- DELETE FROM auth.users -- WHERE id = 'ADD USER ID'; -- end test
-
Add your environment variables ('supabaseUrl', 'supabaseAnonKey') to
src\constants\supabase\index.ts.
-
-
Run the development server:
npx expo start
Run all tests:
npm run testRun all tests with noWatch:
npm run test:no-watchRun tests with coverage:
npm run test:coverage๐ฆreact-native-boilerplate-supabase-2025
โโโ.github/ # GitHub configurations
โ โโโ workflows # CI/CD workflows
โโโ.husky/ # husky configurations. pre-commit and pre-push hooks
โโโ.vscode/ # VS Code configurations
โโโsrc/ # Source code
โโโ app/ # Application: Logic and organization of pages and routes
โ โโโ (private)/ # Private pages
โ โ โโโ dashboard # Dashboard page
โ โ โโโ product # Product page
โ โ โโโ profile # Profile page
โ โโโ (public)/ # Public pages
โ โโโ (auth)/ # Authentication pages
โ โโโ signin # Sign-in page
โ โโโ signup # Sign-up page
โโโ assets/ # Static files (images, fonts)
โ โโโ fonts # Fonts used in the app
โ โโโ images # Images for the app
โโโ components/ # Reusable components
โโโ constants/ # Constants and fixed values (e.g., supabase, theme)
โ โโโ supabase # Supabase configuration and integration
โ โโโ theme # Theme definitions
โโโ contexts/ # React contexts for state management
โ โโโ auth # Authentication context
โโโ hooks/ # Custom hooks
โโโ lib/ # Libraries and utilities
โโโ i18n # Internationalization (i18n)
โ โโโ locales # Translation files
โโโ supabase # Supabase integration utilities
โโโ zod # Zod validation utilities- / โ Splash Screen
- /(public)/(auth)/signin/page โ Sign In page
- /(public)/(auth)/signup/page โ Sign Up page
- /(private)/dashboard/page โ Dashboard (authenticated users only)
- /(private)/profile/page โ User Profile (authenticated users only)
The project uses GitHub Actions for:
- Linting and formatting: Ensures code quality with ESLint and Prettier.
- Running tests: Runs the Jest tests on every push and pull request.
- Add commit linting for enforcing commit message conventions.
- Implement unit tests for all components and pages.
- Create a dark mode version of the app.
This project was created by Jorge Hecherat.
Feel free to reach out if you have any questions or feedback!
- GitHub: Jorge Hecherat
- Email: hecherat@gmail.com
This project is open-source and available under the MIT License.
- Fork the project.
- Create a new branch:
git checkout -b feature/your-feature-name. - Make your changes and commit them:
git commit -m 'Add some feature'. - Push to the branch:
git push origin feature/your-feature-name. - Submit a pull request.