@umituz/react-native-auth 3.4.32 β†’ 3.4.34

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.
Files changed (30) hide show
  1. package/README.md +347 -348
  2. package/package.json +2 -3
  3. package/src/application/README.md +323 -442
  4. package/src/domain/ConfigAndErrors.md +296 -431
  5. package/src/domain/README.md +361 -210
  6. package/src/domain/entities/AuthUser.md +231 -372
  7. package/src/domain/entities/UserProfile.md +271 -441
  8. package/src/index.ts +35 -0
  9. package/src/infrastructure/README.md +388 -444
  10. package/src/infrastructure/services/README.md +386 -312
  11. package/src/infrastructure/utils/validation/BaseValidators.ts +35 -0
  12. package/src/infrastructure/utils/validation/CollectionValidators.ts +56 -0
  13. package/src/infrastructure/utils/validation/DateValidators.ts +63 -0
  14. package/src/infrastructure/utils/validation/FormValidators.ts +22 -0
  15. package/src/infrastructure/utils/validation/NumberValidators.ts +55 -0
  16. package/src/infrastructure/utils/validation/StringValidators.ts +55 -0
  17. package/src/infrastructure/utils/validation/sanitization.ts +98 -0
  18. package/src/infrastructure/utils/validation/types.ts +15 -0
  19. package/src/presentation/README.md +631 -563
  20. package/src/presentation/components/ProfileComponents.md +307 -504
  21. package/src/presentation/components/README.md +254 -92
  22. package/src/presentation/hooks/README.md +247 -83
  23. package/src/presentation/hooks/useAccountManagement.md +295 -344
  24. package/src/presentation/hooks/useAuth.md +271 -227
  25. package/src/presentation/hooks/useAuthBottomSheet.md +417 -367
  26. package/src/presentation/hooks/useAuthRequired.md +308 -194
  27. package/src/presentation/hooks/useProfileUpdate.md +251 -279
  28. package/src/presentation/hooks/useSocialLogin.md +312 -287
  29. package/src/presentation/hooks/useUserProfile.md +259 -192
  30. package/src/presentation/screens/README.md +151 -153
package/README.md CHANGED
@@ -1,426 +1,425 @@
1
1
  # @umituz/react-native-auth
2
2
 
3
- > Authentication service for React Native apps - Secure, type-safe, and production-ready. Provider-agnostic design with dependency injection, configurable validation, and comprehensive error handling.
3
+ Authentication service for React Native applications with secure, type-safe, and production-ready implementation.
4
4
 
