@digilogiclabs/create-saas-app 1.1.1 → 1.3.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 (224) hide show
  1. package/CHANGELOG.md +7 -7
  2. package/README.md +5 -5
  3. package/bin/index.js +36 -36
  4. package/dist/.tsbuildinfo +1 -1
  5. package/dist/index.js +64 -20
  6. package/dist/index.js.map +1 -1
  7. package/dist/templates/mobile/base/template/.env.example +15 -15
  8. package/dist/templates/mobile/base/template/app/checkout.tsx +20 -20
  9. package/dist/templates/web/base/template/src/app/checkout/page.tsx +28 -28
  10. package/dist/templates/web/base/template/src/app/page.tsx +1 -1
  11. package/dist/templates/web/ui-auth/template/next.config.js +12 -0
  12. package/dist/templates/web/ui-auth/template/package.json +40 -0
  13. package/dist/templates/web/ui-auth/template/postcss.config.js +7 -0
  14. package/dist/templates/web/ui-auth/template/src/app/auth/callback/route.ts +12 -0
  15. package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth}/template/src/app/checkout/page.tsx +25 -28
  16. package/dist/templates/web/ui-auth/template/src/app/globals.css +42 -0
  17. package/dist/templates/web/ui-auth/template/src/app/layout.tsx +29 -0
  18. package/dist/templates/web/ui-auth/template/src/app/login/page.tsx +109 -0
  19. package/dist/templates/web/ui-auth/template/src/app/page.tsx +129 -0
  20. package/dist/templates/web/ui-auth/template/src/app/signup/page.tsx +128 -0
  21. package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +25 -0
  22. package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth}/template/src/components/shared/header.tsx +17 -8
  23. package/dist/templates/web/ui-auth/template/src/components/ui/badge.tsx +36 -0
  24. package/dist/templates/web/ui-auth/template/src/lib/utils.ts +7 -0
  25. package/dist/templates/web/ui-auth/template/tailwind.config.js +77 -0
  26. package/dist/templates/web/ui-auth/template/tsconfig.json +33 -0
  27. package/dist/templates/web/ui-auth-payments/template/README.md +165 -0
  28. package/dist/templates/web/ui-auth-payments/template/next.config.js +12 -0
  29. package/dist/templates/web/ui-auth-payments/template/package.json +42 -0
  30. package/dist/templates/web/ui-auth-payments/template/postcss.config.js +7 -0
  31. package/dist/templates/web/ui-auth-payments/template/src/app/auth/callback/route.ts +12 -0
  32. package/dist/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +211 -0
  33. package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +142 -0
  34. package/dist/templates/web/ui-auth-payments/template/src/app/globals.css +42 -0
  35. package/dist/templates/web/ui-auth-payments/template/src/app/layout.tsx +29 -0
  36. package/dist/templates/web/ui-auth-payments/template/src/app/login/page.tsx +109 -0
  37. package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +143 -0
  38. package/dist/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +128 -0
  39. package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +28 -0
  40. package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +60 -0
  41. package/dist/templates/web/ui-auth-payments/template/src/components/ui/badge.tsx +36 -0
  42. package/dist/templates/web/ui-auth-payments/template/src/lib/utils.ts +7 -0
  43. package/dist/templates/web/ui-auth-payments/template/tailwind.config.js +77 -0
  44. package/dist/templates/web/ui-auth-payments/template/tsconfig.json +33 -0
  45. package/dist/templates/web/ui-auth-payments-audio/template/README.md +187 -0
  46. package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-audio}/template/next.config.js +0 -3
  47. package/dist/templates/web/ui-auth-payments-audio/template/package.json +42 -0
  48. package/dist/templates/web/ui-auth-payments-audio/template/src/app/auth/callback/route.ts +12 -0
  49. package/dist/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +211 -0
  50. package/dist/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +142 -0
  51. package/dist/templates/web/ui-auth-payments-audio/template/src/app/login/page.tsx +109 -0
  52. package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +181 -0
  53. package/dist/templates/web/ui-auth-payments-audio/template/src/app/signup/page.tsx +128 -0
  54. package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +28 -0
  55. package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +60 -0
  56. package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-audio}/template/tailwind.config.js +1 -1
  57. package/dist/templates/web/ui-auth-payments-video/template/README.md +190 -0
  58. package/dist/templates/web/{web-ui-package → ui-auth-payments-video}/template/next.config.js +0 -3
  59. package/dist/templates/web/ui-auth-payments-video/template/package.json +42 -0
  60. package/dist/templates/web/ui-auth-payments-video/template/src/app/auth/callback/route.ts +12 -0
  61. package/dist/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +211 -0
  62. package/dist/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +142 -0
  63. package/dist/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +109 -0
  64. package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +187 -0
  65. package/dist/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +128 -0
  66. package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +28 -0
  67. package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +60 -0
  68. package/dist/templates/web/{web-ui-package → ui-auth-payments-video}/template/tailwind.config.js +1 -1
  69. package/dist/templates/web/ui-only/template/next.config.js +12 -0
  70. package/dist/templates/web/{web-ui-package → ui-only}/template/package.json +3 -3
  71. package/dist/templates/web/ui-only/template/postcss.config.js +7 -0
  72. package/dist/templates/web/ui-only/template/src/app/auth/callback/route.ts +12 -0
  73. package/dist/templates/web/{web-ui-package → ui-only}/template/src/app/checkout/page.tsx +25 -28
  74. package/dist/templates/web/ui-only/template/src/app/globals.css +42 -0
  75. package/dist/templates/web/ui-only/template/src/app/layout.tsx +29 -0
  76. package/dist/templates/web/ui-only/template/src/app/login/page.tsx +63 -0
  77. package/dist/templates/web/ui-only/template/src/app/signup/page.tsx +79 -0
  78. package/dist/templates/web/ui-only/template/src/components/providers/app-providers.tsx +22 -0
  79. package/dist/templates/web/{web-ui-package → ui-only}/template/src/components/shared/header.tsx +17 -8
  80. package/dist/templates/web/ui-only/template/src/components/ui/badge.tsx +36 -0
  81. package/dist/templates/web/ui-only/template/src/lib/utils.ts +7 -0
  82. package/dist/templates/web/ui-only/template/tailwind.config.js +77 -0
  83. package/dist/templates/web/ui-only/template/tsconfig.json +33 -0
  84. package/dist/templates/web/ui-package-test/template/package.json +2 -2
  85. package/package.json +2 -2
  86. package/src/templates/mobile/base/template/.env.example +15 -15
  87. package/src/templates/mobile/base/template/app/checkout.tsx +20 -20
  88. package/src/templates/web/base/template/src/app/checkout/page.tsx +28 -28
  89. package/src/templates/web/base/template/src/app/page.tsx +1 -1
  90. package/src/templates/web/ui-auth/template/README.md +68 -0
  91. package/src/templates/web/ui-auth/template/next.config.js +12 -0
  92. package/src/templates/web/ui-auth/template/package.json +40 -0
  93. package/src/templates/web/ui-auth/template/postcss.config.js +7 -0
  94. package/src/templates/web/ui-auth/template/src/app/auth/callback/route.ts +12 -0
  95. package/src/templates/web/ui-auth/template/src/app/checkout/page.tsx +25 -0
  96. package/src/templates/web/ui-auth/template/src/app/globals.css +42 -0
  97. package/src/templates/web/ui-auth/template/src/app/layout.tsx +29 -0
  98. package/src/templates/web/ui-auth/template/src/app/login/page.tsx +109 -0
  99. package/src/templates/web/ui-auth/template/src/app/page.tsx +129 -0
  100. package/src/templates/web/ui-auth/template/src/app/signup/page.tsx +128 -0
  101. package/src/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +25 -0
  102. package/src/templates/web/ui-auth/template/src/components/shared/header.tsx +51 -0
  103. package/src/templates/web/ui-auth/template/src/components/ui/badge.tsx +36 -0
  104. package/src/templates/web/ui-auth/template/src/lib/utils.ts +7 -0
  105. package/src/templates/web/ui-auth/template/tailwind.config.js +77 -0
  106. package/src/templates/web/ui-auth/template/tsconfig.json +33 -0
  107. package/src/templates/web/ui-auth-payments/template/README.md +165 -0
  108. package/src/templates/web/ui-auth-payments/template/next.config.js +12 -0
  109. package/src/templates/web/ui-auth-payments/template/package.json +42 -0
  110. package/src/templates/web/ui-auth-payments/template/postcss.config.js +7 -0
  111. package/src/templates/web/ui-auth-payments/template/src/app/auth/callback/route.ts +12 -0
  112. package/src/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +211 -0
  113. package/src/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +142 -0
  114. package/src/templates/web/ui-auth-payments/template/src/app/globals.css +42 -0
  115. package/src/templates/web/ui-auth-payments/template/src/app/layout.tsx +29 -0
  116. package/src/templates/web/ui-auth-payments/template/src/app/login/page.tsx +109 -0
  117. package/src/templates/web/ui-auth-payments/template/src/app/page.tsx +143 -0
  118. package/src/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +128 -0
  119. package/src/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +28 -0
  120. package/src/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +60 -0
  121. package/src/templates/web/ui-auth-payments/template/src/components/ui/badge.tsx +36 -0
  122. package/src/templates/web/ui-auth-payments/template/src/lib/utils.ts +7 -0
  123. package/src/templates/web/ui-auth-payments/template/tailwind.config.js +77 -0
  124. package/src/templates/web/ui-auth-payments/template/tsconfig.json +33 -0
  125. package/src/templates/web/ui-auth-payments-audio/template/README.md +187 -0
  126. package/src/templates/web/ui-auth-payments-audio/template/next.config.js +12 -0
  127. package/src/templates/web/ui-auth-payments-audio/template/package.json +42 -0
  128. package/src/templates/web/ui-auth-payments-audio/template/postcss.config.js +7 -0
  129. package/src/templates/web/ui-auth-payments-audio/template/src/app/auth/callback/route.ts +12 -0
  130. package/src/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +211 -0
  131. package/src/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +142 -0
  132. package/src/templates/web/ui-auth-payments-audio/template/src/app/globals.css +42 -0
  133. package/src/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +29 -0
  134. package/src/templates/web/ui-auth-payments-audio/template/src/app/login/page.tsx +109 -0
  135. package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +181 -0
  136. package/src/templates/web/ui-auth-payments-audio/template/src/app/signup/page.tsx +128 -0
  137. package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +28 -0
  138. package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +60 -0
  139. package/src/templates/web/ui-auth-payments-audio/template/src/components/ui/badge.tsx +36 -0
  140. package/src/templates/web/ui-auth-payments-audio/template/src/lib/utils.ts +7 -0
  141. package/src/templates/web/ui-auth-payments-audio/template/tailwind.config.js +77 -0
  142. package/src/templates/web/ui-auth-payments-audio/template/tsconfig.json +33 -0
  143. package/src/templates/web/ui-auth-payments-video/template/README.md +190 -0
  144. package/src/templates/web/ui-auth-payments-video/template/next.config.js +12 -0
  145. package/src/templates/web/ui-auth-payments-video/template/package.json +42 -0
  146. package/src/templates/web/ui-auth-payments-video/template/postcss.config.js +7 -0
  147. package/src/templates/web/ui-auth-payments-video/template/src/app/auth/callback/route.ts +12 -0
  148. package/src/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +211 -0
  149. package/src/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +142 -0
  150. package/src/templates/web/ui-auth-payments-video/template/src/app/globals.css +42 -0
  151. package/src/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +29 -0
  152. package/src/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +109 -0
  153. package/src/templates/web/ui-auth-payments-video/template/src/app/page.tsx +187 -0
  154. package/src/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +128 -0
  155. package/src/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +28 -0
  156. package/src/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +60 -0
  157. package/src/templates/web/ui-auth-payments-video/template/src/components/ui/badge.tsx +36 -0
  158. package/src/templates/web/ui-auth-payments-video/template/src/lib/utils.ts +7 -0
  159. package/src/templates/web/ui-auth-payments-video/template/tailwind.config.js +77 -0
  160. package/src/templates/web/ui-auth-payments-video/template/tsconfig.json +33 -0
  161. package/src/templates/web/ui-only/template/.env.example +15 -0
  162. package/src/templates/web/ui-only/template/README.md +68 -0
  163. package/src/templates/web/ui-only/template/next.config.js +12 -0
  164. package/src/templates/web/{web-ui-package → ui-only}/template/package.json +3 -3
  165. package/src/templates/web/ui-only/template/postcss.config.js +7 -0
  166. package/src/templates/web/ui-only/template/src/app/auth/callback/route.ts +12 -0
  167. package/src/templates/web/ui-only/template/src/app/checkout/page.tsx +25 -0
  168. package/src/templates/web/ui-only/template/src/app/globals.css +42 -0
  169. package/src/templates/web/ui-only/template/src/app/layout.tsx +29 -0
  170. package/src/templates/web/ui-only/template/src/app/login/page.tsx +63 -0
  171. package/src/templates/web/ui-only/template/src/app/signup/page.tsx +79 -0
  172. package/src/templates/web/ui-only/template/src/components/providers/app-providers.tsx +22 -0
  173. package/src/templates/web/ui-only/template/src/components/shared/header.tsx +51 -0
  174. package/src/templates/web/ui-only/template/src/components/ui/badge.tsx +36 -0
  175. package/src/templates/web/ui-only/template/src/lib/utils.ts +7 -0
  176. package/src/templates/web/ui-only/template/tailwind.config.js +77 -0
  177. package/src/templates/web/ui-only/template/tsconfig.json +33 -0
  178. package/src/templates/web/ui-only/template.backup/.env.example +15 -0
  179. package/{dist/mobile/base/template → src/templates/web/ui-only/template.backup.20250817}/.env.example +15 -15
  180. package/src/templates/web/ui-package-test/template/package.json +2 -2
  181. package/dist/templates/web/web-ui-package/template/src/app/auth/callback/route.ts +0 -18
  182. package/dist/templates/web/web-ui-package/template/src/app/login/page.tsx +0 -39
  183. package/dist/templates/web/web-ui-package/template/src/app/signup/page.tsx +0 -39
  184. package/dist/templates/web/web-ui-package/template/src/components/providers/app-providers.tsx +0 -29
  185. package/src/templates/web/web-ui-package/template/.eslintrc.js +0 -8
  186. package/src/templates/web/web-ui-package/template/src/app/auth/callback/route.ts +0 -18
  187. package/src/templates/web/web-ui-package/template/src/app/login/page.tsx +0 -39
  188. package/src/templates/web/web-ui-package/template/src/app/signup/page.tsx +0 -39
  189. package/src/templates/web/web-ui-package/template/src/components/providers/app-providers.tsx +0 -29
  190. /package/dist/{web/base → templates/web/ui-auth}/template/.env.example +0 -0
  191. /package/dist/templates/web/{web-ui-package → ui-auth}/template/.eslintrc.js +0 -0
  192. /package/dist/templates/web/{web-ui-package → ui-auth}/template/README.md +0 -0
  193. /package/dist/{web/base → templates/web/ui-auth}/template.backup/.env.example +0 -0
  194. /package/dist/{web/base → templates/web/ui-auth}/template.backup.20250817/.env.example +0 -0
  195. /package/dist/templates/web/{web-ui-package → ui-auth-payments}/template/.env.example +0 -0
  196. /package/dist/templates/web/{web-ui-package/template.backup.20250817 → ui-auth-payments-audio/template}/.env.example +0 -0
  197. /package/dist/templates/web/{web-ui-package → ui-auth-payments-audio}/template/postcss.config.js +0 -0
  198. /package/dist/templates/web/{web-ui-package → ui-auth-payments-audio}/template/src/app/globals.css +0 -0
  199. /package/dist/templates/web/{web-ui-package → ui-auth-payments-audio}/template/src/app/layout.tsx +0 -0
  200. /package/dist/templates/web/{web-ui-package → ui-auth-payments-audio}/template/src/components/ui/badge.tsx +0 -0
  201. /package/dist/templates/web/{web-ui-package → ui-auth-payments-audio}/template/src/lib/utils.ts +0 -0
  202. /package/dist/templates/web/{web-ui-package → ui-auth-payments-audio}/template/tsconfig.json +0 -0
  203. /package/dist/templates/web/{web-ui-package/template.backup → ui-auth-payments-video/template}/.env.example +0 -0
  204. /package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-video}/template/postcss.config.js +0 -0
  205. /package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-video}/template/src/app/globals.css +0 -0
  206. /package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-video}/template/src/app/layout.tsx +0 -0
  207. /package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-video}/template/src/components/ui/badge.tsx +0 -0
  208. /package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-video}/template/src/lib/utils.ts +0 -0
  209. /package/{src/templates/web/web-ui-package → dist/templates/web/ui-auth-payments-video}/template/tsconfig.json +0 -0
  210. /package/dist/{web/ui-package-test → templates/web/ui-only}/template/.env.example +0 -0
  211. /package/dist/{web/base → templates/web/ui-only}/template/.eslintrc.js +0 -0
  212. /package/{src/templates/web/web-ui-package → dist/templates/web/ui-only}/template/README.md +0 -0
  213. /package/dist/templates/web/{web-ui-package → ui-only}/template/src/app/page.tsx +0 -0
  214. /package/dist/{web/ui-package-test → templates/web/ui-only}/template.backup/.env.example +0 -0
  215. /package/dist/{web/ui-package-test → templates/web/ui-only}/template.backup.20250817/.env.example +0 -0
  216. /package/src/templates/web/{web-ui-package → ui-auth}/template/.env.example +0 -0
  217. /package/{dist/web/ui-package-test → src/templates/web/ui-auth}/template/.eslintrc.js +0 -0
  218. /package/src/templates/web/{web-ui-package → ui-auth}/template.backup/.env.example +0 -0
  219. /package/src/templates/web/{web-ui-package → ui-auth}/template.backup.20250817/.env.example +0 -0
  220. /package/{dist/web/web-ui-package → src/templates/web/ui-auth-payments}/template/.env.example +0 -0
  221. /package/{dist/web/web-ui-package/template.backup.20250817 → src/templates/web/ui-auth-payments-audio/template}/.env.example +0 -0
  222. /package/{dist/web/web-ui-package/template.backup → src/templates/web/ui-auth-payments-video/template}/.env.example +0 -0
  223. /package/{dist/web/web-ui-package → src/templates/web/ui-only}/template/.eslintrc.js +0 -0
  224. /package/src/templates/web/{web-ui-package → ui-only}/template/src/app/page.tsx +0 -0
