An open API service indexing awesome lists of open source software.

https://github.com/hechprad/react-native-supabase-boilerplate-2025

React Native 0.76+ Boilerplate with Expo, TypeScript, and Supabase โ€” Pre-configured with Supabase Authentication, ESLint, Prettier, Jest, and GitHub Actions. The starter kit to accelerate your 2025 React Native projects. ๐Ÿš€
https://github.com/hechprad/react-native-supabase-boilerplate-2025

boilerplate boilerplate-template boilerplates eslint expo github-actions husky i18n jest mobile prettier react-native react-navigation starter-kit supabase supabase-auth ts typescript typescript-boilerplate zod

Last synced: 6 months ago
JSON representation

React Native 0.76+ Boilerplate with Expo, TypeScript, and Supabase โ€” Pre-configured with Supabase Authentication, ESLint, Prettier, Jest, and GitHub Actions. The starter kit to accelerate your 2025 React Native projects. ๐Ÿš€

Awesome Lists containing this project

README

          

# ๐Ÿš€ **React Native Supabase Boilerplate 2025**

## Overview

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.

---

## ๐Ÿ› ๏ธ **Technologies**


React Native
Expo
TypeScript
Supabase
Jest

---

## ๐Ÿ“– **Table of Contents**

- [๐Ÿš€ **React Native Supabase Boilerplate 2025**](#-react-native-supabase-boilerplate-2025)
- [Overview](#overview)
- [๐Ÿ› ๏ธ **Technologies**](#๏ธ-technologies)
- [๐Ÿ“– **Table of Contents**](#-table-of-contents)
- [๐Ÿš€ **Project Setup**](#-project-setup)
- [Prerequisites](#prerequisites)
- [โ–ถ๏ธ **Running the Application**](#๏ธ-running-the-application)
- [๐Ÿงช **Running Tests**](#-running-tests)
- [๐Ÿ“‚ **Project Structure**](#-project-structure)
- [๐ŸŒ **Routes Explanation**](#-routes-explanation)
- [โš™๏ธ **GitHub Actions**](#๏ธ-github-actions)
- [๐Ÿ”ฎ **Future Improvements**](#-future-improvements)
- [๐Ÿ‘ค **Author**](#-author)
- [๐Ÿ“œ **License**](#-license)
- [๐Ÿค **How to Contribute**](#-how-to-contribute)

---

## ๐Ÿš€ **Project Setup**

### Prerequisites

- **Node.js >= 22**
- **npm >= 10**
- **Expo CLI** (`npm install -g expo-cli`)

## โ–ถ๏ธ **Running the Application**

1. Clone this repository:

```bash
git clone https://github.com/yourusername/react-native-supabase-boilerplate-2025.git
cd react-native-supabase-boilerplate-2025
```

2. Install dependencies:

```bash
npm install
```

3. Setup your Supabase environment:

- Create a project on [Supabase](https://supabase.io/).
- 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:

```sql
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:

```sql
-- 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`.

4. Run the development server:

```bash
npx expo start
```

---

## ๐Ÿงช **Running Tests**

Run all tests:

```bash
npm run test
```

Run all tests with noWatch:

```bash
npm run test:no-watch
```

Run tests with coverage:

```bash
npm run test:coverage
```

---

## ๐Ÿ“‚ **Project Structure**

```bash
๐Ÿ“ฆ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
```

---

## ๐ŸŒ **Routes Explanation**

- **/** โ€“ 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)

---

## โš™๏ธ **GitHub Actions**

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.

---

## ๐Ÿ”ฎ **Future Improvements**

- Add **commit linting** for enforcing commit message conventions.
- Implement **unit tests** for all components and pages.
- Create a **dark mode** version of the app.

---

## ๐Ÿ‘ค **Author**

This project was created by **Jorge Hecherat**.

Feel free to reach out if you have any questions or feedback!

- GitHub: [Jorge Hecherat](https://github.com/Hechprad)
- Email: [hecherat@gmail.com](mailto:hecherat@gmail.com)

---

## ๐Ÿ“œ **License**

This project is open-source and available under the [MIT License](LICENSE).

---

## ๐Ÿค **How to Contribute**

1. Fork the project.
2. Create a new branch: `git checkout -b feature/your-feature-name`.
3. Make your changes and commit them: `git commit -m 'Add some feature'`.
4. Push to the branch: `git push origin feature/your-feature-name`.
5. Submit a pull request.