@modhamanish/rn-mm-template 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.
Files changed (91) hide show
  1. package/MMTemplate/.bundle/config +2 -0
  2. package/MMTemplate/.eslintrc.js +4 -0
  3. package/MMTemplate/.prettierrc.js +5 -0
  4. package/MMTemplate/.watchmanconfig +1 -0
  5. package/MMTemplate/App.tsx +41 -0
  6. package/MMTemplate/Gemfile +16 -0
  7. package/MMTemplate/README.md +109 -0
  8. package/MMTemplate/__tests__/App.test.tsx +13 -0
  9. package/MMTemplate/_gitignore +79 -0
  10. package/MMTemplate/android/app/build.gradle +119 -0
  11. package/MMTemplate/android/app/debug.keystore +0 -0
  12. package/MMTemplate/android/app/proguard-rules.pro +10 -0
  13. package/MMTemplate/android/app/src/main/AndroidManifest.xml +27 -0
  14. package/MMTemplate/android/app/src/main/java/com/mmtemplate/MainActivity.kt +22 -0
  15. package/MMTemplate/android/app/src/main/java/com/mmtemplate/MainApplication.kt +27 -0
  16. package/MMTemplate/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  17. package/MMTemplate/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  18. package/MMTemplate/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  19. package/MMTemplate/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  20. package/MMTemplate/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  21. package/MMTemplate/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  22. package/MMTemplate/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  23. package/MMTemplate/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  24. package/MMTemplate/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  25. package/MMTemplate/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  26. package/MMTemplate/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  27. package/MMTemplate/android/app/src/main/res/values/strings.xml +3 -0
  28. package/MMTemplate/android/app/src/main/res/values/styles.xml +9 -0
  29. package/MMTemplate/android/build.gradle +21 -0
  30. package/MMTemplate/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  31. package/MMTemplate/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  32. package/MMTemplate/android/gradle.properties +44 -0
  33. package/MMTemplate/android/gradlew +251 -0
  34. package/MMTemplate/android/gradlew.bat +99 -0
  35. package/MMTemplate/android/settings.gradle +6 -0
  36. package/MMTemplate/app.json +4 -0
  37. package/MMTemplate/babel.config.js +8 -0
  38. package/MMTemplate/index.js +9 -0
  39. package/MMTemplate/ios/.xcode.env +11 -0
  40. package/MMTemplate/ios/MMTemplate/AppDelegate.swift +48 -0
  41. package/MMTemplate/ios/MMTemplate/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  42. package/MMTemplate/ios/MMTemplate/Images.xcassets/Contents.json +6 -0
  43. package/MMTemplate/ios/MMTemplate/Info.plist +55 -0
  44. package/MMTemplate/ios/MMTemplate/LaunchScreen.storyboard +47 -0
  45. package/MMTemplate/ios/MMTemplate/PrivacyInfo.xcprivacy +37 -0
  46. package/MMTemplate/ios/MMTemplate.xcodeproj/project.pbxproj +480 -0
  47. package/MMTemplate/ios/MMTemplate.xcodeproj/xcshareddata/xcschemes/MMTemplate.xcscheme +88 -0
  48. package/MMTemplate/ios/Podfile +38 -0
  49. package/MMTemplate/jest.config.js +3 -0
  50. package/MMTemplate/metro.config.js +11 -0
  51. package/MMTemplate/package.json +55 -0
  52. package/MMTemplate/src/assets/images/index.ts +4 -0
  53. package/MMTemplate/src/assets/images/logo-dark.png +0 -0
  54. package/MMTemplate/src/assets/images/logo.png +0 -0
  55. package/MMTemplate/src/components/AnimationView.tsx +113 -0
  56. package/MMTemplate/src/components/CustomToast.tsx +46 -0
  57. package/MMTemplate/src/components/FeatureItem.tsx +59 -0
  58. package/MMTemplate/src/components/FullScreenContainer.tsx +60 -0
  59. package/MMTemplate/src/components/InfoCard.tsx +61 -0
  60. package/MMTemplate/src/components/LanguageSwitcher.tsx +80 -0
  61. package/MMTemplate/src/components/TextInput.tsx +74 -0
  62. package/MMTemplate/src/components/ThemeSwitcher.tsx +63 -0
  63. package/MMTemplate/src/context/AuthContext.tsx +76 -0
  64. package/MMTemplate/src/context/ThemeContext.tsx +67 -0
  65. package/MMTemplate/src/locales/en.json +83 -0
  66. package/MMTemplate/src/locales/hi.json +83 -0
  67. package/MMTemplate/src/mock/index.ts +5 -0
  68. package/MMTemplate/src/navigation/AppNavigator.tsx +45 -0
  69. package/MMTemplate/src/navigation/AppStack.tsx +27 -0
  70. package/MMTemplate/src/navigation/AuthCheck.tsx +50 -0
  71. package/MMTemplate/src/navigation/AuthStack.tsx +24 -0
  72. package/MMTemplate/src/navigation/MainTab.tsx +50 -0
  73. package/MMTemplate/src/navigation/routes.ts +17 -0
  74. package/MMTemplate/src/screens/HomeScreen.tsx +296 -0
  75. package/MMTemplate/src/screens/LoginScreen.tsx +199 -0
  76. package/MMTemplate/src/screens/ProfileScreen.tsx +171 -0
  77. package/MMTemplate/src/screens/SettingsScreen.tsx +96 -0
  78. package/MMTemplate/src/screens/WelcomeScreen.tsx +215 -0
  79. package/MMTemplate/src/theme/Colors.ts +25 -0
  80. package/MMTemplate/src/types/components.types.ts +13 -0
  81. package/MMTemplate/src/types/navigation.types.ts +35 -0
  82. package/MMTemplate/src/utils/i18n.ts +28 -0
  83. package/MMTemplate/src/utils/navigationUtils.ts +72 -0
  84. package/MMTemplate/src/utils/storageHelper.ts +51 -0
  85. package/MMTemplate/src/utils/utilsHelper.ts +34 -0
  86. package/MMTemplate/src/utils/validationSchemas.ts +58 -0
  87. package/MMTemplate/tsconfig.json +8 -0
  88. package/README.md +108 -0
  89. package/package.json +22 -0
  90. package/script.js +62 -0
  91. package/template.config.js +11 -0
