@digilogiclabs/create-saas-app 1.5.3 → 1.6.0

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 (56) hide show
  1. package/CHANGELOG.md +109 -49
  2. package/bin/index.js +1 -1
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/templates/mobile/base/template/App.tsx +113 -23
  5. package/dist/templates/mobile/base/template/package.json +41 -38
  6. package/dist/templates/web/base/template/package.json +2 -2
  7. package/dist/templates/web/base/template/src/app/checkout/page.tsx +99 -8
  8. package/dist/templates/web/base/template/src/app/dashboard/page.tsx +309 -0
  9. package/dist/templates/web/base/template/src/app/globals.css +97 -0
  10. package/dist/templates/web/base/template/src/app/login/page.tsx +36 -8
  11. package/dist/templates/web/base/template/src/app/page.tsx +123 -83
  12. package/dist/templates/web/base/template/src/app/signup/page.tsx +36 -8
  13. package/dist/templates/web/base/template/src/components/shared/header.tsx +49 -30
  14. package/dist/templates/web/ui-auth/template/package.json +3 -3
  15. package/dist/templates/web/ui-auth/template/src/app/page.tsx +203 -61
  16. package/dist/templates/web/ui-auth-payments/template/package.json +3 -3
  17. package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +253 -87
  18. package/dist/templates/web/ui-auth-payments/template/src/app/globals.css +129 -0
  19. package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +246 -74
  20. package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +106 -40
  21. package/dist/templates/web/ui-auth-payments-audio/template/package.json +3 -3
  22. package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +221 -82
  23. package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +132 -40
  24. package/dist/templates/web/ui-auth-payments-video/template/package.json +3 -3
  25. package/dist/templates/web/ui-auth-payments-video/template/src/app/globals.css +146 -0
  26. package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +259 -85
  27. package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +133 -41
  28. package/dist/templates/web/ui-only/template/package.json +1 -1
  29. package/package.json +106 -106
  30. package/src/templates/mobile/base/template/App.tsx +113 -23
  31. package/src/templates/mobile/base/template/package.json +41 -38
  32. package/src/templates/web/base/template/package.json +2 -2
  33. package/src/templates/web/base/template/src/app/checkout/page.tsx +99 -8
  34. package/src/templates/web/base/template/src/app/dashboard/page.tsx +309 -0
  35. package/src/templates/web/base/template/src/app/globals.css +97 -0
  36. package/src/templates/web/base/template/src/app/login/page.tsx +36 -8
  37. package/src/templates/web/base/template/src/app/page.tsx +123 -83
  38. package/src/templates/web/base/template/src/app/signup/page.tsx +36 -8
  39. package/src/templates/web/base/template/src/components/shared/header.tsx +49 -30
  40. package/src/templates/web/ui-auth/template/package.json +3 -3
  41. package/src/templates/web/ui-auth/template/src/app/page.tsx +203 -61
  42. package/src/templates/web/ui-auth-payments/template/package.json +3 -3
  43. package/src/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +253 -87
  44. package/src/templates/web/ui-auth-payments/template/src/app/globals.css +129 -0
  45. package/src/templates/web/ui-auth-payments/template/src/app/page.tsx +246 -74
  46. package/src/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +106 -40
  47. package/src/templates/web/ui-auth-payments-audio/template/package.json +3 -3
  48. package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +221 -82
  49. package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +132 -40
  50. package/src/templates/web/ui-auth-payments-video/template/package.json +3 -3
  51. package/src/templates/web/ui-auth-payments-video/template/src/app/globals.css +146 -0
  52. package/src/templates/web/ui-auth-payments-video/template/src/app/page.tsx +259 -85
  53. package/src/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +133 -41
  54. package/src/templates/web/ui-only/template/package.json +1 -1
  55. package/dist/index.js +0 -1173
  56. package/dist/index.js.map +0 -1
@@ -5,35 +5,92 @@ import { SafeAreaProvider } from 'react-native-safe-area-context';
5
5
  import { AuthProvider, useAuth } from '@digilogiclabs/saas-factory-auth/native';
6
6
  import { StripeProvider } from '@digilogiclabs/saas-factory-payments/native';
7
7
  import { Link, Slot } from 'expo-router';
8
+ import {
9
+ NativePageTransition as PageTransition,
10
+ NativeMobileHero as MobileHero,
11
+ NativeMobileContainer as MobileContainer,
12
+ NativeNetworkAwareContent as NetworkAwareContent,
13
+ NativeOfflineWrapper as OfflineWrapper,
14
+ useNetworkInfo,
15
+ useOfflineState
16
+ } from '@digilogiclabs/saas-factory-ui/native';
8
17
 
