@asynx/create-asynx-next-app 1.0.3 → 1.0.6
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/CONTRIBUTING.md +16 -15
- package/README.md +3 -3
- package/create-asynx-next-app-wrapper/index.js +3 -0
- package/create-asynx-next-app-wrapper/package.json +12 -0
- package/dist/cli.js +6 -6
- package/dist/constants/template.js +5 -5
- package/package.json +2 -2
- package/src/cli.ts +6 -6
- package/src/constants/template.ts +6 -6
- package/templates/advanced/.env.example +23 -0
- package/templates/advanced/README.md +148 -0
- package/templates/advanced/next.config.mjs +14 -0
- package/templates/{simple → advanced}/package.json +4 -0
- package/templates/advanced/postcss.config.mjs +6 -0
- package/templates/advanced/src/app/app/billing/page.tsx +57 -0
- package/templates/advanced/src/app/app/layout.tsx +25 -0
- package/templates/advanced/src/app/app/page.tsx +36 -0
- package/templates/advanced/src/app/app/settings/page.tsx +50 -0
- package/templates/advanced/src/app/auth/login/page.tsx +41 -0
- package/templates/advanced/src/app/auth/signup/page.tsx +45 -0
- package/templates/advanced/src/app/globals.css +151 -0
- package/templates/advanced/src/app/layout.tsx +19 -0
- package/templates/advanced/src/app/page.tsx +25 -0
- package/templates/advanced/src/lib/api/client.ts +67 -0
- package/templates/advanced/src/lib/api/config/app.ts +19 -0
- package/templates/advanced/src/lib/api/config/constants.ts +38 -0
- package/templates/advanced/src/lib/api/features/analytics/lib/analytics-service.ts +26 -0
- package/templates/advanced/src/lib/api/features/app-shell/components/app-header.tsx +18 -0
- package/templates/advanced/src/lib/api/features/app-shell/components/app-sidebar.tsx +38 -0
- package/templates/advanced/src/lib/api/features/auth/lib/auth-service.ts +36 -0
- package/templates/advanced/src/lib/api/features/billing/lib/billing-service.ts +38 -0
- package/templates/advanced/src/types/index.ts +21 -0
- package/templates/advanced/tsconfig.json +29 -0
- package/templates/standard/README.md +53 -0
- package/templates/{moderate → standard}/package.json +4 -0
- package/templates/standard/postcss.config.mjs +6 -0
- package/templates/standard/src/app/(dashboard)/dashboard/page.tsx +45 -0
- package/templates/standard/src/app/(dashboard)/layout.tsx +30 -0
- package/templates/standard/src/app/(public)/layout.tsx +16 -0
- package/templates/standard/src/app/(public)/login/page.tsx +33 -0
- package/templates/standard/src/app/globals.css +158 -0
- package/templates/standard/src/app/layout.tsx +38 -0
- package/templates/standard/src/app/page.tsx +27 -0
- package/templates/standard/src/lib/api.ts +37 -0
- package/templates/standard/src/lib/constants.ts +14 -0
- package/templates/{simple → standard}/tsconfig.json +12 -5
- package/templates/{saas → starter}/package.json +4 -0
- package/templates/{saas → starter}/src/app/globals.css +1 -0
- package/templates/{moderate → starter}/tsconfig.json +10 -4
- package/templates/moderate/src/app/globals.css +0 -8
- package/templates/saas/src/app/layout.tsx +0 -18
- package/templates/saas/src/app/page.tsx +0 -8
- package/templates/saas/tsconfig.json +0 -20
- package/templates/simple/next-env.d.ts +0 -4
- package/templates/simple/src/app/globals.css +0 -8
- package/templates/simple/src/app/layout.tsx +0 -18
- package/templates/simple/src/app/page.tsx +0 -8
- /package/templates/{moderate → advanced}/utils/async.ts +0 -0
- /package/templates/{moderate → advanced}/utils/date.ts +0 -0
- /package/templates/{moderate → advanced}/utils/index.ts +0 -0
- /package/templates/{moderate → advanced}/utils/number.ts +0 -0
- /package/templates/{moderate → advanced}/utils/string.ts +0 -0
- /package/templates/{moderate → standard}/next-env.d.ts +0 -0
- /package/templates/{saas → standard}/utils/async.ts +0 -0
- /package/templates/{saas → standard}/utils/date.ts +0 -0
- /package/templates/{saas → standard}/utils/index.ts +0 -0
- /package/templates/{saas → standard}/utils/number.ts +0 -0
- /package/templates/{saas → standard}/utils/string.ts +0 -0
- /package/templates/{saas → starter}/next-env.d.ts +0 -0
- /package/templates/{moderate → starter}/src/app/layout.tsx +0 -0
- /package/templates/{moderate → starter}/src/app/page.tsx +0 -0
- /package/templates/{simple → starter}/utils/async.ts +0 -0
- /package/templates/{simple → starter}/utils/date.ts +0 -0
- /package/templates/{simple → starter}/utils/index.ts +0 -0
- /package/templates/{simple → starter}/utils/number.ts +0 -0
- /package/templates/{simple → starter}/utils/string.ts +0 -0
package/CONTRIBUTING.md
CHANGED
|
@@ -4,19 +4,17 @@ Thank you for considering contributing ❤️ We appreciate your help in making
|
|
|
4
4
|
|
|
5
5
|
We welcome contributions in the form of:
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
- 🐛 Bug fixes
|
|
8
|
+
- ✨ Template improvements
|
|
9
|
+
- 🆕 New templates
|
|
10
|
+
- 📚 Documentation improvements
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
## 🛠 Development Setup
|
|
15
15
|
|
|
16
|
-
|
|
17
16
|
To get started with development, clone the repository and install dependencies:
|
|
18
17
|
|
|
19
|
-
|
|
20
18
|
```bash
|
|
21
19
|
git clone [https://github.com/Asynx-Pvt-Ltd/create-asynx-next-app.git](https://github.com/Asynx-Pvt-Ltd/create-asynx-next-app.git)
|
|
22
20
|
cd create-asynx-next-app
|
|
@@ -28,15 +26,16 @@ pnpm dev
|
|
|
28
26
|
```
|
|
29
27
|
|
|
30
28
|
## 📦 Templates
|
|
29
|
+
|
|
31
30
|
The core project templates live in the templates/ directory:
|
|
32
31
|
|
|
33
32
|
```bash
|
|
34
33
|
templates/
|
|
35
|
-
├─
|
|
36
|
-
├─
|
|
37
|
-
└─
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
├─ starter/
|
|
35
|
+
├─ standard/
|
|
36
|
+
└─ advanced/
|
|
37
|
+
```
|
|
38
|
+
|
|
40
39
|
Each template must adhere to the following rules:
|
|
41
40
|
|
|
42
41
|
- Be a valid Next.js App Router project.
|
|
@@ -44,6 +43,7 @@ Each template must adhere to the following rules:
|
|
|
44
43
|
- Avoid external runtime dependencies on Asynx packages.
|
|
45
44
|
|
|
46
45
|
## 🧪 Testing changes
|
|
46
|
+
|
|
47
47
|
Before opening a Pull Request, please ensure your changes work by building the CLI and testing it locally:
|
|
48
48
|
|
|
49
49
|
```bash
|
|
@@ -54,6 +54,7 @@ node dist/index.js test-app
|
|
|
54
54
|
Verify the generated application in the test-app directory runs correctly.
|
|
55
55
|
|
|
56
56
|
## 📌 Guidelines
|
|
57
|
+
|
|
57
58
|
When writing code, please follow these principles:
|
|
58
59
|
|
|
59
60
|
- Keep code readable.
|
|
@@ -63,6 +64,7 @@ When writing code, please follow these principles:
|
|
|
63
64
|
Follow the existing structure of the codebase.
|
|
64
65
|
|
|
65
66
|
## 📬 Pull Requests
|
|
67
|
+
|
|
66
68
|
When submitting a Pull Request (PR):
|
|
67
69
|
|
|
68
70
|
- Describe what you changed.
|
|
@@ -71,7 +73,6 @@ When submitting a Pull Request (PR):
|
|
|
71
73
|
|
|
72
74
|
Thanks for helping improve the project 🚀
|
|
73
75
|
|
|
74
|
-
|
|
75
76
|
## `CODE_OF_CONDUCT.md`
|
|
76
77
|
|
|
77
78
|
---
|
|
@@ -82,9 +83,9 @@ This project is governed by a standard open-source code of conduct. We are commi
|
|
|
82
83
|
|
|
83
84
|
We expect all contributors to adhere to the following guidelines:
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
- Be **respectful** of differing viewpoints and experiences.
|
|
87
|
+
- Be **inclusive** and encourage participation from everyone.
|
|
88
|
+
- Be **constructive** in all communication and feedback.
|
|
88
89
|
|
|
89
90
|
Harassment, discrimination, or abusive behavior will not be tolerated.
|
|
90
91
|
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
`create-asynx-next-app` gives you a **direction**.
|
|
8
8
|
|
|
9
|
-
This CLI scaffolds **real-world Next.js architectures** — from
|
|
9
|
+
This CLI scaffolds **real-world Next.js architectures** — from starter MVPs to
|
|
10
10
|
SaaS-grade applications — without locking you into any framework or vendor.
|
|
11
11
|
|
|
12
12
|
## Quick Start
|
|
@@ -27,8 +27,8 @@ pnpm create asynx-next-app my-app
|
|
|
27
27
|
|
|
28
28
|
During setup, you will be prompted to choose a template:
|
|
29
29
|
|
|
30
|
-
- **
|
|
31
|
-
- **
|
|
30
|
+
- **Starter** — landing pages, MVPs, small tools
|
|
31
|
+
- **Standard** — dashboards, content platforms, startups
|
|
32
32
|
- **SaaS** — scalable, domain-driven architecture for real products
|
|
33
33
|
|
|
34
34
|
Templates differ only in structure — you own all the code.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-asynx-next-app",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Create Next.js apps using Asynx Devs templates",
|
|
5
|
+
"bin": {
|
|
6
|
+
"create-asynx-next-app": "index.js"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@asynx/create-asynx-next-app": "^0.1.0"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT"
|
|
12
|
+
}
|
package/dist/cli.js
CHANGED
|
@@ -7,12 +7,12 @@ function parseArgs() {
|
|
|
7
7
|
const args = process.argv.slice(2);
|
|
8
8
|
return {
|
|
9
9
|
projectName: args[0],
|
|
10
|
-
template: args.includes('--
|
|
11
|
-
? '
|
|
12
|
-
: args.includes('--
|
|
13
|
-
? '
|
|
14
|
-
: args.includes('--
|
|
15
|
-
? '
|
|
10
|
+
template: args.includes('--starter')
|
|
11
|
+
? 'starter'
|
|
12
|
+
: args.includes('--standard')
|
|
13
|
+
? 'standard'
|
|
14
|
+
: args.includes('--advanced')
|
|
15
|
+
? 'advanced'
|
|
16
16
|
: undefined,
|
|
17
17
|
};
|
|
18
18
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export const TEMPLATES = [
|
|
2
2
|
{
|
|
3
|
-
value: '
|
|
4
|
-
title: '
|
|
3
|
+
value: 'starter',
|
|
4
|
+
title: 'Starter App',
|
|
5
5
|
description: 'Landing pages, MVPs, small tools',
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
|
-
value: '
|
|
9
|
-
title: '
|
|
8
|
+
value: 'standard',
|
|
9
|
+
title: 'Standard App',
|
|
10
10
|
description: 'Dashboards, content platforms, startups',
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
|
-
value: '
|
|
13
|
+
value: 'advanced',
|
|
14
14
|
title: 'SaaS / Complex App',
|
|
15
15
|
description: 'Multi-tenant SaaS, role-based platforms',
|
|
16
16
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asynx/create-asynx-next-app",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Opinionated Next.js App Router scaffolder by Asynx Devs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"scaffold",
|
|
21
21
|
"boilerplate",
|
|
22
22
|
"starter",
|
|
23
|
-
"
|
|
23
|
+
"advanced",
|
|
24
24
|
"mvp",
|
|
25
25
|
"asynx"
|
|
26
26
|
],
|
package/src/cli.ts
CHANGED
|
@@ -14,12 +14,12 @@ function parseArgs(): CliOptions {
|
|
|
14
14
|
|
|
15
15
|
return {
|
|
16
16
|
projectName: args[0],
|
|
17
|
-
template: args.includes('--
|
|
18
|
-
? '
|
|
19
|
-
: args.includes('--
|
|
20
|
-
? '
|
|
21
|
-
: args.includes('--
|
|
22
|
-
? '
|
|
17
|
+
template: args.includes('--starter')
|
|
18
|
+
? 'starter'
|
|
19
|
+
: args.includes('--standard')
|
|
20
|
+
? 'standard'
|
|
21
|
+
: args.includes('--advanced')
|
|
22
|
+
? 'advanced'
|
|
23
23
|
: undefined,
|
|
24
24
|
};
|
|
25
25
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export type TemplateType = '
|
|
1
|
+
export type TemplateType = 'starter' | 'standard' | 'advanced';
|
|
2
2
|
|
|
3
3
|
export const TEMPLATES = [
|
|
4
4
|
{
|
|
5
|
-
value: '
|
|
6
|
-
title: '
|
|
5
|
+
value: 'starter',
|
|
6
|
+
title: 'Starter App',
|
|
7
7
|
description: 'Landing pages, MVPs, small tools',
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
|
-
value: '
|
|
11
|
-
title: '
|
|
10
|
+
value: 'standard',
|
|
11
|
+
title: 'Standard App',
|
|
12
12
|
description: 'Dashboards, content platforms, startups',
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
value: '
|
|
15
|
+
value: 'advanced',
|
|
16
16
|
title: 'SaaS / Complex App',
|
|
17
17
|
description: 'Multi-tenant SaaS, role-based platforms',
|
|
18
18
|
},
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# App Configuration
|
|
2
|
+
NEXT_PUBLIC_APP_URL=http://localhost:3000
|
|
3
|
+
NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_APP_URL/api
|
|
4
|
+
|
|
5
|
+
# Authentication
|
|
6
|
+
# Add your auth provider keys here
|
|
7
|
+
# AUTH_SECRET=
|
|
8
|
+
# NEXT_PUBLIC_AUTH_PROVIDER=
|
|
9
|
+
|
|
10
|
+
# Database
|
|
11
|
+
# DATABASE_URL=
|
|
12
|
+
|
|
13
|
+
# Payment Provider (Stripe example)
|
|
14
|
+
# STRIPE_SECRET_KEY=
|
|
15
|
+
# NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
|
|
16
|
+
# STRIPE_WEBHOOK_SECRET=
|
|
17
|
+
|
|
18
|
+
# Analytics
|
|
19
|
+
# NEXT_PUBLIC_ANALYTICS_ID=
|
|
20
|
+
|
|
21
|
+
# Email
|
|
22
|
+
# EMAIL_FROM=
|
|
23
|
+
# EMAIL_PROVIDER=
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Advanced Template (SaaS)
|
|
2
|
+
|
|
3
|
+
This template is designed for **real SaaS products, multi-feature applications, and long-term scalable codebases**.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
This template follows a **domain-driven, feature-based architecture** for maximum scalability.
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
src/
|
|
11
|
+
├── app/
|
|
12
|
+
│ ├── auth/ # Auth feature routes
|
|
13
|
+
│ │ ├── login/
|
|
14
|
+
│ │ └── signup/
|
|
15
|
+
│ ├── app/ # Main app shell (authenticated)
|
|
16
|
+
│ │ ├── billing/
|
|
17
|
+
│ │ ├── settings/
|
|
18
|
+
│ │ ├── layout.tsx # App shell layout
|
|
19
|
+
│ │ └── page.tsx # Dashboard
|
|
20
|
+
│ ├── layout.tsx # Root layout
|
|
21
|
+
│ ├── page.tsx # Landing page
|
|
22
|
+
│ └── globals.css
|
|
23
|
+
├── features/ # Feature modules (domains)
|
|
24
|
+
│ ├── app-shell/ # Core navigation & layout
|
|
25
|
+
│ │ └── components/
|
|
26
|
+
│ ├── auth/ # Authentication domain
|
|
27
|
+
│ │ └── lib/
|
|
28
|
+
│ ├── billing/ # Billing & subscriptions
|
|
29
|
+
│ │ └── lib/
|
|
30
|
+
│ └── analytics/ # Analytics tracking
|
|
31
|
+
│ └── lib/
|
|
32
|
+
├── lib/ # Shared infrastructure
|
|
33
|
+
│ ├── api/ # API client
|
|
34
|
+
│ │ └── client.ts
|
|
35
|
+
│ └── config/ # App configuration
|
|
36
|
+
│ ├── app.ts
|
|
37
|
+
│ └── constants.ts
|
|
38
|
+
├── types/ # Shared TypeScript types
|
|
39
|
+
│ └── index.ts
|
|
40
|
+
└── utils/ # Utility functions
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Key Principles
|
|
44
|
+
|
|
45
|
+
### 1. Feature-Based Organization
|
|
46
|
+
Each major feature/domain gets its own folder in \`features/\`:
|
|
47
|
+
- Contains all feature-specific logic, components, and services
|
|
48
|
+
- Self-contained and independently testable
|
|
49
|
+
- Easy to extract into microservices later
|
|
50
|
+
|
|
51
|
+
### 2. Server/Client Boundary
|
|
52
|
+
- Services in \`lib/\` folders handle business logic
|
|
53
|
+
- Components handle presentation
|
|
54
|
+
- Clear separation prevents vendor lock-in
|
|
55
|
+
|
|
56
|
+
### 3. Shared Infrastructure
|
|
57
|
+
The \`lib/\` folder contains code shared across features:
|
|
58
|
+
- API client
|
|
59
|
+
- Configuration
|
|
60
|
+
- Auth utilities
|
|
61
|
+
- Database helpers (when added)
|
|
62
|
+
|
|
63
|
+
### 4. Scalability Patterns
|
|
64
|
+
This structure supports:
|
|
65
|
+
- Multi-tenant architectures
|
|
66
|
+
- Role-based access control
|
|
67
|
+
- Feature flags
|
|
68
|
+
- Background jobs
|
|
69
|
+
- Webhooks and integrations
|
|
70
|
+
|
|
71
|
+
## Getting Started
|
|
72
|
+
|
|
73
|
+
### 1. Configure Your App
|
|
74
|
+
Edit \`lib/config/app.ts\` with your app details and environment variables.
|
|
75
|
+
|
|
76
|
+
### 2. Set Up Authentication
|
|
77
|
+
Implement real auth in \`features/auth/lib/auth-service.ts\`:
|
|
78
|
+
- Add your auth provider (Supabase, Clerk, Auth.js, etc.)
|
|
79
|
+
- Update login/signup logic
|
|
80
|
+
- Add middleware for route protection
|
|
81
|
+
|
|
82
|
+
### 3. Add Billing
|
|
83
|
+
Implement billing in \`features/billing/lib/billing-service.ts\`:
|
|
84
|
+
- Integrate Stripe, Paddle, or your payment provider
|
|
85
|
+
- Set up webhooks in \`app/api/webhooks/\`
|
|
86
|
+
- Configure subscription plans
|
|
87
|
+
|
|
88
|
+
### 4. Build Features
|
|
89
|
+
Create new feature modules in \`features/\`:
|
|
90
|
+
```
|
|
91
|
+
features/
|
|
92
|
+
your-feature/
|
|
93
|
+
components/
|
|
94
|
+
lib/
|
|
95
|
+
types/
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Best Practices
|
|
99
|
+
|
|
100
|
+
### Service Layer Pattern
|
|
101
|
+
Keep business logic in service files:
|
|
102
|
+
```typescript
|
|
103
|
+
// features/your-feature/lib/your-service.ts
|
|
104
|
+
export class YourService {
|
|
105
|
+
async doSomething() {
|
|
106
|
+
// Business logic here
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### API Routes
|
|
112
|
+
Create API routes in \`app/api/\`:
|
|
113
|
+
```typescript
|
|
114
|
+
// app/api/your-feature/route.ts
|
|
115
|
+
export async function POST(request: Request) {
|
|
116
|
+
// Handle request
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Type Safety
|
|
121
|
+
Define shared types in \`types/\`:
|
|
122
|
+
```typescript
|
|
123
|
+
// types/your-feature.ts
|
|
124
|
+
export type YourType = {
|
|
125
|
+
// ...
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Scaling Considerations
|
|
130
|
+
|
|
131
|
+
This template is ready for:
|
|
132
|
+
- **Multi-tenancy**: Add tenant ID to database queries
|
|
133
|
+
- **RBAC**: Extend User type with permissions
|
|
134
|
+
- **Feature flags**: Add feature detection to \`lib/config\`
|
|
135
|
+
- **Background jobs**: Add \`lib/jobs/\` folder
|
|
136
|
+
- **Webhooks**: Create \`app/api/webhooks/\` routes
|
|
137
|
+
- **Monitoring**: Integrate Sentry, LogRocket, etc. in \`lib/monitoring\`
|
|
138
|
+
|
|
139
|
+
## No Vendor Lock-In
|
|
140
|
+
|
|
141
|
+
This template provides **structure without coupling**:
|
|
142
|
+
- Auth service can use any provider
|
|
143
|
+
- Billing service works with any payment platform
|
|
144
|
+
- Analytics service integrates with any tool
|
|
145
|
+
- Database can be added without rewriting
|
|
146
|
+
|
|
147
|
+
Simply implement the service interfaces with your chosen providers.
|
|
148
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @type {import('next').NextConfig} */
|
|
2
|
+
const nextConfig = {
|
|
3
|
+
reactStrictMode: true,
|
|
4
|
+
// Recommended for production SaaS apps
|
|
5
|
+
poweredByHeader: false,
|
|
6
|
+
typescript: {
|
|
7
|
+
ignoreBuildErrors: true,
|
|
8
|
+
},
|
|
9
|
+
images: {
|
|
10
|
+
unoptimized: true,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default nextConfig;
|
|
@@ -13,7 +13,11 @@
|
|
|
13
13
|
"react-dom": "latest"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
+
"tailwindcss": "^4.0.0",
|
|
17
|
+
"postcss": "^8.4.0",
|
|
18
|
+
"autoprefixer": "^10.4.0",
|
|
16
19
|
"typescript": "^5.0.0",
|
|
20
|
+
"@types/node": "^20.0.0",
|
|
17
21
|
"@types/react": "^18.0.0",
|
|
18
22
|
"@types/react-dom": "^18.0.0"
|
|
19
23
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Billing feature page
|
|
2
|
+
|
|
3
|
+
export default function BillingPage() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="container mx-auto">
|
|
6
|
+
<h1 className="text-3xl font-bold mb-2">Billing & Subscription</h1>
|
|
7
|
+
<p className="text-muted-foreground mb-8">Manage your subscription and billing information</p>
|
|
8
|
+
|
|
9
|
+
<div className="space-y-6">
|
|
10
|
+
{/* Current Plan */}
|
|
11
|
+
<div className="border rounded-lg p-6">
|
|
12
|
+
<h2 className="text-xl font-semibold mb-4">Current Plan</h2>
|
|
13
|
+
<div className="flex items-center justify-between">
|
|
14
|
+
<div>
|
|
15
|
+
<p className="font-medium text-lg">Pro Plan</p>
|
|
16
|
+
<p className="text-sm text-muted-foreground">$49/month • Renews on Jan 1, 2024</p>
|
|
17
|
+
</div>
|
|
18
|
+
<button className="px-4 py-2 border rounded-md hover:bg-muted">Manage Plan</button>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
{/* Payment Method */}
|
|
23
|
+
<div className="border rounded-lg p-6">
|
|
24
|
+
<h2 className="text-xl font-semibold mb-4">Payment Method</h2>
|
|
25
|
+
<div className="flex items-center justify-between">
|
|
26
|
+
<div>
|
|
27
|
+
<p className="font-medium">•••• •••• •••• 4242</p>
|
|
28
|
+
<p className="text-sm text-muted-foreground">Expires 12/24</p>
|
|
29
|
+
</div>
|
|
30
|
+
<button className="px-4 py-2 border rounded-md hover:bg-muted">Update</button>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
{/* Billing History */}
|
|
35
|
+
<div className="border rounded-lg p-6">
|
|
36
|
+
<h2 className="text-xl font-semibold mb-4">Billing History</h2>
|
|
37
|
+
<div className="space-y-3">
|
|
38
|
+
{[1, 2, 3].map((i) => (
|
|
39
|
+
<div key={i} className="flex items-center justify-between py-2">
|
|
40
|
+
<div>
|
|
41
|
+
<p className="font-medium">Pro Plan</p>
|
|
42
|
+
<p className="text-sm text-muted-foreground">Dec {i}, 2023</p>
|
|
43
|
+
</div>
|
|
44
|
+
<div className="text-right">
|
|
45
|
+
<p className="font-medium">$49.00</p>
|
|
46
|
+
<a href="#" className="text-sm text-blue-600 hover:underline">
|
|
47
|
+
Download
|
|
48
|
+
</a>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
))}
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type React from "react"
|
|
2
|
+
// App shell layout
|
|
3
|
+
// This wraps the entire authenticated application
|
|
4
|
+
|
|
5
|
+
import { AppSidebar } from "@/features/app-shell/components/app-sidebar"
|
|
6
|
+
import { AppHeader } from "@/features/app-shell/components/app-header"
|
|
7
|
+
|
|
8
|
+
export default function AppLayout({
|
|
9
|
+
children,
|
|
10
|
+
}: {
|
|
11
|
+
children: React.ReactNode
|
|
12
|
+
}) {
|
|
13
|
+
return (
|
|
14
|
+
<div className="min-h-screen flex">
|
|
15
|
+
{/* Sidebar navigation */}
|
|
16
|
+
<AppSidebar />
|
|
17
|
+
|
|
18
|
+
{/* Main content area */}
|
|
19
|
+
<div className="flex-1 flex flex-col">
|
|
20
|
+
<AppHeader />
|
|
21
|
+
<main className="flex-1 p-6">{children}</main>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Main app dashboard
|
|
2
|
+
// Entry point after authentication
|
|
3
|
+
|
|
4
|
+
export default function AppDashboard() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="container mx-auto">
|
|
7
|
+
<h1 className="text-3xl font-bold mb-6">Dashboard</h1>
|
|
8
|
+
|
|
9
|
+
<div className="grid gap-6 md:grid-cols-2 lg:grid-cols-4">
|
|
10
|
+
<div className="border rounded-lg p-6">
|
|
11
|
+
<h3 className="text-sm font-medium text-muted-foreground mb-2">Total Revenue</h3>
|
|
12
|
+
<p className="text-3xl font-bold">$45,231</p>
|
|
13
|
+
<p className="text-sm text-muted-foreground mt-2">+20.1% from last month</p>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div className="border rounded-lg p-6">
|
|
17
|
+
<h3 className="text-sm font-medium text-muted-foreground mb-2">Active Users</h3>
|
|
18
|
+
<p className="text-3xl font-bold">2,350</p>
|
|
19
|
+
<p className="text-sm text-muted-foreground mt-2">+180 from last month</p>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div className="border rounded-lg p-6">
|
|
23
|
+
<h3 className="text-sm font-medium text-muted-foreground mb-2">Conversion Rate</h3>
|
|
24
|
+
<p className="text-3xl font-bold">3.2%</p>
|
|
25
|
+
<p className="text-sm text-muted-foreground mt-2">+0.3% from last month</p>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div className="border rounded-lg p-6">
|
|
29
|
+
<h3 className="text-sm font-medium text-muted-foreground mb-2">Churn Rate</h3>
|
|
30
|
+
<p className="text-3xl font-bold">0.8%</p>
|
|
31
|
+
<p className="text-sm text-muted-foreground mt-2">-0.2% from last month</p>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Settings page
|
|
2
|
+
|
|
3
|
+
export default function SettingsPage() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="container mx-auto">
|
|
6
|
+
<h1 className="text-3xl font-bold mb-8">Settings</h1>
|
|
7
|
+
|
|
8
|
+
<div className="grid gap-6">
|
|
9
|
+
{/* Profile Settings */}
|
|
10
|
+
<div className="border rounded-lg p-6">
|
|
11
|
+
<h2 className="text-xl font-semibold mb-4">Profile</h2>
|
|
12
|
+
<form className="space-y-4">
|
|
13
|
+
<div className="grid gap-4 md:grid-cols-2">
|
|
14
|
+
<div>
|
|
15
|
+
<label className="block text-sm font-medium mb-2">First Name</label>
|
|
16
|
+
<input type="text" className="w-full px-3 py-2 border rounded-md" placeholder="John" />
|
|
17
|
+
</div>
|
|
18
|
+
<div>
|
|
19
|
+
<label className="block text-sm font-medium mb-2">Last Name</label>
|
|
20
|
+
<input type="text" className="w-full px-3 py-2 border rounded-md" placeholder="Doe" />
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div>
|
|
24
|
+
<label className="block text-sm font-medium mb-2">Email</label>
|
|
25
|
+
<input type="email" className="w-full px-3 py-2 border rounded-md" placeholder="john@example.com" />
|
|
26
|
+
</div>
|
|
27
|
+
<button type="submit" className="px-4 py-2 bg-foreground text-background rounded-md hover:opacity-90">
|
|
28
|
+
Save Changes
|
|
29
|
+
</button>
|
|
30
|
+
</form>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
{/* Security Settings */}
|
|
34
|
+
<div className="border rounded-lg p-6">
|
|
35
|
+
<h2 className="text-xl font-semibold mb-4">Security</h2>
|
|
36
|
+
<div className="space-y-4">
|
|
37
|
+
<div>
|
|
38
|
+
<label className="block text-sm font-medium mb-2">Change Password</label>
|
|
39
|
+
<button className="px-4 py-2 border rounded-md hover:bg-muted">Update Password</button>
|
|
40
|
+
</div>
|
|
41
|
+
<div>
|
|
42
|
+
<label className="block text-sm font-medium mb-2">Two-Factor Authentication</label>
|
|
43
|
+
<button className="px-4 py-2 border rounded-md hover:bg-muted">Enable 2FA</button>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Auth feature - login page
|
|
2
|
+
// Part of the auth domain
|
|
3
|
+
|
|
4
|
+
export default function LoginPage() {
|
|
5
|
+
return (
|
|
6
|
+
<main className="min-h-screen flex items-center justify-center p-6">
|
|
7
|
+
<div className="w-full max-w-md">
|
|
8
|
+
<h1 className="text-3xl font-bold mb-2 text-center">Sign In</h1>
|
|
9
|
+
<p className="text-muted-foreground text-center mb-8">Enter your credentials to access your account</p>
|
|
10
|
+
|
|
11
|
+
<div className="border rounded-lg p-8">
|
|
12
|
+
<form className="space-y-6">
|
|
13
|
+
<div>
|
|
14
|
+
<label className="block text-sm font-medium mb-2">Email Address</label>
|
|
15
|
+
<input type="email" className="w-full px-4 py-2 border rounded-md" placeholder="you@example.com" />
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div>
|
|
19
|
+
<label className="block text-sm font-medium mb-2">Password</label>
|
|
20
|
+
<input type="password" className="w-full px-4 py-2 border rounded-md" placeholder="••••••••" />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<button
|
|
24
|
+
type="submit"
|
|
25
|
+
className="w-full bg-foreground text-background py-3 rounded-md hover:opacity-90 font-medium"
|
|
26
|
+
>
|
|
27
|
+
Sign In
|
|
28
|
+
</button>
|
|
29
|
+
</form>
|
|
30
|
+
|
|
31
|
+
<p className="text-center text-sm text-muted-foreground mt-6">
|
|
32
|
+
Don't have an account?{" "}
|
|
33
|
+
<a href="/auth/signup" className="underline">
|
|
34
|
+
Sign up
|
|
35
|
+
</a>
|
|
36
|
+
</p>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</main>
|
|
40
|
+
)
|
|
41
|
+
}
|