@@ -0,0 +1,83 @@
1
+ {
2
+ "common": {
3
+ "appName": "MMTemplate",
4
+ "welcome": "Welcome",
5
+ "logout": "Logout",
6
+ "cancel": "Cancel",
7
+ "confirm": "Confirm",
8
+ "save": "Save",
9
+ "edit": "Edit",
10
+ "delete": "Delete",
11
+ "back": "Back",
12
+ "next": "Next",
13
+ "done": "Done",
14
+ "loading": "Loading...",
15
+ "error": "Error",
16
+ "success": "Success",
17
+ "home": "Home",
18
+ "profile": "Profile"
19
+ },
20
+ "auth": {
21
+ "welcomeBack": "Welcome Back!",
22
+ "signInToContinue": "Sign in to continue",
23
+ "email": "Email",
24
+ "password": "Password",
25
+ "enterEmail": "Enter your email",
26
+ "enterPassword": "Enter your password",
27
+ "forgotPassword": "Forgot Password?",
28
+ "login": "Login",
29
+ "dontHaveAccount": "Don't have an account?",
30
+ "signUp": "Sign Up",
31
+ "invalidCredentials": "Invalid credentials",
32
+ "loginSuccessful": "Login successful",
33
+ "emailRequired": "Email is required",
34
+ "invalidEmail": "Invalid email address",
35
+ "passwordRequired": "Password is required",
36
+ "passwordMinLength": "Password must be at least 6 characters"
37
+ },
38
+ "profile": {
39
+ "profile": "Profile",
40
+ "accountInformation": "Account Information",
41
+ "name": "Name",
42
+ "email": "Email",
43
+ "logoutConfirmTitle": "Logout",
44
+ "logoutConfirmMessage": "Are you sure you want to logout?"
45
+ },
46
+ "home": {
47
+ "welcomeToTemplate": "Welcome to MMTemplate!",
48
+ "subtitle": "A modern React Native TypeScript boilerplate",
49
+ "quickStart": "Quick Start",
50
+ "quickStartDesc": "Get started with your new project in minutes:",
51
+ "projectStructure": "Project Structure",
52
+ "includedFeatures": "Included Features",
53
+ "bestPractices": "Best Practices",
54
+ "nextSteps": "Next Steps",
55
+ "happyCoding": "Happy Coding! 🚀",
56
+ "builtWith": "Built with ❤️ using MMTemplate",
57
+ "i18nSupport": "Internationalization",
58
+ "i18nDescription": "Multi-language support with react-i18next (English/Hindi)",
59
+ "themeDescription": "Light/Dark mode with persistence and toggle",
60
+ "authSupport": "Authentication Flow",
61
+ "authDescription": "Ready-to-use login, profile, and logout logic",
62
+ "storageSupport": "Fast Storage",
63
+ "storageDescription": "High-performance persistence with react-native-mmkv",
64
+ "localesDescription": "Translation files for multi-language support.",
65
+ "mockDescription": "Mock data for development and testing."
66
+ },
67
+ "settings": {
68
+ "settings": "Settings",
69
+ "customizeYourExperience": "Customize your experience",
70
+ "language": "Language",
71
+ "chooseYourPreferredLanguage": "Choose your preferred language",
72
+ "theme": "Theme",
73
+ "switchBetweenLightAndDark": "Switch between light and dark mode"
74
+ },
75
+ "welcome": {
76
+ "titleBold": "Welcome",
77
+ "titleText": " to",
78
+ "appName": "MM Template",
79
+ "subtitle": "A production-ready React Native boilerplate designed for high performance and developer productivity.",
80
+ "githubButton": "View on GitHub",
81
+ "loginButton": "Get Started"
82
+ }
83
+ }
@@ -0,0 +1,83 @@
1
+ {
2
+ "common": {
3
+ "appName": "MMTemplate",
4
+ "welcome": "स्वागत है",
5
+ "logout": "लॉग आउट",
6
+ "cancel": "रद्द करें",
7
+ "confirm": "पुष्टि करें",
8
+ "save": "सहेजें",
9
+ "edit": "संपादित करें",
10
+ "delete": "हटाएं",
11
+ "back": "वापस",
12
+ "next": "आगे",
13
+ "done": "पूर्ण",
14
+ "loading": "लोड हो रहा है...",
15
+ "error": "त्रुटि",
16
+ "success": "सफलता",
17
+ "home": "होम",
18
+ "profile": "प्रोफ़ाइल"
19
+ },
20
+ "auth": {
21
+ "welcomeBack": "वापसी पर स्वागत है!",
22
+ "signInToContinue": "जारी रखने के लिए साइन इन करें",
23
+ "email": "ईमेल",
24
+ "password": "पासवर्ड",
25
+ "enterEmail": "अपना ईमेल दर्ज करें",
26
+ "enterPassword": "अपना पासवर्ड दर्ज करें",
27
+ "forgotPassword": "पासवर्ड भूल गए?",
28
+ "login": "लॉगिन",
29
+ "dontHaveAccount": "खाता नहीं है?",
30
+ "signUp": "साइन अप करें",
31
+ "invalidCredentials": "अमान्य क्रेडेंशियल",
32
+ "loginSuccessful": "लॉगिन सफल",
33
+ "emailRequired": "ईमेल आवश्यक है",
34
+ "invalidEmail": "अमान्य ईमेल पता",
35
+ "passwordRequired": "पासवर्ड आवश्यक है",
36
+ "passwordMinLength": "पासवर्ड कम से कम 6 अक्षर का होना चाहिए"
37
+ },
38
+ "profile": {
39
+ "profile": "प्रोफ़ाइल",
40
+ "accountInformation": "खाता जानकारी",
41
+ "name": "नाम",
42
+ "email": "ईमेल",
43
+ "logoutConfirmTitle": "लॉग आउट",
44
+ "logoutConfirmMessage": "क्या आप वाकई लॉग आउट करना चाहते हैं?"
45
+ },
46
+ "home": {
47
+ "welcomeToTemplate": "MMTemplate में आपका स्वागत है!",
48
+ "subtitle": "एक आधुनिक React Native TypeScript बॉयलरप्लेट",
49
+ "quickStart": "त्वरित शुरुआत",
50
+ "quickStartDesc": "कुछ ही मिनटों में अपने नए प्रोजेक्ट के साथ शुरुआत करें:",
51
+ "projectStructure": "प्रोजेक्ट संरचना",
52
+ "includedFeatures": "शामिल सुविधाएं",
53
+ "bestPractices": "सर्वोत्तम प्रथाएं",
54
+ "nextSteps": "अगले कदम",
55
+ "happyCoding": "खुश कोडिंग! 🚀",
56
+ "builtWith": "MMTemplate का उपयोग करके ❤️ के साथ बनाया गया",
57
+ "i18nSupport": "अंतर्राष्ट्रीयकरण",
58
+ "i18nDescription": "react-i18next (अंग्रेजी/हिंदी) के साथ बहु-भाषा समर्थन",
59
+ "themeDescription": "दृढ़ता और टॉगल के साथ लाइट/डार्क मोड",
60
+ "authSupport": "प्रमाणीकरण प्रवाह",
61
+ "authDescription": "लॉगिन, प्रोफाइल और लॉगआउट लॉजिक उपयोग के लिए तैयार",
62
+ "storageSupport": "तेज़ स्टोरेज",
63
+ "storageDescription": "react-native-mmkv के साथ उच्च प्रदर्शन दृढ़ता",
64
+ "localesDescription": "बहु-भाषा समर्थन के लिए अनुवाद फ़ाइलें।",
65
+ "mockDescription": "विकास और परीक्षण के लिए मॉक डेटा।"
66
+ },
67
+ "settings": {
68
+ "settings": "सेटिंग्स",
69
+ "customizeYourExperience": "अपने अनुभव को अनुकूलित करें",
70
+ "language": "भाषा",
71
+ "chooseYourPreferredLanguage": "अपनी पसंदीदा भाषा चुनें",
72
+ "theme": "थीम",
73
+ "switchBetweenLightAndDark": "लाइट और डार्क मोड के बीच स्विच करें"
74
+ },
75
+ "welcome": {
76
+ "titleBold": "स्वागत है",
77
+ "titleText": " ",
78
+ "appName": "MM Template में",
79
+ "subtitle": "एक प्रोडक्शन-रेडी React Native बॉयलरप्लेट जिसे उच्च प्रदर्शन और डेवलपर उत्पादकता के लिए डिज़ाइन किया गया है।",
80
+ "githubButton": "GitHub पर देखें",
81
+ "loginButton": "शुरू करें"
82
+ }
83
+ }
@@ -0,0 +1,5 @@
1
+ export const userMockData = {
2
+ email: 'user@gmail.com',
3
+ password: '123456',
4
+ name: 'User Name',
5
+ };
@@ -0,0 +1,45 @@
1
+ import React, { FC } from 'react';
2
+ import { NavigationContainer } from '@react-navigation/native';
3
+ import { createNativeStackNavigator } from '@react-navigation/native-stack';
4
+
5
+ import { RootStackParamList } from '../types/navigation.types';
6
+ import { navigationRef } from '../utils/navigationUtils';
7
+
8
+ import Routes from './routes';
9
+
10
+ import AuthCheck from './AuthCheck';
11
+ import AuthStack from './AuthStack';
12
+ import AppStack from './AppStack';
13
+
14
+ const Stack = createNativeStackNavigator<RootStackParamList>();
15
+
16
+ const AppNavigator: FC = () => {
17
+ return (
18
+ <NavigationContainer ref={navigationRef}>
19
+ <Stack.Navigator
20
+ initialRouteName={Routes.AuthCheck}
21
+ screenOptions={{
22
+ headerShown: false,
23
+ }}
24
+ >
25
+ <Stack.Screen
26
+ options={{ animation: 'fade' }}
27
+ name={Routes.AuthCheck}
28
+ component={AuthCheck}
29
+ />
30
+ <Stack.Screen
31
+ options={{ animation: 'fade' }}
32
+ name={Routes.AuthStack}
33
+ component={AuthStack}
34
+ />
35
+ <Stack.Screen
36
+ options={{ animation: 'fade' }}
37
+ name={Routes.AppStack}
38
+ component={AppStack}
39
+ />
40
+ </Stack.Navigator>
41
+ </NavigationContainer>
42
+ );
43
+ };
44
+
45
+ export default AppNavigator;
@@ -0,0 +1,27 @@
1
+ import React, { FC } from 'react';
2
+ import { createNativeStackNavigator } from '@react-navigation/native-stack';
3
+
4
+ import Routes from './routes';
5
+ import { AppStackParamList } from '../types/navigation.types';
6
+
7
+ // Screens
8
+ import MainTab from './MainTab';
9
+ import SettingsScreen from '../screens/SettingsScreen';
10
+
11
+ const Stack = createNativeStackNavigator<AppStackParamList>();
12
+
13
+ const AppStack: FC = () => {
14
+ return (
15
+ <Stack.Navigator
16
+ initialRouteName={Routes.MainTab}
17
+ screenOptions={{
18
+ headerShown: false,
19
+ }}
20
+ >
21
+ <Stack.Screen name={Routes.MainTab} component={MainTab} />
22
+ <Stack.Screen name={Routes.SettingsScreen} component={SettingsScreen} />
23
+ </Stack.Navigator>
24
+ );
25
+ };
26
+
27
+ export default AppStack;
@@ -0,0 +1,50 @@
1
+ import { StyleSheet, Image } from 'react-native';
2
+ import React, { FC, useEffect } from 'react';
3
+ import { useTheme } from '../context/ThemeContext';
4
+ import { ThemeType } from '../theme/Colors';
5
+ import { Images } from '../assets/images';
6
+ import { resetAndNavigate } from '../utils/navigationUtils';
7
+ import Routes from './routes';
8
+ import FullScreenContainer from '../components/FullScreenContainer';
9
+ import { mobileScreenHeight, mobileScreenWidth } from '../utils/utilsHelper';
10
+ import { useAuth } from '../context/AuthContext';
11
+
12
+ const AuthCheck: FC = () => {
13
+ const theme = useTheme();
14
+ const { isUserLoggedIn } = useAuth();
15
+ const styles = getStyles(theme);
16
+
17
+ useEffect(() => {
18
+ setTimeout(() => {
19
+ resetAndNavigate(isUserLoggedIn() ? Routes.AppStack : Routes.AuthStack);
20
+ }, 1500);
21
+ }, [isUserLoggedIn]);
22
+
23
+ return (
24
+ <FullScreenContainer
25
+ edges={[]}
26
+ style={styles.container}
27
+ statusBarHidden
28
+ barStyle="light-content"
29
+ >
30
+ <Image source={Images.logo} style={styles.logo} />
31
+ </FullScreenContainer>
32
+ );
33
+ };
34
+
35
+ export default AuthCheck;
36
+
37
+ const getStyles = ({ colors }: ThemeType) =>
38
+ StyleSheet.create({
39
+ container: {
40
+ flex: 1,
41
+ backgroundColor: colors.primary,
42
+ },
43
+ logo: {
44
+ alignSelf: 'center',
45
+ height: mobileScreenHeight,
46
+ width: mobileScreenWidth * 0.6,
47
+ resizeMode: 'contain',
48
+ tintColor: colors.white,
49
+ },
50
+ });
@@ -0,0 +1,24 @@
1
+ import React, { FC } from 'react';
2
+ import { createNativeStackNavigator } from '@react-navigation/native-stack';
3
+ import Routes from './routes';
4
+ import { AuthStackParamList } from '../types/navigation.types';
5
+ import WelcomeScreen from '../screens/WelcomeScreen';
6
+ import LoginScreen from '../screens/LoginScreen';
7
+
8
+ const Stack = createNativeStackNavigator<AuthStackParamList>();
9
+
10
+ const AuthStack: FC = () => {
11
+ return (
12
+ <Stack.Navigator
13
+ initialRouteName={Routes.WelcomeScreen}
14
+ screenOptions={{
15
+ headerShown: false,
16
+ }}
17
+ >
18
+ <Stack.Screen name={Routes.WelcomeScreen} component={WelcomeScreen} />
19
+ <Stack.Screen name={Routes.LoginScreen} component={LoginScreen} />
20
+ </Stack.Navigator>
21
+ );
22
+ };
23
+
24
+ export default AuthStack;
@@ -0,0 +1,50 @@
1
+ import React, { FC } from 'react';
2
+ import { Text } from 'react-native';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
5
+ import Routes from './routes';
6
+ import { MainTabParamList } from '../types/navigation.types';
7
+ import HomeScreen from '../screens/HomeScreen';
8
+ import ProfileScreen from '../screens/ProfileScreen';
9
+ import { useTheme } from '../context/ThemeContext';
10
+
11
+ const BottomTab = createBottomTabNavigator<MainTabParamList>();
12
+
13
+ const MainTab: FC = () => {
14
+ const { t } = useTranslation();
15
+ const theme = useTheme();
16
+
17
+ return (
18
+ <BottomTab.Navigator
19
+ screenOptions={{
20
+ headerShown: false,
21
+ tabBarHideOnKeyboard: true,
22
+ tabBarStyle: {
23
+ backgroundColor: theme.colors.backgroundColor,
24
+ borderTopColor: theme.colors.textColor + '20',
25
+ },
26
+ tabBarActiveTintColor: theme.colors.primary,
27
+ tabBarInactiveTintColor: theme.colors.textColor + '80',
28
+ }}
29
+ >
30
+ <BottomTab.Screen
31
+ name={Routes.HomeScreen}
32
+ component={HomeScreen}
33
+ options={{
34
+ tabBarLabel: t('common.home'),
35
+ tabBarIcon: () => <Text>🏠</Text>,
36
+ }}
37
+ />
38
+ <BottomTab.Screen
39
+ name={Routes.ProfileScreen}
40
+ component={ProfileScreen}
41
+ options={{
42
+ tabBarLabel: t('common.profile'),
43
+ tabBarIcon: () => <Text>👤</Text>,
44
+ }}
45
+ />
46
+ </BottomTab.Navigator>
47
+ );
48
+ };
49
+
50
+ export default MainTab;
@@ -0,0 +1,17 @@
1
+ enum Routes {
2
+ AuthCheck = 'AuthCheck',
3
+ AuthStack = 'AuthStack',
4
+ AppStack = 'AppStack',
5
+ MainTab = 'MainTab',
6
+
7
+ // Auth Stack Screens
8
+ WelcomeScreen = 'WelcomeScreen',
9
+ LoginScreen = 'LoginScreen',
10
+
11
+ // App Stack Screens
12
+ HomeScreen = 'HomeScreen',
13
+ ProfileScreen = 'ProfileScreen',
14
+ SettingsScreen = 'SettingsScreen',
15
+ }
16
+
17
+ export default Routes;