9
18
  function AppContent() {
10
19
  const { user, signOut } = useAuth();
20
+ const networkInfo = useNetworkInfo();
21
+ const isOnline = useOfflineState();
11
22
 
12
23
  return (
13
- <View style={styles.container}>
14
- {user ? (
15
- <>
16
- <Text style={styles.title}>Welcome back!</Text>
17
- <Text style={styles.subtitle}>You are signed in.</Text>
18
- <Link href="/checkout" style={styles.link}>
19
- <Text>Checkout</Text>
20
- </Link>
21
- <Button title="Sign Out" onPress={signOut} />
22
- </>
23
- ) : (
24
- <>
25
- <Text style={styles.title}>Welcome to {{titleCaseName}}</Text>
26
- <Text style={styles.subtitle}>{{description}}</Text>
27
- <Link href="/login" style={styles.link}>
28
- <Text>Login</Text>
29
- </Link>
30
- <Link href="/signup" style={styles.link}>
31
- <Text>Sign Up</Text>
32
- </Link>
33
- </>
34
- )}
24
+ <PageTransition type="fade" duration={300}>
25
+ <OfflineWrapper
26
+ cacheStrategy="stale-while-revalidate"
27
+ showOfflineIndicator={true}
28
+ >
29
+ <MobileContainer style={styles.container}>
30
+ <NetworkAwareContent
31
+ showOnOffline={
32
+ <View style={styles.offlineContainer}>
33
+ <Text style={styles.offlineTitle}>You're offline</Text>
34
+ <Text style={styles.offlineText}>
35
+ Some features may be limited while offline.
36
+ </Text>
37
+ </View>
38
+ }
39
+ >
40
+ {user ? (
41
+ <MobileHero
42
+ title={{
43
+ text: "Welcome back!",
44
+ size: "lg"
45
+ }}
46
+ description="You are signed in and ready to go."
47
+ actions={[
48
+ {
49
+ label: "Go to Checkout",
50
+ href: "/checkout",
51
+ variant: "default"
52
+ },
53
+ {
54
+ label: "Sign Out",
55
+ onPress: signOut,
56
+ variant: "outline"
57
+ }
58
+ ]}
59
+ />
60
+ ) : (
61
+ <MobileHero
62
+ title={{
63
+ text: "Welcome to {{titleCaseName}}",
64
+ size: "xl"
65
+ }}
66
+ description="{{description}}"
67
+ actions={[
68
+ {
69
+ label: "Get Started",
70
+ href: "/signup",
71
+ variant: "default"
72
+ },
73
+ {
74
+ label: "Sign In",
75
+ href: "/login",
76
+ variant: "outline"
77
+ }
78
+ ]}
79
+ />
80
+ )}
81
+
82
+ {/* Network Status Indicator */}
83
+ <View style={styles.statusContainer}>
84
+ <Text style={styles.statusText}>
85
+ Status: {isOnline ? '🟢 Online' : '🔴 Offline'}
86
+ {networkInfo?.type && ` • ${networkInfo.type}`}
87
+ </Text>
88
+ </View>
89
+ </NetworkAwareContent>
90
+ </MobileContainer>
91
+ </OfflineWrapper>
35
92
  <StatusBar style="auto" />
36
- </View>
93
+ </PageTransition>
37
94
  );
38
95
  }
39
96
 
@@ -85,4 +142,37 @@ const styles = StyleSheet.create({
85
142
  textAlign: 'center',
86
143
  width: '80%',
87
144
  },
145
+ offlineContainer: {
146
+ padding: 20,
147
+ alignItems: 'center',
148
+ backgroundColor: '#fff3cd',
149
+ borderRadius: 8,
150
+ margin: 20,
151
+ },
152
+ offlineTitle: {
153
+ fontSize: 18,
154
+ fontWeight: 'bold',
155
+ color: '#856404',
156
+ marginBottom: 8,
157
+ },
158
+ offlineText: {
159
+ fontSize: 14,
160
+ color: '#856404',
161
+ textAlign: 'center',
162
+ },
163
+ statusContainer: {
164
+ position: 'absolute',
165
+ bottom: 50,
166
+ left: 0,
167
+ right: 0,
168
+ alignItems: 'center',
169
+ },
170
+ statusText: {
171
+ fontSize: 12,
172
+ color: '#666',
173
+ backgroundColor: 'rgba(255, 255, 255, 0.9)',
174
+ paddingHorizontal: 12,
175
+ paddingVertical: 6,
176
+ borderRadius: 20,
177
+ },
88
178
  });
