11<h1 align =" center " id =" header " >
22 React Native CRUD
33</h1 >
4-
54<p align =" center " >
65 <img src =" https://img.shields.io/badge/React_Native-20232A?style=for-the-badge&logo=react&logoColor=61DAFB " alt =" React Native " >
76 <img src =" https://img.shields.io/badge/Expo-000020?style=for-the-badge&logo=expo&logoColor=white " alt =" Expo " >
87 <img src =" https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white " alt =" TypeScript " >
98 <img src =" https://img.shields.io/badge/Expo_Router-000000?style=for-the-badge&logo=expo&logoColor=white " alt =" Expo Router " >
109 <img src =" https://img.shields.io/badge/NativeWind-38B2AC?style=for-the-badge&logo=tailwind-css&logoColor=white " alt =" NativeWind " >
1110 <img src =" https://img.shields.io/badge/SQLite-003B57?style=for-the-badge&logo=sqlite&logoColor=white " alt =" SQLite " >
11+ <img src =" https://img.shields.io/badge/Drizzle-C5F74F?style=for-the-badge&logo=drizzle&logoColor=black " alt =" Drizzle ORM " >
1212 <img src =" https://img.shields.io/badge/Bun-000000?style=for-the-badge&logo=bun&logoColor=white " alt =" Bun " >
1313</p >
14-
1514<p align =" center " >
16- A full-featured CRUD application built with React Native, Expo Router, NativeWind, and SQLite. Create, read, update, and delete records with a clean, production-ready mobile interface.
15+ A full-featured CRUD application built with React Native, Expo Router, NativeWind, Drizzle ORM, and SQLite. Create, read, update, and delete records with a clean, production-ready mobile interface.
1716</p >
1817
1918---
2019
2120<h2 id =" stack " >
2221 Tech Stack
2322</h2 >
24-
2523<p >
2624<img src =" https://github.com/tandpfun/skill-icons/blob/main/icons/React-Dark.svg " width =" 48 " title =" React Native " >
2725<img src =" https://github.com/tandpfun/skill-icons/blob/main/icons/TypeScript.svg " width =" 48 " title =" TypeScript " >
@@ -48,7 +46,13 @@ cd react-native-crud
4846bun i
4947```
5048
51- ### 3. Run the App (Start the development server):
49+ ### 3. Generate Database Migrations
50+
51+ ``` bash
52+ bun run db:generate
53+ ```
54+
55+ ### 4. Run the App (Start the development server):
5256
5357``` bash
5458bun run dev
@@ -64,6 +68,28 @@ Open the app:
6468
6569---
6670
71+ <h2 id =" scripts " >
72+ Available Scripts
73+ </h2 >
74+
75+ | Script | Description |
76+ | ------------------------ | ----------------------------------------------- |
77+ | ` bun run dev ` | Start the development server (with cache clear) |
78+ | ` bun run android ` | Start on Android Emulator |
79+ | ` bun run ios ` | Start on iOS Simulator |
80+ | ` bun run web ` | Start on Web |
81+ | ` bun run db:generate ` | Generate Drizzle ORM migration files |
82+ | ` bun run prebuild ` | Rebuild native directories with Expo Prebuild |
83+ | ` bun run ios:native ` | Run native iOS build |
84+ | ` bun run android:native ` | Run native Android build |
85+ | ` bun run lint ` | Check code with Biome |
86+ | ` bun run lint:fix ` | Auto-fix lint issues with Biome |
87+ | ` bun run format ` | Format code with Biome |
88+ | ` bun run typecheck ` | Run TypeScript type checking |
89+ | ` bun test ` | Run tests with Bun |
90+
91+ ---
92+
6793<h2 id =" core-technologies " >
6894 Core Technologies
6995</h2 >
@@ -74,6 +100,8 @@ Open the app:
74100- ** TypeScript** – Type-safe development
75101- ** NativeWind** – Tailwind CSS for React Native
76102- ** SQLite (Expo SQLite)** – Local persistent storage for CRUD operations
103+ - ** Drizzle ORM** – Type-safe ORM for SQLite with migration support
104+ - ** Expo Crypto** – Cryptographic utilities for secure ID generation and hashing
77105- ** React Native Reusables** – Accessible UI component system
78106
79107---
@@ -84,6 +112,9 @@ Open the app:
84112
85113- Full CRUD operations — Create, Read, Update, and Delete records
86114- Local data persistence with SQLite via Expo SQLite
115+ - Type-safe database queries with Drizzle ORM
116+ - Drizzle Studio integration via ` expo-drizzle-studio-plugin ` for database inspection during development
117+ - Secure ID generation with Expo Crypto
87118- Production-ready scalable structure
88119- File-based routing with Expo Router
89120- Dark mode support
@@ -117,33 +148,53 @@ Before starting, ensure you have:
117148react-native-crud/
118149├── src/
119150│ ├── app/ # Expo Router routes
120- │ │ ├── _layout.tsx # Root layout
121- │ │ ├── index.tsx # Initial redirect
122151│ │ ├── (auth)/ # Public auth routes
123- │ │ │ ├── _layout.tsx
124- │ │ │ ├── login.tsx
125- │ │ │ ├── forgot-password.tsx
126- │ │ │ └── reset-password.tsx
127- │ │ └── (app)/ # Protected app routes
128- │ │ ├── _layout.tsx
129- │ │ ├── index.tsx # Home (logged in)
130- │ │ ├── items/
131- │ │ │ ├── index.tsx # List items
132- │ │ │ ├── new.tsx # Create item
133- │ │ │ └── [id].tsx # Edit / detail
134- │ │ └── settings.tsx # Settings & logout
152+ │ │ │ ├── +html.tsx
153+ │ │ │ ├── +not-found.tsx
154+ │ │ │ └── _layout.tsx
135155│ └── shared/
156+ │ ├── auth/ # Auth context & logic
157+ │ │ ├── context.ts
158+ │ │ ├── index.ts
159+ │ │ └── provider.tsx
160+ │ ├── components/
161+ │ │ ├── language/ # i18n / language components
162+ │ │ │ ├── flags/
163+ │ │ │ └── index.tsx
164+ │ │ └── ui/ # Reusable UI components
165+ │ │ ├── forgot-password-form.tsx
166+ │ │ ├── reset-password-form.tsx
167+ │ │ ├── sign-in-form.tsx
168+ │ │ ├── sign-up-form.tsx
169+ │ │ ├── social-connections.tsx
170+ │ │ ├── user-menu.tsx
171+ │ │ └── verify-email-form.tsx
172+ │ ├── constants/
173+ │ │ ├── Colors.ts
174+ │ │ └── theme-icon.tsx
136175│ ├── db/ # Database layer
137176│ │ ├── client.ts # SQLite client setup
138- │ │ ├── migrations.ts # Schema migrations
139- │ │ ├── auth.ts # Auth queries
140- │ │ └── items.ts # Items queries (CRUD)
141- │ ├── providers/
142- │ │ └── auth-provider.tsx # Auth context & session
177+ │ │ ├── db-migration.tsx # Migration runner
178+ │ │ ├── index.ts
179+ │ │ ├── provider.tsx # DB context provider
180+ │ │ └── schema.ts # Drizzle schema definitions
181+ │ ├── hooks/
182+ │ │ ├── useAuth.ts
183+ │ │ └── useColorScheme.ts
184+ │ ├── lib/
185+ │ │ ├── theme.ts
186+ │ │ └── utils.ts
187+ │ ├── services/
188+ │ │ └── userService.ts
143189│ └── types/
144- │ └── auth.ts # Auth type definitions
190+ │ ├── auth.ts
191+ │ ├── icon.ts
192+ │ └── locale.ts
193+ ├── tests/ # Test files
145194├── assets/ # Images and fonts
195+ ├── global.css # Global styles
146196├── app.json # Expo configuration
197+ ├── drizzle.config.ts # Drizzle Kit configuration
147198├── package.json # Dependencies
148199├── tailwind.config.js # NativeWind config
149200├── tsconfig.json # TypeScript config
@@ -152,6 +203,30 @@ react-native-crud/
152203
153204---
154205
206+ <h2 id =" database " >
207+ Database & Migrations
208+ </h2 >
209+
210+ This project uses ** Drizzle ORM** on top of ** Expo SQLite** for type-safe, local database operations.
211+
212+ ### Generating Migrations
213+
214+ After modifying the schema, run:
215+
216+ ``` bash
217+ bun run db:generate
218+ ```
219+
220+ This will generate SQL migration files inside the ` drizzle/ ` folder using Drizzle Kit.
221+
222+ ### Inspecting the Database with Drizzle Studio
223+
224+ With the development server running (` bun run dev ` ), press ` Shift + M ` in the terminal to open the Dev Tools menu, then select ** ` expo-drizzle-studio-plugin ` ** from the list. Drizzle Studio will open in a new browser tab, allowing you to browse and manage your local SQLite database visually.
225+
226+ > ** Note:** This plugin is available during native development only (iOS/Android). It does not work on Web.
227+
228+ ---
229+
155230<h2 id =" adding-components " >
156231 Adding Components
157232</h2 >
0 commit comments