5
- [![npm version](https://badge.fury.io/js/%40umituz%2Freact-native-auth.svg)](https://www.npmjs.com/package/@umituz/react-native-auth)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ ---
6
+
7
+ ## Strategy
8
+
9
+ **Purpose**: Provides comprehensive authentication solution for React Native apps with Domain-Driven Design architecture, supporting multiple authentication methods and providers.
10
+
11
+ **When to Use**:
12
+ - Building React Native apps requiring authentication
13
+ - Need multiple auth methods (email, social, anonymous)
14
+ - Want type-safe auth implementation
15
+ - Prefer DDD architecture
16
+ - Need production-ready auth solution
17
+
18
+ **Package Location**: `/src`
19
+
20
+ **Documentation**: See `/src/[layer]/README.md` for detailed documentation
21
+
22
+ ---
7
23
 
8
- ## Features
24
+ ## Core Features
9
25
 
10
- - πŸ” **Multiple Auth Methods** - Email/Password, Google, Apple, Anonymous
11
- - 🎯 **Type-Safe** - Written in TypeScript with full type definitions
12
- - πŸ—οΈ **DDD Architecture** - Domain-Driven Design with clean separation of concerns
13
- - πŸ”Œ **Provider Agnostic** - Easy to swap auth providers (Firebase, custom backend, etc.)
14
- - ⚑ **React Hooks** - Simple and intuitive React hooks for auth operations
15
- - 🎨 **UI Components** - Pre-built authentication screens and components
16
- - πŸ“± **React Native Ready** - Optimized for iOS and Android
17
- - πŸ”’ **Secure** - Built-in validation and error handling
26
+ ### Authentication Methods
27
+
28
+ **SUPPORTED METHODS**:
29
+ - Email/Password authentication
30
+ - Google OAuth integration
31
+ - Apple Sign-In (iOS)
32
+ - Anonymous user sessions
33
+ - Account upgrade (anonymous β†’ registered)
34
+
35
+ ### Architecture
36
+
37
+ **DOMAIN-DRIVEN DESIGN LAYERS**:
38
+ - **Domain**: Core business logic and entities
39
+ - **Application**: Use cases and interfaces
40
+ - **Infrastructure**: External integrations
41
+ - **Presentation**: UI components and hooks
42
+
43
+ ---
18
44
 
19
45
  ## Installation
20
46
 
47
+ ### Package Installation
48
+
49
+ **NPM**:
21
50
  ```bash
22
51
  npm install @umituz/react-native-auth
23
- # or
52
+ ```
53
+
54
+ **Yarn**:
55
+ ```bash
24
56
  yarn add @umituz/react-native-auth
25
57
  ```
26
58
 
27
- ## Peer Dependencies
59
+ ### Peer Dependencies
28
60
 
29
- ```json
30
- {
31
- "firebase": ">=11.0.0",
32
- "react": ">=18.2.0",
33
- "react-native": ">=0.74.0",
34
- "@tanstack/react-query": ">=5.0.0",
35
- "zustand": ">=4.0.0"
36
- }
37
- ```
61
+ **REQUIRED PACKAGES**:
62
+ - `firebase`: >= 11.0.0
63
+ - `react`: >= 18.2.0
64
+ - `react-native`: >= 0.74.0
65
+ - `@tanstack/react-query`: >= 5.0.0
66
+ - `zustand`: >= 4.0.0
38
67
 
39
- ## Quick Start
68
+ **EXTERNAL DEPENDENCIES**:
69
+ - `@umituz/react-native-firebase` - Firebase integration
70
+ - `@umituz/react-native-design-system` - UI components
40
71
 
41
- ### 1. Initialize Auth
72
+ ---
42
73
 
43
- Wrap your app with `AuthProvider` and initialize auth:
74
+ ## Configuration
44
75
 
45
- ```typescript
46
- import React, { useEffect } from 'react';
47
- import { AuthProvider, initializeAuth } from '@umituz/react-native-auth';
48
- import { getAuth } from 'firebase/auth';
49
- import { NavigationContainer } from '@react-navigation/native';
50
- import { createNativeStackNavigator } from '@react-navigation/native-stack';
51
-
52
- // Initialize auth (call once in app root)
53
- initializeAuth({
54
- onAuthStateChanged: (user) => {
55
- console.log('Auth state changed:', user);
56
- },
57
- });
58
-
59
- function App() {
60
- return (
61
- <AuthProvider>
62
- <NavigationContainer>
63
- <Stack.Navigator>
64
- <Stack.Screen name="Login" component={LoginScreen} />
65
- <Stack.Screen name="Home" component={HomeScreen} />
66
- </Stack.Navigator>
67
- </NavigationContainer>
68
- </AuthProvider>
69
- );
70
- }
71
- ```
76
+ ### Firebase Setup
72
77
 
73
- ### 2. Use Auth Hook
78
+ **Rules**:
79
+ - MUST create Firebase project
80
+ - MUST enable Authentication
81
+ - MUST enable Firestore (for user documents)
82
+ - MUST configure OAuth providers
74
83
 
75
- ```typescript
76
- import { useAuth } from '@umituz/react-native-auth';
77
- import { View, Text, Button } from 'react-native';
78
-
79
- function LoginScreen() {
80
- const { signIn, loading, error } = useAuth();
81
-
82
- const handleLogin = async () => {
83
- try {
84
- await signIn('user@example.com', 'password123');
85
- // Navigate to home
86
- } catch (err) {
87
- // Error is automatically set in error state
88
- }
89
- };
90
-
91
- return (
92
- <View>
93
- <Button onPress={handleLogin} disabled={loading}>
94
- {loading ? 'Signing in...' : 'Sign In'}
95
- </Button>
96
- {error && <Text>{error}</Text>}
97
- </View>
98
- );
99
- }
100
- ```
84
+ **MUST NOT**:
85
+ - Skip Firebase console setup
86
+ - Use production keys in development
87
+ - Forget to enable required providers
101
88
 
102
- ### 3. Protect Routes
89
+ **Steps**:
90
+ 1. Create Firebase project at console.firebase.google.com
91
+ 2. Enable Authentication
92
+ 3. Enable Google Sign-In
93
+ 4. Enable Apple Sign-In (for iOS)
94
+ 5. Enable Firestore
95
+ 6. Download config files
103
96
 
104
- ```typescript
105
- import { useAuthRequired } from '@umituz/react-native-auth';
106
-
107
- function ProtectedComponent() {
108
- const { isAllowed, checkAndRequireAuth } = useAuthRequired();
109
-
110
- const handleAction = () => {
111
- if (checkAndRequireAuth()) {
112
- // User is authenticated, proceed with action
113
- console.log('Action performed');
114
- }
115
- // If not authenticated, auth modal is shown automatically
116
- };
117
-
118
- return (
119
- <Button onPress={handleAction}>
120
- {isAllowed ? 'Perform Action' : 'Sign In to Continue'}
121
- </Button>
122
- );
123
- }
124
- ```
97
+ ---
125
98
 
126
- ## Social Login
99
+ ## Layer Overview
127
100
 
128
- ### Google Sign-In
101
+ ### Domain Layer
129
102
 
130
- ```typescript
131
- import { useGoogleAuth } from '@umituz/react-native-auth';
132
-
133
- function GoogleLoginButton() {
134
- const { signInWithGoogle, googleLoading } = useGoogleAuth({
135
- iosClientId: 'your-ios-client-id.apps.googleusercontent.com',
136
- webClientId: 'your-web-client-id.apps.googleusercontent.com',
137
- });
138
-
139
- return (
140
- <Button onPress={signInWithGoogle} disabled={googleLoading}>
141
- Sign in with Google
142
- </Button>
143
- );
144
- }
145
- ```
103
+ **Location**: `src/domain/`
146
104
 
147
- ### Apple Sign-In
105
+ **Purpose**: Core business logic and entities
148
106
 
149
- ```typescript
150
- import { useAppleAuth } from '@umituz/react-native-auth';
107
+ **CONTAINS**:
108
+ - `AuthUser` entity
109
+ - `UserProfile` entity
110
+ - `AuthConfig` value object
111
+ - `AuthError` hierarchy
151
112
 
152
- function AppleLoginButton() {
153
- const { signInWithApple, appleLoading, appleAvailable } = useAppleAuth();
113
+ **Documentation**: `src/domain/README.md`
154
114
 
155
- if (!appleAvailable) return null;
115
+ ---
156
116
 
157
- return (
158
- <Button onPress={signInWithApple} disabled={appleLoading}>
159
- Sign in with Apple
160
- </Button>
161
- );
162
- }
163
- ```
117
+ ### Application Layer
164
118
 
165
- ## Pre-built Screens
119
+ **Location**: `src/application/`
166
120
 
167
- Use pre-built authentication screens:
121
+ **Purpose**: Use cases and interfaces
168
122
 
169
- ```typescript
170
- import { LoginScreen, RegisterScreen, AccountScreen } from '@umituz/react-native-auth';
123
+ **CONTAINS**:
124
+ - Authentication ports
125
+ - User profile ports
126
+ - Account management ports
171
127
 
172
- <Stack.Screen
173
- name="Login"
174
- component={LoginScreen}
175
- options={{ headerShown: false }}
176
- />
177
- ```
128
+ **Documentation**: `src/application/README.md`
178
129
 
179
- ## User Profile
130
+ ---
180
131
 
181
- ### Display Profile
132
+ ### Infrastructure Layer
182
133
 
183
- ```typescript
184
- import { useUserProfile } from '@umituz/react-native-auth';
185
-
186
- function ProfileHeader() {
187
- const profile = useUserProfile({
188
- accountRoute: '/account',
189
- });
190
-
191
- if (!profile) return <LoadingSpinner />;
192
-
193
- return (
194
- <View>
195
- <Avatar source={{ uri: profile.avatarUrl }} />
196
- <Text>{profile.displayName}</Text>
197
- {profile.isAnonymous && <Badge>Guest</Badge>}
198
- </View>
199
- );
200
- }
201
- ```
134
+ **Location**: `src/infrastructure/`
202
135
 
203
- ### Update Profile
136
+ **Purpose**: External integrations and implementations
204
137
 
205
- ```typescript
206
- import { useProfileUpdate } from '@umituz/react-native-auth';
207
-
208
- function EditProfileScreen() {
209
- const { updateProfile, isUpdating } = useProfileUpdate();
210
-
211
- const handleSave = async (data) => {
212
- try {
213
- await updateProfile({
214
- displayName: data.name,
215
- photoURL: data.avatarUrl,
216
- });
217
- } catch (error) {
218
- Alert.alert('Error', 'Failed to update profile');
219
- }
220
- };
221
-
222
- return <ProfileForm onSave={handleSave} loading={isUpdating} />;
223
- }
224
- ```
138
+ **CONTAINS**:
139
+ - Firebase Auth service
140
+ - Firestore repositories
141
+ - Validation utilities
142
+ - Provider implementations
143
+
144
+ **Documentation**:
145
+ - `src/infrastructure/README.md`
146
+ - `src/infrastructure/services/README.md`
147
+
148
+ ---
149
+
150
+ ### Presentation Layer
225
151
 
226
- ## Account Management
152
+ **Location**: `src/presentation/`
227
153
 
228
- ### Delete Account
154
+ **Purpose**: UI components and hooks
229
155
 
156
+ **CONTAINS**:
157
+ - React hooks for auth
158
+ - Pre-built components
159
+ - Screen components
160
+ - State management (Zustand)
161
+
162
+ **Documentation**:
163
+ - `src/presentation/README.md`
164
+ - `src/presentation/hooks/README.md`
165
+ - `src/presentation/components/README.md`
166
+ - `src/presentation/screens/README.md`
167
+
168
+ ---
169
+
170
+ ## Usage Guidelines
171
+
172
+ ### Authentication Hooks
173
+
174
+ **PRIMARY HOOK**: `useAuth`
175
+ **Location**: `src/presentation/hooks/useAuth.ts`
176
+
177
+ **When to Use**:
178
+ - Need authentication state
179
+ - Require user information
180
+ - Performing auth operations
181
+ - Checking auth status
182
+
183
+ **Import Path**:
230
184
  ```typescript
231
- import { useAccountManagement } from '@umituz/react-native-auth';
232
-
233
- function AccountSettings() {
234
- const { deleteAccount, logout } = useAccountManagement({
235
- onReauthRequired: async () => {
236
- // Show re-authentication UI
237
- const result = await showReauthDialog();
238
- return result.success;
239
- },
240
- });
241
-
242
- return (
243
- <View>
244
- <Button onPress={logout}>Sign Out</Button>
245
- <Button onPress={deleteAccount}>Delete Account</Button>
246
- </View>
247
- );
248
- }
185
+ import { useAuth } from '@umituz/react-native-auth';
249
186
  ```
250
187
 
251
- ## Validation
188
+ **Rules**:
189
+ - MUST initialize AuthProvider before use
190
+ - MUST handle loading state
191
+ - MUST check auth readiness
192
+ - MUST handle errors appropriately
252
193
 
253
- ### Password Validation
194
+ ---
254
195
 
196
+ ### Components
197
+
198
+ **AVAILABLE COMPONENTS**:
199
+ - `LoginForm` - Email/password login
200
+ - `RegisterForm` - User registration
201
+ - `SocialLoginButtons` - Google/Apple buttons
202
+ - `ProfileSection` - Profile display
203
+ - `AccountActions` - Account management
204
+
205
+ **Import Path**:
255
206
  ```typescript
256
207
  import {
257
- validatePasswordForRegister,
258
- validatePasswordConfirmation,
208
+ LoginForm,
209
+ RegisterForm,
210
+ SocialLoginButtons
259
211
  } from '@umituz/react-native-auth';
260
-
261
- // Validate password
262
- const result = validatePasswordForRegister('MyPass123!');
263
-
264
- if (result.isValid) {
265
- console.log('Password is strong');
266
- } else {
267
- console.log('Requirements:', result.requirements);
268
- // {
269
- // hasMinLength: true,
270
- // hasUppercase: true,
271
- // hasLowercase: true,
272
- // hasNumber: true,
273
- // hasSpecialChar: true
274
- // }
275
- }
276
-
277
- // Validate password confirmation
278
- const matchResult = validatePasswordConfirmation('pass123', 'pass123');
279
- // { isValid: true, matches: true }
280
212
  ```
281
213
 
282
- ### Email Validation
214
+ **Rules**:
215
+ - MUST follow component documentation
216
+ - MUST provide required props
217
+ - MUST handle events appropriately
218
+ - MUST NOT override internal logic
283
219
 
284
- ```typescript
285
- import { validateEmail } from '@umituz/react-native-auth';
220
+ ---
286
221
 
287
- const result = validateEmail('user@example.com');
288
- // { isValid: true }
289
- ```
222
+ ## Platform Support
290
223
 
291
- ## Configuration
224
+ ### Supported Platforms
292
225
 
293
- ### Auth Config
226
+ **iOS**: βœ… Full support
227
+ - All authentication methods
228
+ - Apple Sign-In available
229
+ - Google Sign-In available
294
230
 
295
- ```typescript
296
- import { DEFAULT_AUTH_CONFIG } from '@umituz/react-native-auth';
297
-
298
- const customConfig: AuthConfig = {
299
- password: {
300
- minLength: 12,
301
- requireUppercase: true,
302
- requireLowercase: true,
303
- requireNumber: true,
304
- requireSpecialChar: true,
305
- },
306
- social: {
307
- google: {
308
- enabled: true,
309
- webClientId: Config.GOOGLE_WEB_CLIENT_ID,
310
- iosClientId: Config.GOOGLE_IOS_CLIENT_ID,
311
- },
312
- apple: {
313
- enabled: Platform.OS === 'ios',
314
- },
315
- },
316
- };
317
- ```
231
+ **Android**: βœ… Full support
232
+ - All authentication methods (except Apple)
233
+ - Google Sign-In available
318
234
 
319
- ## Architecture
235
+ **Web**: βœ… Full support
236
+ - All authentication methods (except Apple)
237
+ - Google Sign-In available
320
238
 
321
- This package follows **Domain-Driven Design (DDD)** principles with clean architecture:
239
+ ---
322
240
 
323
- ```
324
- src/
325
- β”œβ”€β”€ domain/ # Business logic and entities
326
- β”‚ β”œβ”€β”€ entities/ # AuthUser, UserProfile
327
- β”‚ β”œβ”€β”€ value-objects/# AuthConfig, PasswordConfig
328
- β”‚ β”œβ”€β”€ errors/ # AuthError classes
329
- β”‚ └── utils/ # Domain utilities
330
- β”œβ”€β”€ application/ # Interfaces and ports
331
- β”‚ └── ports/ # IAuthService, IAuthProvider
332
- β”œβ”€β”€ infrastructure/ # External integrations
333
- β”‚ β”œβ”€β”€ providers/ # Firebase implementation
334
- β”‚ β”œβ”€β”€ services/ # AuthService, UserDocumentService
335
- β”‚ └── utils/ # Validation, storage adapters
336
- └── presentation/ # UI layer
337
- β”œβ”€β”€ hooks/ # React hooks
338
- β”œβ”€β”€ components/ # React components
339
- β”œβ”€β”€ screens/ # Full screens
340
- β”œβ”€β”€ stores/ # State management (Zustand)
341
- └── navigation/ # Navigation setup
342
- ```
241
+ ## Security Requirements
343
242
 
344
- ## API Reference
243
+ ### Rules
345
244
 
346
- ### Hooks
245
+ **MUST**:
246
+ - Validate all inputs
247
+ - Use HTTPS for all operations
248
+ - Implement proper error handling
249
+ - Follow Firebase security best practices
250
+ - Use secure token storage
251
+ - Validate tokens server-side
347
252
 
348
- | Hook | Description |
349
- |------|-------------|
350
- | `useAuth` | Main auth state and operations |
351
- | `useAuthRequired` | Check auth requirements |
352
- | `useRequireAuth` | Get userId or throw |
353
- | `useUserProfile` | Fetch user profile |
354
- | `useProfileUpdate` | Update profile |
355
- | `useProfileEdit` | Profile editing form state |
356
- | `useAccountManagement` | Account operations |
357
- | `useSocialLogin` | Social login management |
358
- | `useGoogleAuth` | Google authentication |
359
- | `useAppleAuth` | Apple authentication |
360
- | `useAuthBottomSheet` | Auth bottom sheet management |
253
+ **MUST NOT**:
254
+ - Store tokens in AsyncStorage
255
+ - Log passwords or tokens
256
+ - Expose sensitive data in errors
257
+ - Skip validation
258
+ - Use HTTP for auth operations
361
259
 
362
- ### Components
260
+ ---
261
+
262
+ ## Architecture Principles
263
+
264
+ ### Domain-Driven Design
265
+
266
+ **PRINCIPLES**:
267
+ - Business logic in domain layer
268
+ - Infrastructure concerns isolated
269
+ - Presentation layer UI-focused
270
+ - Application layer orchestrates
271
+
272
+ **BENEFITS**:
273
+ - Testable business logic
274
+ - Swappable providers
275
+ - Clear separation of concerns
276
+ - Maintainable codebase
277
+
278
+ ---
279
+
280
+ ## Error Handling
281
+
282
+ ### Strategy
283
+
284
+ **Purpose**: Comprehensive error handling throughout application.
285
+
286
+ **Rules**:
287
+ - MUST handle auth errors gracefully
288
+ - MUST show user-friendly messages
289
+ - MUST allow retry after failures
290
+ - MUST log errors for debugging
291
+ - MUST not expose sensitive data
292
+
293
+ **Error Hierarchy**:
294
+ - `AuthError` - Base error class
295
+ - `ValidationError` - Input validation errors
296
+ - `AuthenticationError` - Auth operation errors
297
+ - `NetworkError` - Network issues
298
+
299
+ ---
300
+
301
+ ## Validation Strategy
302
+
303
+ ### Purpose
304
+
305
+ **Purpose**: Ensure data integrity and security.
306
+
307
+ **Rules**:
308
+ - MUST validate email format
309
+ - MUST validate password complexity
310
+ - MUST validate required fields
311
+ - MUST provide clear error messages
312
+ - MUST prevent invalid submissions
313
+
314
+ **Validation Location**: `src/infrastructure/utils/AuthValidation.ts`
363
315
 
364
- | Component | Description |
365
- |-----------|-------------|
366
- | `LoginForm` | Login form |
367
- | `RegisterForm` | Registration form |
368
- | `SocialLoginButtons` | Social login buttons |
369
- | `PasswordStrengthIndicator` | Password strength visualizer |
370
- | `PasswordMatchIndicator` | Password match indicator |
371
- | `ProfileSection` | User profile display |
372
- | `AccountActions` | Account action buttons |
373
-
374
- ### Services
375
-
376
- | Service | Description |
377
- |---------|-------------|
378
- | `AuthService` | Main auth service |
379
- | `initializeAuth` | Auth initialization |
380
- | `UserDocumentService` | Firestore user documents |
381
- | `AnonymousModeService` | Anonymous authentication |
382
-
383
- ## Documentation
384
-
385
- - [Domain Layer](./src/domain/README.md) - Business logic and entities
386
- - [Application Layer](./src/application/README.md) - Interfaces and ports
387
- - [Infrastructure Layer](./src/infrastructure/README.md) - External integrations
388
- - [Presentation Layer](./src/presentation/README.md) - UI components and hooks
389
- - [Hooks Documentation](./src/presentation/hooks/README.md) - All hooks
390
- - [Components Documentation](./src/presentation/components/README.md) - All components
391
- - [Screens Documentation](./src/presentation/screens/README.md) - Pre-built screens
392
- - [Services Documentation](./src/infrastructure/services/README.md) - Core services
393
-
394
- ## Examples
395
-
396
- Check out the [examples](./examples) directory for complete implementations:
397
-
398
- - [Basic Auth](./examples/basic-auth) - Simple email/password auth
399
- - [Social Auth](./examples/social-auth) - Google and Apple sign-in
400
- - [Protected Routes](./examples/protected-routes) - Route protection
401
- - [Profile Management](./examples/profile-management) - User profile operations
316
+ ---
317
+
318
+ ## Migration Guide
319
+
320
+ ### From Previous Versions
321
+
322
+ **Breaking Changes**:
323
+ - See changelog for details
324
+ - Follow migration steps
325
+ - Update component props
326
+ - Update hook usage
327
+
328
+ **Rules**:
329
+ - MUST read migration guide
330
+ - MUST test thoroughly after upgrade
331
+ - MUST update dependencies
332
+ - MUST check deprecated features
333
+
334
+ ---
335
+
336
+ ## Performance Considerations
337
+
338
+ ### Optimization
339
+
340
+ **Rules**:
341
+ - MUST memoize expensive computations
342
+ - MUST minimize re-renders
343
+ - MUST optimize state updates
344
+ - MUST use efficient selectors
345
+
346
+ **Constraints**:
347
+ - Auth state single source of truth
348
+ - Minimal network requests
349
+ - Efficient validation checks
350
+ - Optimized component rendering
351
+
352
+ ---
353
+
354
+ ## Testing Strategy
355
+
356
+ ### Unit Testing
357
+
358
+ **WHAT TO TEST**:
359
+ - Domain logic and entities
360
+ - Validation utilities
361
+ - Hook behavior
362
+ - Component rendering
363
+
364
+ **RULES**:
365
+ - MUST test auth operations
366
+ - MUST test validation
367
+ - MUST test error handling
368
+ - MUST mock Firebase dependencies
369
+
370
+ ---
402
371
 
403
372
  ## Contributing
404
373
 
405
- Contributions are welcome! Please read our [Contributing Guide](./CONTRIBUTING.md) for details.
374
+ ### Development Setup
375
+
376
+ **RULES**:
377
+ - MUST follow DDD principles
378
+ - MUST maintain type safety
379
+ - MUST update documentation
380
+ - MUST add tests for new features
381
+ - MUST follow existing patterns
382
+
383
+ **MUST NOT**:
384
+ - Break DDD layer boundaries
385
+ - Skip documentation
386
+ - Add code without tests
387
+ - Introduce breaking changes without major version bump
388
+
389
+ ---
406
390
 
407
391
  ## License
408
392
 
409
- MIT © [Ümit UZ](https://github.com/umituz)
393
+ MIT License - See LICENSE file for details
394
+
395
+ ---
396
+
397
+ ## Support and Documentation
410
398
 
411
- ## Support
399
+ ### Documentation Structure
412
400
 
413
- - πŸ“§ Email: umit@umituz.com
414
- - 🐦 Twitter: [@umituz](https://twitter.com/umituz)
415
- - πŸ’» GitHub: [umituz/react-native-auth](https://github.com/umituz/react-native-auth)
401
+ **MAIN README**: This file
416
402
 
417
- ## Related Packages
403
+ **LAYER DOCUMENTATION**:
404
+ - `src/domain/README.md` - Domain layer details
405
+ - `src/application/README.md` - Application layer details
406
+ - `src/infrastructure/README.md` - Infrastructure details
407
+ - `src/presentation/README.md` - Presentation layer details
418
408
 
419
- - [@umituz/react-native-firebase](https://github.com/umituz/react-native-firebase) - Firebase integration
420
- - [@umituz/react-native-localization](https://github.com/umituz/react-native-localization) - Localization
421
- - [@umituz/react-native-storage](https://github.com/umituz/react-native-storage) - Storage abstraction
422
- - [@umituz/react-native-tanstack](https://github.com/umituz/react-native-tanstack) - TanStack Query integration
409
+ **COMPONENT/HOOK DOCUMENTATION**:
410
+ - Each component has dedicated .md file
411
+ - Each hook has dedicated .md file
412
+ - Follows Strategy/Rules/Constraints format
413
+
414
+ ### Getting Help
415
+
416
+ - Read documentation first
417
+ - Check existing issues
418
+ - Review examples in docs
419
+ - Follow AI agent guidelines
423
420
 
424
421
  ---
425
422
 
426
- Made with ❀️ by [Ümit UZ](https://umituz.com)
423
+ ## Changelog
424
+
425
+ See CHANGELOG.md for version history and changes.