@@ -1,38 +1,41 @@
1
- {
2
- "name": "{{packageName}}",
3
- "version": "1.0.0",
4
- "description": "{{description}}",
5
- "main": "node_modules/expo/AppEntry.js",
6
- "scripts": {
7
- "start": "expo start",
8
- "android": "expo start --android",
9
- "ios": "expo start --ios",
10
- "web": "expo start --web",
11
- "build": "eas build",
12
- "eject": "expo eject"
13
- },
14
- "dependencies": {
15
- "expo": "~49.0.0",
16
- "react": "18.2.0",
17
- "react-native": "0.72.6",
18
- "@expo/vector-icons": "^13.0.0",
19
- "@react-navigation/native": "^6.1.0",
20
- "@react-navigation/stack": "^6.3.0",
21
- "@react-navigation/bottom-tabs": "^6.5.0",
22
- "react-native-screens": "~3.22.0",
23
- "react-native-safe-area-context": "4.6.3",
24
- "react-native-gesture-handler": "~2.12.0",
25
- "@digilogiclabs/saas-factory-ui": "^0.7.2",
26
- "@digilogiclabs/saas-factory-auth": "^0.4.3",
27
- "@digilogiclabs/saas-factory-payments": "^0.2.0",
28
- "firebase": "^10.0.0",
29
- "@supabase/supabase-js": "^2.0.0"
30
- },
31
- "devDependencies": {
32
- "@babel/core": "^7.20.0",
33
- "@types/react": "~18.2.14",
34
- "@types/react-native": "~0.72.2",
35
- "typescript": "^5.1.3"
36
- },
37
- "private": true
38
- }
1
+ {
2
+ "name": "{{packageName}}",
3
+ "version": "1.0.0",
4
+ "description": "{{description}}",
5
+ "main": "node_modules/expo/AppEntry.js",
6
+ "scripts": {
7
+ "start": "expo start",
8
+ "android": "expo start --android",
9
+ "ios": "expo start --ios",
10
+ "web": "expo start --web",
11
+ "build": "eas build",
12
+ "eject": "expo eject"
13
+ },
14
+ "dependencies": {
15
+ "expo": "~49.0.0",
16
+ "react": "18.2.0",
17
+ "react-native": "0.72.6",
18
+ "@expo/vector-icons": "^13.0.0",
19
+ "@react-navigation/native": "^6.1.0",
20
+ "@react-navigation/stack": "^6.3.0",
21
+ "@react-navigation/bottom-tabs": "^6.5.0",
22
+ "react-native-screens": "~3.22.0",
23
+ "react-native-safe-area-context": "4.6.3",
24
+ "react-native-gesture-handler": "~2.12.0",
25
+ "@digilogiclabs/saas-factory-ui": "^0.13.0",
26
+ "@digilogiclabs/saas-factory-auth": "^0.4.3",
27
+ "@digilogiclabs/saas-factory-payments": "^0.2.0",
28
+ "firebase": "^10.0.0",
29
+ "@supabase/supabase-js": "^2.0.0",
30
+ "@react-native-community/netinfo": "^11.0.0",
31
+ "@react-native-async-storage/async-storage": "^1.19.0",
32
+ "expo-haptics": "~12.4.0"
33
+ },
34
+ "devDependencies": {
35
+ "@babel/core": "^7.20.0",
36
+ "@types/react": "~18.2.14",
37
+ "@types/react-native": "~0.72.2",
38
+ "typescript": "^5.1.3"
39
+ },
40
+ "private": true
41
+ }
@@ -4,7 +4,7 @@
4
4
  "description": "{{description}}",
5
5
  "private": true,
