create-mobile-app 0.0.0-stage โ 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +496 -2
- package/assets/adaptive-icon.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/icon.png +0 -0
- package/assets/splash.png +0 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +2119 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.js +2119 -0
- package/package.json +64 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DevMinds Technologies <contact@devminds.in>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,497 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ๐ create-mobile-app
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **Create a production-ready React Native + TypeScript mobile application in one command.**
|
|
4
|
+
> Powered by **Expo SDK 57 (Default)**, modern **Node.js 20+**, dynamic responsive scaling via **[`react-native-dynamic-responsive`](https://www.npmjs.com/package/react-native-dynamic-responsive)**, enterprise modular architecture, and zero-headache setup.
|
|
5
|
+
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://www.npmjs.com/package/create-mobile-app">
|
|
8
|
+
<img src="https://img.shields.io/npm/v/create-mobile-app.svg?style=flat-square&color=cb3837&label=npm" alt="npm version" />
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://www.npmjs.com/package/create-mobile-app">
|
|
11
|
+
<img src="https://img.shields.io/npm/dw/create-mobile-app.svg?style=flat-square&color=44cc11&label=downloads" alt="downloads" />
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://gitlab.com/code_dharmendra/create-mobile-app">
|
|
14
|
+
<img src="https://img.shields.io/gitlab/stars/code_dharmendra%2Fcreate-mobile-app?style=flat-square&color=fc6d26&logo=gitlab" alt="gitlab stars" />
|
|
15
|
+
</a>
|
|
16
|
+
<a href="https://gitlab.com/code_dharmendra/create-mobile-app/-/issues">
|
|
17
|
+
<img src="https://img.shields.io/gitlab/issues/open/code_dharmendra%2Fcreate-mobile-app?style=flat-square&color=e24329&logo=gitlab&label=issues" alt="gitlab issues" />
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://gitlab.com/code_dharmendra/create-mobile-app/-/blob/main/LICENSE">
|
|
20
|
+
<img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="license" />
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://www.typescriptlang.org/">
|
|
23
|
+
<img src="https://img.shields.io/badge/typescript-ready-3178c6.svg?style=flat-square&logo=typescript&logoColor=white" alt="typescript" />
|
|
24
|
+
</a>
|
|
25
|
+
<a href="https://expo.dev/">
|
|
26
|
+
<img src="https://img.shields.io/badge/expo-compatible-8547c6.svg?style=flat-square&logo=expo&logoColor=white" alt="expo" />
|
|
27
|
+
</a>
|
|
28
|
+
<a href="https://reactnative.dev/">
|
|
29
|
+
<img src="https://img.shields.io/badge/react--native-compatible-2088ff.svg?style=flat-square&logo=react&logoColor=white" alt="react-native" />
|
|
30
|
+
</a>
|
|
31
|
+
<a href="https://nodejs.org/">
|
|
32
|
+
<img src="https://img.shields.io/badge/node-%3E%3D20.0.0-339933.svg?style=flat-square&logo=node.js&logoColor=white" alt="node" />
|
|
33
|
+
</a>
|
|
34
|
+
<a href="https://devminds.in">
|
|
35
|
+
<img src="https://img.shields.io/badge/Maintained%20by-DevMinds%20Technologies-6366f1?style=flat-square" alt="DevMinds Technologies" />
|
|
36
|
+
</a>
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## ๐ Table of Contents
|
|
42
|
+
|
|
43
|
+
- [Why create-mobile-app?](#-why-create-mobile-app)
|
|
44
|
+
- [Ecosystem & Best Packages Used](#-ecosystem--best-packages-used)
|
|
45
|
+
- [Quick Start](#-quick-start)
|
|
46
|
+
- [Interactive Prompts](#-interactive-prompts)
|
|
47
|
+
- [CLI Options & Flags](#-cli-options--flags)
|
|
48
|
+
- [Enterprise Architecture & Folder Structure](#-enterprise-architecture--folder-structure)
|
|
49
|
+
- [Code Examples & Architecture Guides](#-code-examples--architecture-guides)
|
|
50
|
+
- [1. Dynamic Responsive UI & Layouts](#1-dynamic-responsive-ui--layouts)
|
|
51
|
+
- [2. Light, Dark & System Theme Engine](#2-light-dark--system-theme-engine)
|
|
52
|
+
- [3. Production UI Component Library](#3-production-ui-component-library)
|
|
53
|
+
- [4. Typed Navigation (Stack, 5 Tabs & Drawer)](#4-typed-navigation-stack-5-tabs--drawer)
|
|
54
|
+
- [5. Centralized API Client & TanStack Query v5](#5-centralized-api-client--tanstack-query-v5)
|
|
55
|
+
- [6. Authentication & Guest Mode](#6-authentication--guest-mode)
|
|
56
|
+
- [Developer & Contribution Guide](#-developer--contribution-guide)
|
|
57
|
+
- [Troubleshooting & FAQ](#-troubleshooting--faq)
|
|
58
|
+
- [Credits & Author](#-credits--author)
|
|
59
|
+
- [License](#-license)
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## ๐ก Why `create-mobile-app`?
|
|
64
|
+
|
|
65
|
+
Starting a production-grade React Native app usually takes days of repetitive boilerplate work: configuring navigation stacks, setting up dark/light themes, solving tablet/foldable responsive layouts, creating reusable inputs and buttons, wiring API interceptors, setting up caching with TanStack React Query, and fixing native SDK dependency mismatch warnings.
|
|
66
|
+
|
|
67
|
+
`create-mobile-app` eliminates all this setup friction:
|
|
68
|
+
- โก **Zero-to-Running in 30 Seconds**: Run one command and start building features immediately.
|
|
69
|
+
- ๐ **First-Class Responsive Engine**: Built-in support for phones, landscape, tablets, and foldable screens with `react-native-dynamic-responsive`.
|
|
70
|
+
- ๐ก๏ธ **Zero Version-Mismatch Doctor Warnings**: Downloads the official template for your target Expo SDK, aligning `expo`, `react`, and `react-native` versions perfectly.
|
|
71
|
+
- ๐ **Zero Obfuscation or Hidden Binaries**: Fully inspectable, MIT-licensed open-source TypeScript code conforming to GitHub and GitLab security standards.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## ๐ฆ Ecosystem & Best Packages Used
|
|
76
|
+
|
|
77
|
+
Every generated application integrates industry-standard, battle-tested packages:
|
|
78
|
+
|
|
79
|
+
| Purpose | Package | Why It's the Best Choice |
|
|
80
|
+
| :--- | :--- | :--- |
|
|
81
|
+
| **Responsive Design** | [`react-native-dynamic-responsive`](https://www.npmjs.com/package/react-native-dynamic-responsive) | Zero-runtime dependency, reactive to orientation, foldables & tablets with `useStyles`. |
|
|
82
|
+
| **State & API Cache** | [`@tanstack/react-query`](https://tanstack.com/query/latest) v5 | Industry standard for async state, pagination, caching, and retry logic. |
|
|
83
|
+
| **Navigation** | [`@react-navigation/native`](https://reactnavigation.org/) v7 | Declarative, typed routing with Native Stack, 5 Bottom Tabs, and Slide-out Drawer. |
|
|
84
|
+
| **Persistent Storage** | [`@react-native-async-storage/async-storage`](https://react-native-async-storage.github.io/async-storage/) | Reliable key-value persistence for tokens, preferences, and offline caching. |
|
|
85
|
+
| **Mobile Runtime** | [`expo`](https://expo.dev/) (SDK 57 default) | Modern developer experience, EAS build support, and web/iOS/Android universal runtimes. |
|
|
86
|
+
| **Language & Tooling** | `TypeScript` 5+ & `Node.js` 20+ | Strict type safety, auto-completion, and error-free build execution. |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## ๐ Quick Start
|
|
91
|
+
|
|
92
|
+
Generate your app in any directory with `npx`:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npx create-mobile-app my-app
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### โก Instant Setup with Production Defaults (`--yes`)
|
|
99
|
+
Skip questions and immediately scaffold an enterprise app with Expo SDK 57:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx create-mobile-app my-app --yes
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### ๐ฏ Target Specific Expo SDK Version
|
|
106
|
+
Supports any modern Expo SDK:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Expo SDK 57 (Recommended Default)
|
|
110
|
+
npx create-mobile-app my-app --sdk 57
|
|
111
|
+
|
|
112
|
+
# Latest Expo SDK 58
|
|
113
|
+
npx create-mobile-app my-app --sdk 58
|
|
114
|
+
|
|
115
|
+
# Earlier versions (e.g., 54, 52 LTS)
|
|
116
|
+
npx create-mobile-app my-app --sdk 54
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### ๐ฆ Specify Preferred Package Manager
|
|
120
|
+
```bash
|
|
121
|
+
# npm, yarn, pnpm, or bun
|
|
122
|
+
npx create-mobile-app my-app --pm pnpm
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## ๐ Interactive Prompts
|
|
128
|
+
|
|
129
|
+
When run without flags, `create-mobile-app` guides you through an intuitive, interactive setup:
|
|
130
|
+
|
|
131
|
+
```text
|
|
132
|
+
? Project name: my-app
|
|
133
|
+
? Select Platform: Expo (Recommended) / React Native CLI
|
|
134
|
+
? Select Expo SDK Version: SDK 57 (Recommended)
|
|
135
|
+
? Include dynamic responsive system (react-native-dynamic-responsive)? Yes
|
|
136
|
+
? Include Theme system (Light/Dark/System)? Yes
|
|
137
|
+
? Include Reusable UI Component library (CText, CBox, CButton, CInput, CDropdown)? Yes
|
|
138
|
+
? Include Navigation (Stack, 5 Tabs, Drawer)? Yes
|
|
139
|
+
? Include Centralized API Client (Axios/Fetch with interceptors)? Yes
|
|
140
|
+
? Include TanStack React Query v5? Yes
|
|
141
|
+
? Include Domain Service architecture (Auth, User, Home, Profile)? Yes
|
|
142
|
+
? Include Authentication Context & Session State? Yes
|
|
143
|
+
? Enable Guest Mode support? Yes
|
|
144
|
+
? Include Async Storage layer? Yes
|
|
145
|
+
? Include Husky, Prettier, and Lint-Staged pre-commit checks? Yes
|
|
146
|
+
? Include Demo Screen examples? Yes
|
|
147
|
+
? Select Package Manager: auto (detects npm, pnpm, yarn, bun)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## ๐๏ธ CLI Options & Flags
|
|
153
|
+
|
|
154
|
+
| Flag | Type | Default | Description |
|
|
155
|
+
| :--- | :---: | :---: | :--- |
|
|
156
|
+
| `-y, --yes` | `boolean` | `false` | Generate immediately using production defaults |
|
|
157
|
+
| `--platform <type>` | `string` | `expo` | Target platform (`expo` or `cli`) |
|
|
158
|
+
| `--sdk <version>` | `string` | `~57.0.0` | Target Expo SDK version (`57`, `58`, `54`, `52`) |
|
|
159
|
+
| `--responsive / --no-responsive` | `boolean` | `true` | Include `react-native-dynamic-responsive` system |
|
|
160
|
+
| `--theme / --no-theme` | `boolean` | `true` | Include Light / Dark / System theme engine |
|
|
161
|
+
| `--components / --no-components` | `boolean` | `true` | Include UI library (`CText`, `CBox`, `CButton`, etc.) |
|
|
162
|
+
| `--navigation / --no-navigation` | `boolean` | `true` | Include Navigation Architecture |
|
|
163
|
+
| `--tabs / --no-tabs` | `boolean` | `true` | Include 5 Bottom Tabs Navigation |
|
|
164
|
+
| `--drawer / --no-drawer` | `boolean` | `true` | Include Drawer Navigation |
|
|
165
|
+
| `--api / --no-api` | `boolean` | `true` | Include API Client Architecture |
|
|
166
|
+
| `--query / --no-query` | `boolean` | `true` | Include TanStack React Query v5 layer |
|
|
167
|
+
| `--service / --no-service` | `boolean` | `true` | Include Domain Service architecture |
|
|
168
|
+
| `--auth / --no-auth` | `boolean` | `true` | Include Auth Context & Session Management |
|
|
169
|
+
| `--guest / --no-guest` | `boolean` | `true` | Include Guest Mode support |
|
|
170
|
+
| `--storage / --no-storage` | `boolean` | `true` | Include AsyncStorage key-value abstraction |
|
|
171
|
+
| `--husky / --no-husky` | `boolean` | `true` | Include Husky, Prettier & Lint-Staged git hooks |
|
|
172
|
+
| `--examples / --no-examples` | `boolean` | `true` | Include sample screens (Home, Profile, Search, etc.) |
|
|
173
|
+
| `--pm <manager>` | `string` | `auto` | Package manager: `npm`, `yarn`, `pnpm`, or `bun` |
|
|
174
|
+
| `-V, --version` | `boolean` | - | Display current version |
|
|
175
|
+
| `-h, --help` | `boolean` | - | Display help documentation |
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## ๐ Enterprise Architecture & Folder Structure
|
|
180
|
+
|
|
181
|
+
Every generated project uses a clean modular structure designed for enterprise scale:
|
|
182
|
+
|
|
183
|
+
```text
|
|
184
|
+
my-app/
|
|
185
|
+
โโโ assets/ # App Icon, Splash Screen, Adaptive Icon, Favicon
|
|
186
|
+
โโโ app.json # Expo application config & splash branding
|
|
187
|
+
โโโ App.tsx # Root provider composition (Theme, Auth, Query, Navigation)
|
|
188
|
+
โโโ babel.config.js # Path alias configuration (@/ -> src/)
|
|
189
|
+
โโโ tsconfig.json # Strict TypeScript config with root aliases
|
|
190
|
+
โโโ src/
|
|
191
|
+
โโโ api/ # Centralized HTTP client, interceptors & error handlers
|
|
192
|
+
โ โโโ client.ts # Generic client with auth headers and normalized errors
|
|
193
|
+
โ โโโ queryKeys.ts # Type-safe TanStack Query key factory
|
|
194
|
+
โโโ auth/ # Authentication & Session Management
|
|
195
|
+
โ โโโ AuthContext.tsx # Auth provider, token storage, login/logout, guest mode
|
|
196
|
+
โ โโโ useAuth.ts # Hook to access user session and guest flags
|
|
197
|
+
โโโ components/ # Reusable UI component library
|
|
198
|
+
โ โโโ common/ # CText, CBox, CInput, CButton, CDropdown
|
|
199
|
+
โ โโโ alert/ # Global AlertProvider and useAlert hook
|
|
200
|
+
โโโ config/ # Environment variables & constants
|
|
201
|
+
โโโ constant/ # Spacing, Font families, and Layout metrics
|
|
202
|
+
โโโ hooks/ # Custom React hooks (useDebounce, useNetworkStatus)
|
|
203
|
+
โโโ navigations/ # Typed navigation architecture
|
|
204
|
+
โ โโโ RootNavigator.tsx # Auth vs Main app conditional routing
|
|
205
|
+
โ โโโ BottomTabNavigator.tsx # 5 Configured Bottom Tabs with icons & badges
|
|
206
|
+
โ โโโ DrawerNavigator.tsx # Slide-out Drawer navigation
|
|
207
|
+
โโโ screen/ # Screen views
|
|
208
|
+
โ โโโ HomeScreen.tsx # Home feed screen
|
|
209
|
+
โ โโโ SearchScreen.tsx # Search & filter view
|
|
210
|
+
โ โโโ NotificationScreen.tsx # Notifications list
|
|
211
|
+
โ โโโ ProfileScreen.tsx # User profile & theme settings
|
|
212
|
+
โ โโโ SettingsScreen.tsx # App settings & preferences
|
|
213
|
+
โ โโโ LoginScreen.tsx # Sign In & Guest Mode screen
|
|
214
|
+
โโโ service/ # Domain API services
|
|
215
|
+
โ โโโ authService.ts # Login, Register, Refresh Token
|
|
216
|
+
โ โโโ userService.ts # Profile and user queries
|
|
217
|
+
โ โโโ homeService.ts # Dashboard & feed queries
|
|
218
|
+
โโโ storage/ # AsyncStorage persistent key-value abstraction layer
|
|
219
|
+
โโโ theme/ # Light / Dark / System theme engine & color tokens
|
|
220
|
+
โโโ types/ # Shared TypeScript models and navigation contracts
|
|
221
|
+
โโโ utils/ # Utilities (Date, Mobile Number, Currency, Validation)
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## ๐ป Code Examples & Architecture Guides
|
|
227
|
+
|
|
228
|
+
### 1. Dynamic Responsive UI & Layouts
|
|
229
|
+
|
|
230
|
+
Using [`react-native-dynamic-responsive`](https://www.npmjs.com/package/react-native-dynamic-responsive), styles dynamically adapt to screen size changes, rotation, tablets, and foldables:
|
|
231
|
+
|
|
232
|
+
```tsx
|
|
233
|
+
import React from 'react';
|
|
234
|
+
import { View } from 'react-native';
|
|
235
|
+
import { useStyles, useResponsive } from 'react-native-dynamic-responsive';
|
|
236
|
+
import { CText } from '@/components/common/CText';
|
|
237
|
+
|
|
238
|
+
export const AdaptiveCard = () => {
|
|
239
|
+
const { isTablet, isLandscape } = useResponsive();
|
|
240
|
+
const styles = useStyles(createStyles);
|
|
241
|
+
|
|
242
|
+
return (
|
|
243
|
+
<View style={styles.card}>
|
|
244
|
+
<CText variant="header">
|
|
245
|
+
{isTablet ? 'Tablet Viewport' : 'Mobile Viewport'}
|
|
246
|
+
</CText>
|
|
247
|
+
<CText variant="caption">
|
|
248
|
+
Orientation: {isLandscape ? 'Landscape' : 'Portrait'}
|
|
249
|
+
</CText>
|
|
250
|
+
</View>
|
|
251
|
+
);
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
const createStyles = (r: any) => ({
|
|
255
|
+
card: {
|
|
256
|
+
width: r.isTablet ? r.wp(45) : r.wp(90),
|
|
257
|
+
padding: r.ms(16),
|
|
258
|
+
borderRadius: r.s(12),
|
|
259
|
+
backgroundColor: '#ffffff',
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
### 2. Light, Dark & System Theme Engine
|
|
267
|
+
|
|
268
|
+
Synchronize styles with system preference or manually toggle themes:
|
|
269
|
+
|
|
270
|
+
```tsx
|
|
271
|
+
import React from 'react';
|
|
272
|
+
import { View } from 'react-native';
|
|
273
|
+
import { useStyles } from 'react-native-dynamic-responsive';
|
|
274
|
+
import { useTheme } from '@/theme';
|
|
275
|
+
import { CText } from '@/components/common/CText';
|
|
276
|
+
import { CButton } from '@/components/common/CButton';
|
|
277
|
+
|
|
278
|
+
export const ThemeSwitcherCard = () => {
|
|
279
|
+
const { theme, isDark, toggleTheme } = useTheme();
|
|
280
|
+
const styles = useStyles(createStyles, theme);
|
|
281
|
+
|
|
282
|
+
return (
|
|
283
|
+
<View style={styles.container}>
|
|
284
|
+
<CText variant="title">Current Theme: {isDark ? 'Dark' : 'Light'}</CText>
|
|
285
|
+
<CButton
|
|
286
|
+
title="Toggle Theme"
|
|
287
|
+
variant="primary"
|
|
288
|
+
onPress={toggleTheme}
|
|
289
|
+
/>
|
|
290
|
+
</View>
|
|
291
|
+
);
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
const createStyles = (r: any, theme: any) => ({
|
|
295
|
+
container: {
|
|
296
|
+
backgroundColor: theme.colors.card,
|
|
297
|
+
padding: r.ms(16),
|
|
298
|
+
borderRadius: r.s(12),
|
|
299
|
+
},
|
|
300
|
+
});
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
### 3. Production UI Component Library
|
|
306
|
+
|
|
307
|
+
Pre-configured components ready for production use:
|
|
308
|
+
|
|
309
|
+
```tsx
|
|
310
|
+
import React, { useState } from 'react';
|
|
311
|
+
import { CBox } from '@/components/common/CBox';
|
|
312
|
+
import { CText } from '@/components/common/CText';
|
|
313
|
+
import { CInput } from '@/components/common/CInput';
|
|
314
|
+
import { CButton } from '@/components/common/CButton';
|
|
315
|
+
import { useAlert } from '@/components/alert/AlertProvider';
|
|
316
|
+
|
|
317
|
+
export const RegistrationForm = () => {
|
|
318
|
+
const [email, setEmail] = useState('');
|
|
319
|
+
const { showAlert } = useAlert();
|
|
320
|
+
|
|
321
|
+
const handleSave = () => {
|
|
322
|
+
showAlert({
|
|
323
|
+
title: 'Success',
|
|
324
|
+
message: 'User profile registered successfully!',
|
|
325
|
+
type: 'success',
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
return (
|
|
330
|
+
<CBox padding={16} borderRadius={12} backgroundColor="#F8FAFC">
|
|
331
|
+
<CText variant="header">Create Account</CText>
|
|
332
|
+
<CInput
|
|
333
|
+
label="Email Address"
|
|
334
|
+
placeholder="user@example.com"
|
|
335
|
+
value={email}
|
|
336
|
+
onChangeText={setEmail}
|
|
337
|
+
/>
|
|
338
|
+
<CButton title="Submit" variant="primary" onPress={handleSave} />
|
|
339
|
+
</CBox>
|
|
340
|
+
);
|
|
341
|
+
};
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
### 4. Typed Navigation (Stack, 5 Tabs & Drawer)
|
|
347
|
+
|
|
348
|
+
Pre-wired navigation setup with strictly typed parameters:
|
|
349
|
+
|
|
350
|
+
```tsx
|
|
351
|
+
import { NativeStackScreenProps } from '@react-navigation/native-stack';
|
|
352
|
+
import { RootStackParamList } from '@/types/navigation';
|
|
353
|
+
|
|
354
|
+
type Props = NativeStackScreenProps<RootStackParamList, 'Profile'>;
|
|
355
|
+
|
|
356
|
+
export const ProfileScreen = ({ navigation, route }: Props) => {
|
|
357
|
+
return (
|
|
358
|
+
<CBox flex={1} padding={16}>
|
|
359
|
+
<CText variant="title">User Profile</CText>
|
|
360
|
+
<CButton
|
|
361
|
+
title="Open Settings"
|
|
362
|
+
onPress={() => navigation.navigate('Settings')}
|
|
363
|
+
/>
|
|
364
|
+
</CBox>
|
|
365
|
+
);
|
|
366
|
+
};
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
### 5. Centralized API Client & TanStack Query v5
|
|
372
|
+
|
|
373
|
+
Fetch data cleanly with automatic caching, normalized error handling, and type safety:
|
|
374
|
+
|
|
375
|
+
```tsx
|
|
376
|
+
import { useQuery } from '@tanstack/react-query';
|
|
377
|
+
import { queryKeys } from '@/api/queryKeys';
|
|
378
|
+
import { homeService } from '@/service/homeService';
|
|
379
|
+
import { CText } from '@/components/common/CText';
|
|
380
|
+
import { CBox } from '@/components/common/CBox';
|
|
381
|
+
|
|
382
|
+
export const DashboardFeed = () => {
|
|
383
|
+
const { data, isLoading, error } = useQuery({
|
|
384
|
+
queryKey: queryKeys.home.dashboard(),
|
|
385
|
+
queryFn: () => homeService.getDashboardData(),
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
if (isLoading) return <CText>Loading feed...</CText>;
|
|
389
|
+
if (error) return <CText color="red">Failed to load feed</CText>;
|
|
390
|
+
|
|
391
|
+
return (
|
|
392
|
+
<CBox>
|
|
393
|
+
<CText variant="subtitle">{data?.title}</CText>
|
|
394
|
+
</CBox>
|
|
395
|
+
);
|
|
396
|
+
};
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
### 6. Authentication & Guest Mode
|
|
402
|
+
|
|
403
|
+
Authenticate users, store tokens safely in AsyncStorage, and support guest access:
|
|
404
|
+
|
|
405
|
+
```tsx
|
|
406
|
+
import React from 'react';
|
|
407
|
+
import { useAuth } from '@/auth/useAuth';
|
|
408
|
+
import { CBox } from '@/components/common/CBox';
|
|
409
|
+
import { CText } from '@/components/common/CText';
|
|
410
|
+
import { CButton } from '@/components/common/CButton';
|
|
411
|
+
|
|
412
|
+
export const SessionStatus = () => {
|
|
413
|
+
const { user, isGuest, isAuthenticated, loginAsGuest, logout } = useAuth();
|
|
414
|
+
|
|
415
|
+
return (
|
|
416
|
+
<CBox padding={16}>
|
|
417
|
+
{isAuthenticated ? (
|
|
418
|
+
<>
|
|
419
|
+
<CText>{isGuest ? 'Logged in as Guest' : `Welcome, ${user?.email}`}</CText>
|
|
420
|
+
<CButton title="Logout" variant="outline" onPress={logout} />
|
|
421
|
+
</>
|
|
422
|
+
) : (
|
|
423
|
+
<CButton title="Continue as Guest" variant="secondary" onPress={loginAsGuest} />
|
|
424
|
+
)}
|
|
425
|
+
</CBox>
|
|
426
|
+
);
|
|
427
|
+
};
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
---
|
|
431
|
+
|
|
432
|
+
## ๐ ๏ธ Developer & Contribution Guide
|
|
433
|
+
|
|
434
|
+
### Local Development Setup
|
|
435
|
+
|
|
436
|
+
To contribute to or modify `create-mobile-app`:
|
|
437
|
+
|
|
438
|
+
1. **Clone the repository**:
|
|
439
|
+
```bash
|
|
440
|
+
git clone git@gitlab.com:code_dharmendra/create-mobile-app.git
|
|
441
|
+
cd create-mobile-app
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
2. **Install dependencies**:
|
|
445
|
+
```bash
|
|
446
|
+
npm install
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
3. **Build the CLI**:
|
|
450
|
+
```bash
|
|
451
|
+
npm run build
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
4. **Run the Vitest test suite**:
|
|
455
|
+
```bash
|
|
456
|
+
npm test
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
5. **Test the CLI locally**:
|
|
460
|
+
```bash
|
|
461
|
+
npm start my-test-app
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
## ๐ก Troubleshooting & FAQ
|
|
467
|
+
|
|
468
|
+
#### Q: How does Expo dependency alignment work?
|
|
469
|
+
`create-mobile-app` downloads the official Expo blank template matching your target SDK (default SDK 57). It keeps the native package versions (`expo`, `react`, `react-native`, `expo-status-bar`) completely intact, guaranteeing **zero version mismatch warnings** when running `npx expo-doctor`.
|
|
470
|
+
|
|
471
|
+
#### Q: Which Node.js version is required?
|
|
472
|
+
Node.js **`>=20.0.0`** is required. We recommend the latest LTS release of Node 20 or Node 22.
|
|
473
|
+
|
|
474
|
+
#### Q: Can I use this with React Native CLI instead of Expo?
|
|
475
|
+
Yes! Pass `--platform cli` to scaffold a React Native Community CLI foundation:
|
|
476
|
+
```bash
|
|
477
|
+
npx create-mobile-app my-app --platform cli
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## ๐จโ๐ป Credits & Author
|
|
483
|
+
|
|
484
|
+
Developed and maintained with โค๏ธ by **[DevMinds Technologies](https://devminds.in)**.
|
|
485
|
+
|
|
486
|
+
- ๐ข **Organization**: **DevMinds Technologies** *(WEB ยท MOBILE ยท CLOUD ยท DESIGN)*
|
|
487
|
+
- ๐ **Website**: [devminds.in](https://devminds.in)
|
|
488
|
+
- ๐ผ **Portfolio**: [devminds.in/portfolio](https://devminds.in/portfolio)
|
|
489
|
+
- ๐จโ๐ป **Lead Architect**: **[Dharmendra (Dev) kumar](https://www.linkedin.com/in/dharmendra-appdeveloper)** *(Mobile & Full Stack Architect)*
|
|
490
|
+
- โ๏ธ **Inquiries & Custom Software**: [contact@devminds.in](mailto:contact@devminds.in)
|
|
491
|
+
|
|
492
|
+
---
|
|
493
|
+
|
|
494
|
+
## ๐ License
|
|
495
|
+
|
|
496
|
+
This project is licensed under the **MIT License** — see the [LICENSE](LICENSE) file for details.
|
|
497
|
+
Copyright (c) 2026 **DevMinds Technologies** & **Dharmendra (Dev) kumar**.
|
|
Binary file
|
|
Binary file
|
package/assets/icon.png
ADDED
|
Binary file
|
|
Binary file
|
package/dist/cli.d.ts
ADDED