@@ -0,0 +1,211 @@
1
+ 'use client';
2
+
3
+ import React from 'react';
4
+ import { usePayments, formatCurrency, formatDate } from '@digilogiclabs/saas-factory-payments';
5
+ import { Button, Card } from '@digilogiclabs/saas-factory-ui';
6
+
7
+ export default function BillingPage() {
8
+ const { loading } = usePayments();
9
+
10
+ const handleSubscriptionChange = () => {
11
+ console.log('Subscription change requested');
12
+ // Handle subscription changes (upgrade, downgrade, cancel, resume)
13
+ };
14
+
15
+ const handlePaymentMethodUpdate = () => {
16
+ console.log('Payment method update requested');
17
+ // Handle payment method updates (add, edit, delete, set default)
18
+ };
19
+
20
+ const handleInvoiceDownload = (invoiceId: string) => {
21
+ console.log('Download invoice:', invoiceId);
22
+ // Handle invoice download
23
+ };
24
+
25
+ // Mock current subscription data - in real app this would come from your backend
26
+ const currentSubscription = {
27
+ plan: 'Pro Plan',
28
+ price: 1999,
29
+ interval: 'month',
30
+ status: 'active',
31
+ nextBilling: new Date(Date.now() + 15 * 24 * 60 * 60 * 1000)
32
+ };
33
+
34
+ // Mock payment methods - in real app this would come from your backend
35
+ const paymentMethods = [
36
+ {
37
+ id: 'pm_123',
38
+ type: 'card',
39
+ last4: '4242',
40
+ brand: 'visa',
41
+ expiryMonth: 12,
42
+ expiryYear: 2025,
43
+ isDefault: true
44
+ },
45
+ {
46
+ id: 'pm_456',
47
+ type: 'card',
48
+ last4: '0005',
49
+ brand: 'mastercard',
50
+ expiryMonth: 8,
51
+ expiryYear: 2026,
52
+ isDefault: false
53
+ }
54
+ ];
55
+
56
+ // Mock billing history - in real app this would come from your backend
57
+ const invoices = [
58
+ {
59
+ id: 'inv_123',
60
+ amount: 1999,
61
+ currency: 'usd',
62
+ status: 'paid',
63
+ date: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000),
64
+ description: 'Pro Plan - Monthly'
65
+ },
66
+ {
67
+ id: 'inv_456',
68
+ amount: 1999,
69
+ currency: 'usd',
70
+ status: 'paid',
71
+ date: new Date(Date.now() - 60 * 24 * 60 * 60 * 1000),
72
+ description: 'Pro Plan - Monthly'
73
+ },
74
+ {
75
+ id: 'inv_789',
76
+ amount: 999,
77
+ currency: 'usd',
78
+ status: 'paid',
79
+ date: new Date(Date.now() - 90 * 24 * 60 * 60 * 1000),
80
+ description: 'Basic Plan - Monthly'
81
+ }
82
+ ];
83
+
84
+ return (
85
+ <div className="min-h-screen bg-gray-100 py-8">
86
+ <div className="max-w-7xl mx-auto px-4">
87
+ <div className="mb-8">
88
+ <h1 className="text-4xl font-bold text-gray-900 mb-2">Billing & Subscription</h1>
89
+ <p className="text-xl text-gray-600">Manage your subscription and billing information</p>
90
+ </div>
91
+
92
+ <div className="grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8">
93
+ {/* Current Subscription */}
94
+ <Card className="p-6">
95
+ <h2 className="text-2xl font-bold mb-6">Current Subscription</h2>
96
+ <div className="space-y-4">
97
+ <div>
98
+ <h3 className="font-semibold">{currentSubscription.plan}</h3>
99
+ <p className="text-2xl font-bold">
100
+ {formatCurrency(currentSubscription.price)}
101
+ <span className="text-sm font-normal">/{currentSubscription.interval}</span>
102
+ </p>
103
+ </div>
104
+ <div>
105
+ <p className="text-sm text-gray-600">Status</p>
106
+ <span className="inline-block px-2 py-1 bg-green-100 text-green-800 rounded text-sm">
107
+ {currentSubscription.status}
108
+ </span>
109
+ </div>
110
+ <div>
111
+ <p className="text-sm text-gray-600">Next billing date</p>
112
+ <p>{formatDate(currentSubscription.nextBilling)}</p>
113
+ </div>
114
+ <Button
115
+ onClick={handleSubscriptionChange}
116
+ disabled={loading}
117
+ variant="outline"
118
+ className="w-full"
119
+ >
120
+ Change Plan
121
+ </Button>
122
+ </div>
123
+ </Card>
124
+
125
+ {/* Payment Methods */}
126
+ <Card className="p-6">
127
+ <h2 className="text-2xl font-bold mb-6">Payment Methods</h2>
128
+ <div className="space-y-4">
129
+ {paymentMethods.map((method) => (
130
+ <div key={method.id} className="flex items-center justify-between p-3 border rounded-lg">
131
+ <div className="flex items-center">
132
+ <div className="w-8 h-8 bg-blue-100 rounded flex items-center justify-center mr-3">
133
+ 💳
134
+ </div>
135
+ <div>
136
+ <p className="font-medium">
137
+ {method.brand.toUpperCase()} •••• {method.last4}
138
+ </p>
139
+ <p className="text-sm text-gray-600">
140
+ Expires {method.expiryMonth}/{method.expiryYear}
141
+ {method.isDefault && <span className="ml-2 text-blue-600">(Default)</span>}
142
+ </p>
143
+ </div>
144
+ </div>
145
+ <Button
146
+ onClick={handlePaymentMethodUpdate}
147
+ disabled={loading}
148
+ variant="outline"
149
+ size="sm"
150
+ >
151
+ Edit
152
+ </Button>
153
+ </div>
154
+ ))}
155
+ <Button
156
+ onClick={handlePaymentMethodUpdate}
157
+ disabled={loading}
158
+ variant="outline"
159
+ className="w-full"
160
+ >
161
+ Add Payment Method
162
+ </Button>
163
+ </div>
164
+ </Card>
165
+ </div>
166
+
167
+ {/* Billing History */}
168
+ <Card className="p-6">
169
+ <h2 className="text-2xl font-bold mb-6">Billing History</h2>
170
+ <div className="overflow-x-auto">
171
+ <table className="w-full">
172
+ <thead>
173
+ <tr className="border-b">
174
+ <th className="text-left py-2">Date</th>
175
+ <th className="text-left py-2">Description</th>
176
+ <th className="text-left py-2">Amount</th>
177
+ <th className="text-left py-2">Status</th>
178
+ <th className="text-left py-2">Actions</th>
179
+ </tr>
180
+ </thead>
181
+ <tbody>
182
+ {invoices.map((invoice) => (
183
+ <tr key={invoice.id} className="border-b">
184
+ <td className="py-3">{formatDate(invoice.date)}</td>
185
+ <td className="py-3">{invoice.description}</td>
186
+ <td className="py-3">{formatCurrency(invoice.amount)}</td>
187
+ <td className="py-3">
188
+ <span className="inline-block px-2 py-1 bg-green-100 text-green-800 rounded text-sm">
189
+ {invoice.status}
190
+ </span>
191
+ </td>
192
+ <td className="py-3">
193
+ <Button
194
+ onClick={() => handleInvoiceDownload(invoice.id)}
195
+ variant="outline"
196
+ size="sm"
197
+ >
198
+ Download
199
+ </Button>
200
+ </td>
201
+ </tr>
202
+ ))}
203
+ </tbody>
204
+ </table>
205
+ </div>
206
+ </Card>
207
+ </div>
208
+ </div>
209
+ );
210
+ }
211
+
@@ -0,0 +1,142 @@
1
+ 'use client';
2
+
3
+ import React from 'react';
4
+ import { usePayments, formatCurrency } from '@digilogiclabs/saas-factory-payments';
5
+ import { Button, Card } from '@digilogiclabs/saas-factory-ui';
6
+
7
+ export default function CheckoutPage() {
8
+ const { loading } = usePayments();
9
+
10
+ const handlePlanSelect = (planId: string) => {
11
+ console.log('Plan selected:', planId);
12
+ // Handle plan selection - redirect to payment processing
13
+ };
14
+
15
+ const handlePayment = () => {
16
+ console.log('Processing payment...');
17
+ // Handle payment processing
18
+ };
19
+
20
+ // Example pricing plans - in real app these would come from your backend/Stripe
21
+ const plans = [
22
+ {
23
+ id: 'basic',
24
+ name: 'Basic Plan',
25
+ price: 999, // in cents
26
+ interval: 'month',
27
+ features: ['Feature 1', 'Feature 2', 'Feature 3'],
28
+ stripePriceId: 'price_basic_monthly'
29
+ },
30
+ {
31
+ id: 'pro',
32
+ name: 'Pro Plan',
33
+ price: 1999, // in cents
34
+ interval: 'month',
35
+ features: ['All Basic features', 'Feature 4', 'Feature 5', 'Priority support'],
36
+ popular: true,
37
+ stripePriceId: 'price_pro_monthly'
38
+ },
39
+ {
40
+ id: 'enterprise',
41
+ name: 'Enterprise Plan',
42
+ price: 4999, // in cents
43
+ interval: 'month',
44
+ features: ['All Pro features', 'Custom integrations', 'Dedicated support', 'SLA guarantee'],
45
+ stripePriceId: 'price_enterprise_monthly'
46
+ }
47
+ ];
48
+
49
+ return (
50
+ <div className="min-h-screen bg-gray-100 py-8">
51
+ <div className="max-w-6xl mx-auto px-4">
52
+ <div className="text-center mb-12">
53
+ <h1 className="text-4xl font-bold text-gray-900 mb-4">Choose Your Plan</h1>
54
+ <p className="text-xl text-gray-600">Select the perfect plan for your needs</p>
55
+ </div>
56
+
57
+ {/* Subscription Plans */}
58
+ <div className="grid md:grid-cols-3 gap-6 mb-8">
59
+ {plans.map((plan) => (
60
+ <Card key={plan.id} className={`p-6 relative ${plan.popular ? 'ring-2 ring-blue-500' : ''}`}>
61
+ {plan.popular && (
62
+ <div className="absolute -top-3 left-1/2 transform -translate-x-1/2">
63
+ <span className="bg-blue-500 text-white px-3 py-1 rounded-full text-sm font-medium">
64
+ Most Popular
65
+ </span>
66
+ </div>
67
+ )}
68
+ <h3 className="text-xl font-bold mb-2">{plan.name}</h3>
69
+ <div className="text-3xl font-bold mb-4">
70
+ {formatCurrency(plan.price)}
71
+ <span className="text-sm font-normal">/{plan.interval}</span>
72
+ </div>
73
+ <ul className="mb-6 space-y-2">
74
+ {plan.features.map((feature, index) => (
75
+ <li key={index} className="flex items-center">
76
+ <span className="text-green-500 mr-2">✓</span>
77
+ {feature}
78
+ </li>
79
+ ))}
80
+ </ul>
81
+ <Button
82
+ onClick={() => handlePlanSelect(plan.id)}
83
+ disabled={loading}
84
+ className="w-full"
85
+ variant={plan.popular ? "default" : "outline"}
86
+ >
87
+ {loading ? 'Processing...' : 'Select Plan'}
88
+ </Button>
89
+ </Card>
90
+ ))}
91
+ </div>
92
+
93
+ {/* Payment Form */}
94
+ <Card className="p-6 max-w-md mx-auto">
95
+ <h2 className="text-2xl font-bold mb-6">Payment Details</h2>
96
+ <div className="space-y-4">
97
+ <div>
98
+ <label className="block text-sm font-medium mb-2">Card Number</label>
99
+ <input
100
+ type="text"
101
+ placeholder="1234 5678 9012 3456"
102
+ className="w-full p-3 border rounded-lg"
103
+ disabled
104
+ />
105
+ </div>
106
+ <div className="grid grid-cols-2 gap-4">
107
+ <div>
108
+ <label className="block text-sm font-medium mb-2">Expiry Date</label>
109
+ <input
110
+ type="text"
111
+ placeholder="MM/YY"
112
+ className="w-full p-3 border rounded-lg"
113
+ disabled
114
+ />
115
+ </div>
116
+ <div>
117
+ <label className="block text-sm font-medium mb-2">CVC</label>
118
+ <input
119
+ type="text"
120
+ placeholder="123"
121
+ className="w-full p-3 border rounded-lg"
122
+ disabled
123
+ />
124
+ </div>
125
+ </div>
126
+ <Button
127
+ onClick={handlePayment}
128
+ disabled={loading}
129
+ className="w-full"
130
+ >
131
+ {loading ? 'Processing...' : 'Complete Payment'}
132
+ </Button>
133
+ <p className="text-sm text-gray-600 text-center">
134
+ This is a demo. Payment processing requires Stripe integration.
135
+ </p>
136
+ </div>
137
+ </Card>
138
+ </div>
139
+ </div>
140
+ );
141
+ }
142
+
@@ -0,0 +1,109 @@
1
+ 'use client';
2
+
3
+ import React, { useState } from 'react';
4
+ import { Button, Card, Input, Label } from '@digilogiclabs/saas-factory-ui';
5
+ import { useAuth } from '@digilogiclabs/saas-factory-auth';
6
+ import { useRouter } from 'next/navigation';
7
+
8
+ export default function LoginPage() {
9
+ const [email, setEmail] = useState('');
10
+ const [password, setPassword] = useState('');
11
+ const { signIn, signInWithOAuth, loading, error, user } = useAuth();
12
+ const router = useRouter();
13
+
14
+ // Redirect if already logged in
15
+ React.useEffect(() => {
16
+ if (user) {
17
+ router.push('/');
18
+ }
19
+ }, [user, router]);
20
+
21
+ const handleLogin = async (e: React.FormEvent) => {
22
+ e.preventDefault();
23
+ try {
24
+ await signIn(email, password);
25
+ router.push('/');
26
+ } catch (err) {
27
+ console.error('Login error:', err);
28
+ }
29
+ };
30
+
31
+ const handleGoogleLogin = async () => {
32
+ try {
33
+ await signInWithOAuth('google', window.location.origin);
34
+ } catch (err) {
35
+ console.error('Google login error:', err);
36
+ }
37
+ };
38
+
39
+ if (loading) {
40
+ return (
41
+ <div className="flex items-center justify-center min-h-screen bg-gray-100">
42
+ <div>Loading...</div>
43
+ </div>
44
+ );
45
+ }
46
+
47
+ return (
48
+ <div className="flex items-center justify-center min-h-screen bg-gray-100">
49
+ <Card className="w-full max-w-md p-8">
50
+ <h1 className="text-2xl font-bold text-center mb-6">Sign In</h1>
51
+
52
+ {error && (
53
+ <div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
54
+ {error.message}
55
+ </div>
56
+ )}
57
+
58
+ <form onSubmit={handleLogin} className="space-y-4">
59
+ <div>
60
+ <Label htmlFor="email">Email</Label>
61
+ <Input
62
+ id="email"
63
+ type="email"
64
+ value={email}
65
+ onChange={(e) => setEmail(e.target.value)}
66
+ placeholder="Enter your email"
67
+ required
68
+ disabled={loading}
69
+ />
70
+ </div>
71
+ <div>
72
+ <Label htmlFor="password">Password</Label>
73
+ <Input
74
+ id="password"
75
+ type="password"
76
+ value={password}
77
+ onChange={(e) => setPassword(e.target.value)}
78
+ placeholder="Enter your password"
79
+ required
80
+ disabled={loading}
81
+ />
82
+ </div>
83
+ <Button type="submit" className="w-full" disabled={loading}>
84
+ {loading ? 'Signing In...' : 'Sign In'}
85
+ </Button>
86
+ <Button
87
+ type="button"
88
+ variant="outline"
89
+ className="w-full"
90
+ onClick={handleGoogleLogin}
91
+ disabled={loading}
92
+ >
93
+ Sign in with Google
94
+ </Button>
95
+ </form>
96
+
97
+ <div className="mt-4 text-center">
98
+ <p className="text-sm text-gray-600">
99
+ Don&apos;t have an account?{' '}
100
+ <a href="/signup" className="text-blue-600 hover:underline">
101
+ Sign up
102
+ </a>
103
+ </p>
104
+ </div>
105
+ </Card>
106
+ </div>
107
+ );
108
+ }
109
+
@@ -0,0 +1,181 @@
1
+ 'use client'
2
+
3
+ import { Button, Card, AudioPlayer } from '@digilogiclabs/saas-factory-ui'
4
+ import { ArrowRight, Zap, Shield, Rocket, CheckCircle, LogOut, User, Music } from 'lucide-react'
5
+ import { useAuth } from '@digilogiclabs/saas-factory-auth'
6
+ import Link from 'next/link'
7
+
8
+ export default function Home() {
9
+ const { user, signOut, loading } = useAuth()
10
+
11
+ const handleSignOut = async () => {
12
+ try {
13
+ await signOut()
14
+ } catch (err) {
15
+ console.error('Sign out error:', err)
16
+ }
17
+ }
18
+
19
+ return (
20
+ <main className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-gray-900 dark:to-gray-800">
21
+ <div className="container mx-auto px-4 py-16">
22
+ {/* Auth Status Bar */}
23
+ <div className="flex justify-end mb-8">
24
+ {loading ? (
25
+ <div className="text-sm text-gray-600">Loading...</div>
26
+ ) : user ? (
27
+ <div className="flex items-center gap-4">
28
+ <div className="flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300">
29
+ <User className="w-4 h-4" />
30
+ Welcome, {user.email}
31
+ </div>
32
+ <Button variant="outline" size="sm" onClick={handleSignOut}>
33
+ <LogOut className="w-4 h-4 mr-2" />
34
+ Sign Out
35
+ </Button>
36
+ </div>
37
+ ) : (
38
+ <div className="flex gap-2">
39
+ <Link href="/login">
40
+ <Button variant="outline" size="sm">Sign In</Button>
41
+ </Link>
42
+ <Link href="/signup">
43
+ <Button size="sm">Sign Up</Button>
44
+ </Link>
45
+ </div>
46
+ )}
47
+ </div>
48
+
49
+ {/* Hero Section */}
50
+ <div className="text-center mb-16">
51
+ <div className="inline-flex items-center px-4 py-2 rounded-full text-sm font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 mb-6">
52
+ <CheckCircle className="w-4 h-4 mr-2" />
53
+ Audio Player App - UI Package v0.10.0 + Auth v0.4.4 + Payments Integrated Successfully
54
+ </div>
55
+ <h1 className="text-4xl md:text-6xl font-bold text-gray-900 dark:text-white mb-6">
56
+ Welcome to{' '}
57
+ <span className="text-blue-600 dark:text-blue-400">{{titleCaseName}}</span>
58
+ </h1>
59
+ <p className="text-xl text-gray-600 dark:text-gray-300 mb-8 max-w-2xl mx-auto">
60
+ {{description}}. This audio streaming app template uses SaaS Factory UI package v0.10.0 with audio player components, authentication v0.4.4 and payments integration.
61
+ </p>
62
+ <div className="flex flex-col sm:flex-row gap-4 justify-center">
63
+ <Link href="/checkout">
64
+ <Button size="lg" className="text-lg px-8">
65
+ View Pricing
66
+ <ArrowRight className="ml-2 h-5 w-5" />
67
+ </Button>
68
+ </Link>
69
+ <Button variant="outline" size="lg" className="text-lg px-8">
70
+ Learn More
71
+ </Button>
72
+ </div>
73
+ </div>
74
+
75
+ {/* Audio Player Showcase */}
76
+ <div className="max-w-4xl mx-auto mb-16">
77
+ <Card className="p-8">
78
+ <div className="text-center mb-8">
79
+ <div className="mx-auto w-16 h-16 bg-purple-100 dark:bg-purple-900 rounded-full flex items-center justify-center mb-4">
80
+ <Music className="h-8 w-8 text-purple-600 dark:text-purple-400" />
81
+ </div>
82
+ <h2 className="text-3xl font-bold mb-4">Audio Player Component</h2>
83
+ <p className="text-gray-600 dark:text-gray-300">
84
+ Experience our feature-rich audio player with playlist support, advanced controls, and cross-platform compatibility
85
+ </p>
86
+ </div>
87
+ <AudioPlayer
88
+ playlist={[
89
+ {
90
+ id: '1',
91
+ title: 'Sample Audio Track',
92
+ artist: 'Demo Artist',
93
+ album: 'Demo Album',
94
+ duration: 180,
95
+ url: 'https://www.soundjay.com/misc/sounds/bell-ringing-05.mp3',
96
+ coverArt: 'https://via.placeholder.com/300x300?text=Demo+Track'
97
+ },
98
+ {
99
+ id: '2',
100
+ title: 'Another Great Song',
101
+ artist: 'Sample Band',
102
+ album: 'Greatest Hits',
103
+ duration: 210,
104
+ url: 'https://www.soundjay.com/misc/sounds/bell-ringing-05.mp3',
105
+ coverArt: 'https://via.placeholder.com/300x300?text=Track+2'
106
+ }
107
+ ]}
108
+ className="max-w-2xl mx-auto"
109
+ />
110
+ </Card>
111
+ </div>
112
+
113
+ {/* Component Showcase */}
114
+ <div className="grid md:grid-cols-4 gap-8 mb-16">
115
+ <Card className="text-center p-6">
116
+ <div className="mx-auto w-12 h-12 bg-blue-100 dark:bg-blue-900 rounded-lg flex items-center justify-center mb-4">
117
+ <Zap className="h-6 w-6 text-blue-600 dark:text-blue-400" />
118
+ </div>
119
+ <h3 className="text-xl font-semibold mb-2">Audio UI Components</h3>
120
+ <p className="text-gray-600 dark:text-gray-300">
121
+ Audio Player, Button, and Card components from @digilogiclabs/saas-factory-ui v0.10.0
122
+ </p>
123
+ </Card>
124
+
125
+ <Card className="text-center p-6">
126
+ <div className="mx-auto w-12 h-12 bg-green-100 dark:bg-green-900 rounded-lg flex items-center justify-center mb-4">
127
+ <Shield className="h-6 w-6 text-green-600 dark:text-green-400" />
128
+ </div>
129
+ <h3 className="text-xl font-semibold mb-2">Authentication</h3>
130
+ <p className="text-gray-600 dark:text-gray-300">
131
+ Secure user authentication with @digilogiclabs/saas-factory-auth
132
+ </p>
133
+ </Card>
134
+
135
+ <Card className="text-center p-6">
136
+ <div className="mx-auto w-12 h-12 bg-purple-100 dark:bg-purple-900 rounded-lg flex items-center justify-center mb-4">
137
+ <Rocket className="h-6 w-6 text-purple-600 dark:text-purple-400" />
138
+ </div>
139
+ <h3 className="text-xl font-semibold mb-2">TypeScript Ready</h3>
140
+ <p className="text-gray-600 dark:text-gray-300">
141
+ Full type safety with enhanced component definitions
142
+ </p>
143
+ </Card>
144
+
145
+ <Card className="text-center p-6">
146
+ <div className="mx-auto w-12 h-12 bg-orange-100 dark:bg-orange-900 rounded-lg flex items-center justify-center mb-4">
147
+ <svg className="h-6 w-6 text-orange-600 dark:text-orange-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
148
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" />
149
+ </svg>
150
+ </div>
151
+ <h3 className="text-xl font-semibold mb-2">Payments Integration</h3>
152
+ <p className="text-gray-600 dark:text-gray-300">
153
+ Complete payment processing with @digilogiclabs/saas-factory-payments
154
+ </p>
155
+ </Card>
156
+ </div>
157
+
158
+ {/* Button Variants Showcase */}
159
+ <Card className="max-w-4xl mx-auto p-8">
160
+ <div className="text-center mb-6">
161
+ <h2 className="text-2xl font-bold mb-2">Full SaaS Package Integration</h2>
162
+ <p className="text-gray-600 dark:text-gray-300">
163
+ Complete integration of UI, Auth, and Payments packages
164
+ </p>
165
+ </div>
166
+ <div className="flex flex-wrap justify-center gap-4 mb-6">
167
+ <Button>Default Button</Button>
168
+ <Button variant="secondary">Secondary Button</Button>
169
+ <Button variant="outline">Outline Button</Button>
170
+ <Button disabled>Disabled Button</Button>
171
+ </div>
172
+ <div className="text-center">
173
+ <p className="text-sm text-gray-500">
174
+ All components from @digilogiclabs/saas-factory-ui v0.10.0 + auth v0.4.4 + payments
175
+ </p>
176
+ </div>
177
+ </Card>
178
+ </div>
179
+ </main>
180
+ )
181
+ }