6
6
  "scripts": {
7
- "dev": "next dev --turbo",
7
+ "dev": "next dev",
8
8
  "build": "next build",
9
9
  "start": "next start",
10
10
  "lint": "next lint",
@@ -17,7 +17,7 @@
17
17
  "next": "^15.0.0",
18
18
  "react": "^19.0.0",
19
19
  "react-dom": "^19.0.0",
20
- "@digilogiclabs/saas-factory-ui": "^0.7.2",
20
+ "@digilogiclabs/saas-factory-ui": "^0.13.0",
21
21
  "@digilogiclabs/saas-factory-auth": "^0.4.3",
22
22
  "@digilogiclabs/saas-factory-payments": "^0.2.0",
23
23
  "tailwindcss": "^3.3.0",
@@ -3,9 +3,20 @@
3
3
  import React from 'react';
4
4
  import { useStripe } from '@digilogiclabs/saas-factory-payments';
5
5
  import { Button } from '@/components/ui/button';
6
+ import {
7
+ PageTransition,
8
+ MobileContainer,
9
+ TouchInput,
10
+ MobileForm,
11
+ SwipeableCard,
12
+ NetworkAwareContent,
13
+ useNetworkInfo
14
+ } from '@digilogiclabs/saas-factory-ui';
15
+ import { CreditCard, Zap } from 'lucide-react';
6
16
 
7
17
  export default function CheckoutPage() {
8
18
  const { handleCheckout } = useStripe();
19
+ const networkInfo = useNetworkInfo();
9
20
 
10
21
  const onCheckout = async () => {
11
22
  await handleCheckout({
@@ -15,14 +26,94 @@ export default function CheckoutPage() {
15
26
  };
16
27
 
17
28
  return (
18
- <div className="flex items-center justify-center min-h-screen bg-gray-100">
19
- <div className="p-8 bg-white rounded-lg shadow-md">
20
- <h1 className="text-2xl font-bold mb-4">Checkout</h1>
21
- <p className="mb-6">Click the button below to proceed to payment.</p>
22
- <Button onClick={onCheckout}>
23
- Proceed to Checkout
24
- </Button>
29
+ <PageTransition type="slide" direction="up" duration={350}>
30
+ <div className="flex items-center justify-center min-h-screen bg-gray-100">
31
+ <MobileContainer className="w-full max-w-md">
32
+ <NetworkAwareContent
33
+ showOnSlow={
34
+ <div className="p-6 bg-white rounded-lg shadow-md">
35
+ <div className="flex items-center gap-2 mb-4">
36
+ <CreditCard className="h-6 w-6 text-blue-600" />
37
+ <h1 className="text-xl font-bold">Checkout</h1>
38
+ </div>
39
+ <p className="mb-6 text-gray-600">
40
+ Simplified checkout for slower connections.
41
+ </p>
42
+ <Button
43
+ onClick={onCheckout}
44
+ className="w-full"
45
+ size="lg"
46
+ >
47
+ Proceed to Checkout
48
+ </Button>
49
+ </div>
50
+ }
51
+ >
52
+ <SwipeableCard
53
+ leftActions={[
54
+ {
55
+ id: 'back',
56
+ label: 'Back',
57
+ onAction: () => window.history.back(),
58
+ color: 'gray'
59
+ }
60
+ ]}
61
+ rightActions={[
62
+ {
63
+ id: 'proceed',
64
+ label: 'Pay Now',
65
+ onAction: onCheckout,
66
+ color: 'green'
67
+ }
68
+ ]}
69
+ threshold={60}
70
+ hapticFeedback={true}
71
+ showActionLabels={true}
72
+ >
73
+ <div className="p-8 bg-white rounded-lg shadow-md">
74
+ <div className="flex items-center gap-3 mb-6">
75
+ <div className="p-3 bg-blue-100 rounded-full">
76
+ <Zap className="h-6 w-6 text-blue-600" />
77
+ </div>
78
+ <div>
79
+ <h1 className="text-2xl font-bold">Premium Checkout</h1>
80
+ <p className="text-sm text-gray-500">
81
+ {networkInfo?.effectiveType && `${networkInfo.effectiveType.toUpperCase()} connection`}
82
+ </p>
83
+ </div>
84
+ </div>
85
+
86
+ <div className="space-y-4 mb-6">
87
+ <div className="p-4 bg-blue-50 rounded-lg">
88
+ <h3 className="font-semibold text-blue-900">Pro Plan</h3>
89
+ <p className="text-blue-700">$29/month • All features included</p>
90
+ </div>
91
+
92
+ <div className="text-sm text-gray-600">
93
+ <p>✓ Touch-optimized checkout experience</p>
94
+ <p>✓ Network-aware performance</p>
95
+ <p>✓ Secure payment processing</p>
96
+ </div>
97
+ </div>
98
+
99
+ <div className="space-y-3">
100
+ <Button
101
+ onClick={onCheckout}
102
+ className="w-full"
103
+ size="lg"
104
+ >
105
+ Proceed to Checkout
106
+ </Button>
107
+
108
+ <p className="text-xs text-center text-gray-500">
109
+ Swipe left to go back • Swipe right to pay now
110
+ </p>
111
+ </div>
112
+ </div>
113
+ </SwipeableCard>
114
+ </NetworkAwareContent>
115
+ </MobileContainer>
25
116
  </div>
26
- </div>
117
+ </PageTransition>
27
118
  );
28
119
  }