@digilogiclabs/create-saas-app 1.5.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/templates/mobile/base/template/.env.example +15 -0
- package/dist/templates/mobile/base/template/App.tsx +88 -0
- package/dist/templates/mobile/base/template/app/(auth)/login.tsx +44 -0
- package/dist/templates/mobile/base/template/app/(auth)/signup.tsx +43 -0
- package/dist/templates/mobile/base/template/app/checkout.tsx +20 -0
- package/dist/templates/mobile/base/template/package.json +38 -0
- package/dist/templates/shared/auth/firebase/web/config.ts +23 -0
- package/dist/templates/shared/auth/supabase/web/config.ts +8 -0
- package/dist/templates/web/base/template/.env.example +15 -0
- package/dist/templates/web/base/template/.eslintrc.js +8 -0
- package/dist/templates/web/base/template/README.md +68 -0
- package/dist/templates/web/base/template/next.config.js +15 -0
- package/dist/templates/web/base/template/package.json +58 -0
- package/dist/templates/web/base/template/postcss.config.js +7 -0
- package/dist/templates/web/base/template/src/app/auth/callback/route.ts +18 -0
- package/dist/templates/web/base/template/src/app/checkout/page.tsx +28 -0
- package/dist/templates/web/base/template/src/app/error.tsx +97 -0
- package/dist/templates/web/base/template/src/app/globals.css +60 -0
- package/dist/templates/web/base/template/src/app/layout.tsx +35 -0
- package/dist/templates/web/base/template/src/app/loading.tsx +34 -0
- package/dist/templates/web/base/template/src/app/login/page.tsx +39 -0
- package/dist/templates/web/base/template/src/app/page.tsx +132 -0
- package/dist/templates/web/base/template/src/app/signup/page.tsx +39 -0
- package/dist/templates/web/base/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/base/template/src/components/providers/app-providers.tsx +33 -0
- package/dist/templates/web/base/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/base/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/base/template/src/components/shared/header.tsx +44 -0
- package/dist/templates/web/base/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/base/template/src/components/ui/button.tsx +56 -0
- package/dist/templates/web/base/template/src/components/ui/card.tsx +71 -0
- package/dist/templates/web/base/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/base/template/src/lib/auth-server.ts +177 -0
- package/dist/templates/web/base/template/src/lib/env.ts +46 -0
- package/dist/templates/web/base/template/src/lib/utils.ts +140 -0
- package/dist/templates/web/base/template/src/test/setup.ts +79 -0
- package/dist/templates/web/base/template/tailwind.config.js +77 -0
- package/dist/templates/web/base/template/tsconfig.json +33 -0
- package/dist/templates/web/base/template/vitest.config.ts +17 -0
- package/dist/templates/web/base/template.backup/.env.example +15 -0
- package/dist/templates/web/base/template.backup.20250817/.env.example +15 -0
- package/dist/templates/web/ui-auth/template/.env.example +15 -0
- package/dist/templates/web/ui-auth/template/.eslintrc.js +8 -0
- package/dist/templates/web/ui-auth/template/README.md +68 -0
- package/dist/templates/web/ui-auth/template/next.config.js +12 -0
- package/dist/templates/web/ui-auth/template/package.json +50 -0
- package/dist/templates/web/ui-auth/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-auth/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-auth/template/src/app/checkout/page.tsx +25 -0
- package/dist/templates/web/ui-auth/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-auth/template/src/app/globals.css +42 -0
- package/dist/templates/web/ui-auth/template/src/app/layout.tsx +33 -0
- package/dist/templates/web/ui-auth/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-auth/template/src/app/login/page.tsx +109 -0
- package/dist/templates/web/ui-auth/template/src/app/page.tsx +129 -0
- package/dist/templates/web/ui-auth/template/src/app/signup/page.tsx +128 -0
- package/dist/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +29 -0
- package/dist/templates/web/ui-auth/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/ui-auth/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth/template/src/components/shared/header.tsx +53 -0
- package/dist/templates/web/ui-auth/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-auth/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-auth/template/src/lib/utils.ts +140 -0
- package/dist/templates/web/ui-auth/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-auth/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-auth/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-auth/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-auth/template.backup/.env.example +15 -0
- package/dist/templates/web/ui-auth/template.backup.20250817/.env.example +15 -0
- package/dist/templates/web/ui-auth-payments/template/.env.example +15 -0
- package/dist/templates/web/ui-auth-payments/template/README.md +165 -0
- package/dist/templates/web/ui-auth-payments/template/middleware.ts +68 -0
- package/dist/templates/web/ui-auth-payments/template/next.config.js +12 -0
- package/dist/templates/web/ui-auth-payments/template/package-lock.json +12240 -0
- package/dist/templates/web/ui-auth-payments/template/package.json +52 -0
- package/dist/templates/web/ui-auth-payments/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +211 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +142 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/layout.tsx +22 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +183 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/globals.css +42 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/layout.tsx +33 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +38 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/login/page.tsx +109 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +143 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +50 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +128 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +52 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +144 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +68 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +185 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +32 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +62 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +246 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +340 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/auth-server.ts +177 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/utils.ts +140 -0
- package/dist/templates/web/ui-auth-payments/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-auth-payments/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-auth-payments/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-auth-payments/template/tsconfig.tsbuildinfo +1 -0
- package/dist/templates/web/ui-auth-payments/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-auth-payments-audio/template/.env.example +15 -0
- package/dist/templates/web/ui-auth-payments-audio/template/README.md +187 -0
- package/dist/templates/web/ui-auth-payments-audio/template/middleware.ts +68 -0
- package/dist/templates/web/ui-auth-payments-audio/template/next.config.js +12 -0
- package/dist/templates/web/ui-auth-payments-audio/template/package-lock.json +12241 -0
- package/dist/templates/web/ui-auth-payments-audio/template/package.json +53 -0
- package/dist/templates/web/ui-auth-payments-audio/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +211 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +142 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/dashboard/layout.tsx +22 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +183 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/globals.css +42 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +35 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/login/page.tsx +6 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +181 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/signup/page.tsx +6 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +52 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +144 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +185 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +32 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +62 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/actions/auth.ts +246 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/actions/index.ts +14 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/auth-server.ts +177 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/utils.ts +140 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-auth-payments-audio/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-auth-payments-audio/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-auth-payments-audio/template/tsconfig.tsbuildinfo +1 -0
- package/dist/templates/web/ui-auth-payments-audio/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-auth-payments-video/template/.env.example +15 -0
- package/dist/templates/web/ui-auth-payments-video/template/README.md +190 -0
- package/dist/templates/web/ui-auth-payments-video/template/next.config.js +12 -0
- package/dist/templates/web/ui-auth-payments-video/template/package.json +53 -0
- package/dist/templates/web/ui-auth-payments-video/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +211 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +142 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/globals.css +42 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +33 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +109 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +187 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +128 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +32 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +62 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/lib/utils.ts +140 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-auth-payments-video/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-auth-payments-video/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-auth-payments-video/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-only/template/.env.example +15 -0
- package/dist/templates/web/ui-only/template/.eslintrc.js +8 -0
- package/dist/templates/web/ui-only/template/README.md +68 -0
- package/dist/templates/web/ui-only/template/next.config.js +12 -0
- package/dist/templates/web/ui-only/template/package.json +49 -0
- package/dist/templates/web/ui-only/template/postcss.config.js +7 -0
- package/dist/templates/web/ui-only/template/src/app/auth/callback/route.ts +12 -0
- package/dist/templates/web/ui-only/template/src/app/checkout/page.tsx +25 -0
- package/dist/templates/web/ui-only/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-only/template/src/app/globals.css +42 -0
- package/dist/templates/web/ui-only/template/src/app/layout.tsx +33 -0
- package/dist/templates/web/ui-only/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-only/template/src/app/login/page.tsx +63 -0
- package/dist/templates/web/ui-only/template/src/app/page.tsx +91 -0
- package/dist/templates/web/ui-only/template/src/app/signup/page.tsx +79 -0
- package/dist/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-only/template/src/components/providers/app-providers.tsx +26 -0
- package/dist/templates/web/ui-only/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/ui-only/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-only/template/src/components/shared/header.tsx +53 -0
- package/dist/templates/web/ui-only/template/src/components/ui/badge.tsx +36 -0
- package/dist/templates/web/ui-only/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-only/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-only/template/src/lib/utils.ts +140 -0
- package/dist/templates/web/ui-only/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-only/template/tailwind.config.js +77 -0
- package/dist/templates/web/ui-only/template/tsconfig.json +33 -0
- package/dist/templates/web/ui-only/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-only/template.backup/.env.example +15 -0
- package/dist/templates/web/ui-only/template.backup.20250817/.env.example +15 -0
- package/dist/templates/web/ui-package-test/template/next-env.d.ts +5 -0
- package/dist/templates/web/ui-package-test/template/package.json +42 -0
- package/dist/templates/web/ui-package-test/template/src/app/page.tsx +106 -0
- package/dist/templates/web/ui-package-test/template/tsconfig.json +41 -0
- package/package.json +3 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config'
|
|
2
|
+
import react from '@vitejs/plugin-react'
|
|
3
|
+
import path from 'path'
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [react()],
|
|
7
|
+
test: {
|
|
8
|
+
environment: 'jsdom',
|
|
9
|
+
setupFiles: ['./src/test/setup.ts'],
|
|
10
|
+
globals: true,
|
|
11
|
+
},
|
|
12
|
+
resolve: {
|
|
13
|
+
alias: {
|
|
14
|
+
'@': path.resolve(__dirname, './src'),
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Auth Configuration
|
|
2
|
+
NEXT_PUBLIC_AUTH_PROVIDER=supabase|firebase
|
|
3
|
+
|
|
4
|
+
# Supabase
|
|
5
|
+
NEXT_PUBLIC_SUPABASE_URL=
|
|
6
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY=
|
|
7
|
+
|
|
8
|
+
# Firebase
|
|
9
|
+
NEXT_PUBLIC_FIREBASE_API_KEY=
|
|
10
|
+
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
|
|
11
|
+
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
|
|
12
|
+
|
|
13
|
+
# Payments
|
|
14
|
+
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
|
|
15
|
+
STRIPE_SECRET_KEY=
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# {{titleCaseName}}
|
|
2
|
+
|
|
3
|
+
{{description}}
|
|
4
|
+
|
|
5
|
+
This is a Next.js 15 project created with the **Audio Player App** template from `@digilogiclabs/create-saas-app`. It includes:
|
|
6
|
+
|
|
7
|
+
- 🎵 **Audio Player** - Advanced audio streaming capabilities
|
|
8
|
+
- 🎨 **UI Components** - @digilogiclabs/saas-factory-ui v0.10.0 with audio player
|
|
9
|
+
- 🔐 **Authentication** - @digilogiclabs/saas-factory-auth v0.4.4
|
|
10
|
+
- 💳 **Payments** - @digilogiclabs/saas-factory-payments v0.3.0
|
|
11
|
+
- ⚡ **Next.js 15** - Latest React framework
|
|
12
|
+
- 🎯 **TypeScript** - Full type safety
|
|
13
|
+
- 🎨 **Tailwind CSS** - Utility-first styling
|
|
14
|
+
- 🌙 **Dark Mode** - Built-in theme support
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
### Audio Player
|
|
19
|
+
- Full-featured audio player with playlist support
|
|
20
|
+
- Play/pause, skip, shuffle, repeat controls
|
|
21
|
+
- Volume control and mute functionality
|
|
22
|
+
- Progress bar with seeking capability
|
|
23
|
+
- Track information display with cover art
|
|
24
|
+
- Cross-platform support (Web + React Native)
|
|
25
|
+
|
|
26
|
+
### Authentication
|
|
27
|
+
- User registration and login
|
|
28
|
+
- Protected routes
|
|
29
|
+
- Session management
|
|
30
|
+
- Sign out functionality
|
|
31
|
+
|
|
32
|
+
### Payments Integration
|
|
33
|
+
- Subscription plans display
|
|
34
|
+
- Payment form with Stripe integration
|
|
35
|
+
- Billing history
|
|
36
|
+
- Payment method management
|
|
37
|
+
- Subscription management
|
|
38
|
+
|
|
39
|
+
### UI Components
|
|
40
|
+
- Modern, accessible components including AudioPlayer
|
|
41
|
+
- Dark/light theme support
|
|
42
|
+
- Responsive design
|
|
43
|
+
- TypeScript definitions
|
|
44
|
+
|
|
45
|
+
## Getting Started
|
|
46
|
+
|
|
47
|
+
### Prerequisites
|
|
48
|
+
- Node.js 18+
|
|
49
|
+
- npm, yarn, or pnpm
|
|
50
|
+
|
|
51
|
+
### Installation
|
|
52
|
+
|
|
53
|
+
1. Install dependencies:
|
|
54
|
+
```bash
|
|
55
|
+
npm install
|
|
56
|
+
# or
|
|
57
|
+
yarn install
|
|
58
|
+
# or
|
|
59
|
+
pnpm install
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
2. Set up environment variables:
|
|
63
|
+
```bash
|
|
64
|
+
cp .env.example .env.local
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Edit `.env.local` with your configuration:
|
|
68
|
+
```env
|
|
69
|
+
# Authentication (choose one)
|
|
70
|
+
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
|
|
71
|
+
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
|
|
72
|
+
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
|
|
73
|
+
|
|
74
|
+
# OR
|
|
75
|
+
|
|
76
|
+
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
|
|
77
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
|
|
78
|
+
|
|
79
|
+
# Payments
|
|
80
|
+
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
|
|
81
|
+
STRIPE_SECRET_KEY=your_stripe_secret_key
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
3. Run the development server:
|
|
85
|
+
```bash
|
|
86
|
+
npm run dev
|
|
87
|
+
# or
|
|
88
|
+
yarn dev
|
|
89
|
+
# or
|
|
90
|
+
pnpm dev
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
94
|
+
|
|
95
|
+
## Available Pages
|
|
96
|
+
|
|
97
|
+
- `/` - Home page with feature showcase
|
|
98
|
+
- `/login` - User authentication
|
|
99
|
+
- `/signup` - User registration
|
|
100
|
+
- `/checkout` - Subscription plans and payment
|
|
101
|
+
- `/billing` - Subscription and billing management
|
|
102
|
+
|
|
103
|
+
## Package Integration
|
|
104
|
+
|
|
105
|
+
### UI Package (@digilogiclabs/saas-factory-ui)
|
|
106
|
+
```tsx
|
|
107
|
+
import { Button, Card, AudioPlayer } from '@digilogiclabs/saas-factory-ui'
|
|
108
|
+
|
|
109
|
+
<Button variant="primary">Click me</Button>
|
|
110
|
+
<Card>Content here</Card>
|
|
111
|
+
<AudioPlayer
|
|
112
|
+
tracks={[
|
|
113
|
+
{
|
|
114
|
+
id: '1',
|
|
115
|
+
title: 'Song Title',
|
|
116
|
+
artist: 'Artist Name',
|
|
117
|
+
album: 'Album Name',
|
|
118
|
+
duration: 180,
|
|
119
|
+
src: '/path/to/audio.mp3',
|
|
120
|
+
coverArt: '/path/to/cover.jpg'
|
|
121
|
+
}
|
|
122
|
+
]}
|
|
123
|
+
/>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Auth Package (@digilogiclabs/saas-factory-auth)
|
|
127
|
+
```tsx
|
|
128
|
+
import { useAuth } from '@digilogiclabs/saas-factory-auth'
|
|
129
|
+
|
|
130
|
+
const { user, signIn, signOut, loading } = useAuth()
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Payments Package (@digilogiclabs/saas-factory-payments)
|
|
134
|
+
```tsx
|
|
135
|
+
import {
|
|
136
|
+
PaymentForm,
|
|
137
|
+
SubscriptionPlans,
|
|
138
|
+
SubscriptionManager
|
|
139
|
+
} from '@digilogiclabs/saas-factory-payments'
|
|
140
|
+
|
|
141
|
+
<SubscriptionPlans onPlanSelect={handlePlanSelect} />
|
|
142
|
+
<PaymentForm onSuccess={handleSuccess} onError={handleError} />
|
|
143
|
+
<SubscriptionManager onSubscriptionChange={handleChange} />
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Project Structure
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
src/
|
|
150
|
+
├── app/ # Next.js 15 app directory
|
|
151
|
+
│ ├── billing/ # Billing and subscription management
|
|
152
|
+
│ ├── checkout/ # Payment and subscription selection
|
|
153
|
+
│ ├── login/ # Authentication pages
|
|
154
|
+
│ ├── signup/
|
|
155
|
+
│ └── layout.tsx # Root layout with providers
|
|
156
|
+
├── components/
|
|
157
|
+
│ ├── providers/ # App-wide providers (Auth, Payments, Theme)
|
|
158
|
+
│ ├── shared/ # Shared components (Header, etc.)
|
|
159
|
+
│ └── ui/ # UI components
|
|
160
|
+
└── lib/ # Utilities and configurations
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Deployment
|
|
164
|
+
|
|
165
|
+
### Vercel (Recommended)
|
|
166
|
+
1. Push your code to GitHub
|
|
167
|
+
2. Connect your repository to Vercel
|
|
168
|
+
3. Add environment variables in Vercel dashboard
|
|
169
|
+
4. Deploy
|
|
170
|
+
|
|
171
|
+
### Other Platforms
|
|
172
|
+
This is a standard Next.js application and can be deployed to any platform that supports Node.js.
|
|
173
|
+
|
|
174
|
+
## Learn More
|
|
175
|
+
|
|
176
|
+
- [Next.js Documentation](https://nextjs.org/docs)
|
|
177
|
+
- [Digi Logic Labs Documentation](https://docs.digilogiclabs.com)
|
|
178
|
+
- [SaaS Factory UI Components](https://ui.digilogiclabs.com)
|
|
179
|
+
- [SaaS Factory Auth Guide](https://auth.digilogiclabs.com)
|
|
180
|
+
- [SaaS Factory Payments Guide](https://payments.digilogiclabs.com)
|
|
181
|
+
|
|
182
|
+
## Support
|
|
183
|
+
|
|
184
|
+
- 📚 [Documentation](https://docs.digilogiclabs.com)
|
|
185
|
+
- 💬 [Discord Community](https://discord.gg/digilogiclabs)
|
|
186
|
+
- 🐛 [Report Issues](https://github.com/DigiLogicLabs/create-saas-app/issues)
|
|
187
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server'
|
|
2
|
+
import { env } from './src/lib/env'
|
|
3
|
+
|
|
4
|
+
export async function middleware(request: NextRequest) {
|
|
5
|
+
// Get auth token from cookies
|
|
6
|
+
const authToken = request.cookies.get('saas-factory-auth-token')?.value
|
|
7
|
+
const user = request.cookies.get('saas-factory-auth-user')?.value
|
|
8
|
+
|
|
9
|
+
const isAuthenticated = !!(authToken && user)
|
|
10
|
+
const { pathname } = request.nextUrl
|
|
11
|
+
|
|
12
|
+
// Define protected routes
|
|
13
|
+
const protectedRoutes = ['/dashboard', '/profile', '/settings']
|
|
14
|
+
const authRoutes = ['/login', '/signup']
|
|
15
|
+
|
|
16
|
+
// Check if the current path is protected
|
|
17
|
+
const isProtectedRoute = protectedRoutes.some(route =>
|
|
18
|
+
pathname.startsWith(route)
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
// Check if the current path is an auth route
|
|
22
|
+
const isAuthRoute = authRoutes.some(route =>
|
|
23
|
+
pathname.startsWith(route)
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
// Redirect unauthenticated users from protected routes
|
|
27
|
+
if (isProtectedRoute && !isAuthenticated) {
|
|
28
|
+
const loginUrl = new URL('/login', request.url)
|
|
29
|
+
loginUrl.searchParams.set('from', pathname)
|
|
30
|
+
return NextResponse.redirect(loginUrl)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Redirect authenticated users from auth routes
|
|
34
|
+
if (isAuthRoute && isAuthenticated) {
|
|
35
|
+
const redirectUrl = request.nextUrl.searchParams.get('from') || '/'
|
|
36
|
+
return NextResponse.redirect(new URL(redirectUrl, request.url))
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Add security headers
|
|
40
|
+
const response = NextResponse.next()
|
|
41
|
+
|
|
42
|
+
// Add CSRF protection headers
|
|
43
|
+
response.headers.set('X-Frame-Options', 'DENY')
|
|
44
|
+
response.headers.set('X-Content-Type-Options', 'nosniff')
|
|
45
|
+
response.headers.set('Referrer-Policy', 'origin-when-cross-origin')
|
|
46
|
+
|
|
47
|
+
// Add CSP header for additional security
|
|
48
|
+
if (env.NODE_ENV === 'production') {
|
|
49
|
+
response.headers.set(
|
|
50
|
+
'Content-Security-Policy',
|
|
51
|
+
"default-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://js.stripe.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https://api.stripe.com"
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return response
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const config = {
|
|
59
|
+
matcher: [
|
|
60
|
+
// Match all request paths except for the ones starting with:
|
|
61
|
+
// - api (API routes)
|
|
62
|
+
// - _next/static (static files)
|
|
63
|
+
// - _next/image (image optimization files)
|
|
64
|
+
// - favicon.ico (favicon file)
|
|
65
|
+
// - public folder files
|
|
66
|
+
'/((?!api|_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',
|
|
67
|
+
],
|
|
68
|
+
}
|