@asynx/create-asynx-next-app 1.0.4 → 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/create-asynx-next-app-wrapper/index.js +3 -0
- package/create-asynx-next-app-wrapper/package.json +12 -0
- package/package.json +1 -1
- package/templates/advanced/.env.example +23 -0
- package/templates/advanced/README.md +148 -0
- package/templates/advanced/next.config.mjs +14 -0
- package/templates/advanced/package.json +1 -1
- 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 -8
- package/templates/advanced/src/app/layout.tsx +19 -18
- package/templates/advanced/src/app/page.tsx +25 -8
- 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 +14 -11
- package/templates/standard/README.md +53 -0
- package/templates/standard/package.json +1 -1
- 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 +151 -1
- package/templates/standard/src/app/layout.tsx +21 -1
- package/templates/standard/src/app/page.tsx +22 -3
- package/templates/standard/src/lib/api.ts +37 -0
- package/templates/standard/src/lib/constants.ts +14 -0
- package/templates/standard/tsconfig.json +12 -11
- package/templates/starter/package.json +1 -1
- package/templates/starter/src/app/globals.css +1 -0
- package/templates/advanced/next-env.d.ts +0 -4
|
@@ -1,8 +1,158 @@
|
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
@import 'tw-animate-css';
|
|
3
|
+
|
|
4
|
+
@custom-variant dark (&:is(.dark *));
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
--background: 0 0% 100%;
|
|
8
|
+
--foreground: 0 0% 3.9%;
|
|
9
|
+
--muted: 0 0% 96.1%;
|
|
10
|
+
--muted-foreground: 0 0% 45.1%;
|
|
11
|
+
--border: 0 0% 89.8%;
|
|
12
|
+
--radius: 0.5rem;
|
|
13
|
+
--card: oklch(1 0 0);
|
|
14
|
+
--card-foreground: oklch(0.145 0 0);
|
|
15
|
+
--popover: oklch(1 0 0);
|
|
16
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
17
|
+
--primary: oklch(0.205 0 0);
|
|
18
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
19
|
+
--secondary: oklch(0.97 0 0);
|
|
20
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
21
|
+
--accent: oklch(0.97 0 0);
|
|
22
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
23
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
24
|
+
--destructive-foreground: oklch(0.577 0.245 27.325);
|
|
25
|
+
--input: oklch(0.922 0 0);
|
|
26
|
+
--ring: oklch(0.708 0 0);
|
|
27
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
28
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
29
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
30
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
31
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
32
|
+
--sidebar: oklch(0.985 0 0);
|
|
33
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
34
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
35
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
36
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
37
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
38
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
39
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.dark {
|
|
43
|
+
--background: 0 0% 3.9%;
|
|
44
|
+
--foreground: 0 0% 98%;
|
|
45
|
+
--muted: 0 0% 14.9%;
|
|
46
|
+
--muted-foreground: 0 0% 63.9%;
|
|
47
|
+
--border: 0 0% 14.9%;
|
|
48
|
+
--card: oklch(0.145 0 0);
|
|
49
|
+
--card-foreground: oklch(0.985 0 0);
|
|
50
|
+
--popover: oklch(0.145 0 0);
|
|
51
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
52
|
+
--primary: oklch(0.985 0 0);
|
|
53
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
54
|
+
--secondary: oklch(0.269 0 0);
|
|
55
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
56
|
+
--muted: oklch(0.269 0 0);
|
|
57
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
58
|
+
--accent: oklch(0.269 0 0);
|
|
59
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
60
|
+
--destructive: oklch(0.396 0.141 25.723);
|
|
61
|
+
--destructive-foreground: oklch(0.637 0.237 25.331);
|
|
62
|
+
--input: oklch(0.269 0 0);
|
|
63
|
+
--ring: oklch(0.439 0 0);
|
|
64
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
65
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
66
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
67
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
68
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
69
|
+
--sidebar: oklch(0.205 0 0);
|
|
70
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
71
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
72
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
73
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
74
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
75
|
+
--sidebar-border: oklch(0.269 0 0);
|
|
76
|
+
--sidebar-ring: oklch(0.439 0 0);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@theme inline {
|
|
80
|
+
/* optional: --font-sans, --font-serif, --font-mono if they are applied in the layout.tsx */
|
|
81
|
+
--color-background: var(--background);
|
|
82
|
+
--color-foreground: var(--foreground);
|
|
83
|
+
--color-card: var(--card);
|
|
84
|
+
--color-card-foreground: var(--card-foreground);
|
|
85
|
+
--color-popover: var(--popover);
|
|
86
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
87
|
+
--color-primary: var(--primary);
|
|
88
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
89
|
+
--color-secondary: var(--secondary);
|
|
90
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
91
|
+
--color-muted: var(--muted);
|
|
92
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
93
|
+
--color-accent: var(--accent);
|
|
94
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
95
|
+
--color-destructive: var(--destructive);
|
|
96
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
97
|
+
--color-border: var(--border);
|
|
98
|
+
--color-input: var(--input);
|
|
99
|
+
--color-ring: var(--ring);
|
|
100
|
+
--color-chart-1: var(--chart-1);
|
|
101
|
+
--color-chart-2: var(--chart-2);
|
|
102
|
+
--color-chart-3: var(--chart-3);
|
|
103
|
+
--color-chart-4: var(--chart-4);
|
|
104
|
+
--color-chart-5: var(--chart-5);
|
|
105
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
106
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
107
|
+
--radius-lg: var(--radius);
|
|
108
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
109
|
+
--color-sidebar: var(--sidebar);
|
|
110
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
111
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
112
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
113
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
114
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
115
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
116
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@layer base {
|
|
120
|
+
* {
|
|
121
|
+
@apply border-border outline-ring/50;
|
|
122
|
+
}
|
|
123
|
+
body {
|
|
124
|
+
@apply bg-background text-foreground;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
1
128
|
* {
|
|
2
129
|
box-sizing: border-box;
|
|
3
130
|
}
|
|
4
131
|
|
|
5
132
|
body {
|
|
6
133
|
margin: 0;
|
|
7
|
-
font-family: system-ui, sans-serif;
|
|
134
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
135
|
+
background: hsl(var(--background));
|
|
136
|
+
color: hsl(var(--foreground));
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.container {
|
|
140
|
+
width: 100%;
|
|
141
|
+
max-width: 1280px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.text-muted-foreground {
|
|
145
|
+
color: hsl(var(--muted-foreground));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.border {
|
|
149
|
+
border: 1px solid hsl(var(--border));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.border-b {
|
|
153
|
+
border-bottom: 1px solid hsl(var(--border));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.border-t {
|
|
157
|
+
border-top: 1px solid hsl(var(--border));
|
|
8
158
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type React from 'react';
|
|
1
2
|
import './globals.css';
|
|
2
3
|
|
|
3
4
|
export const metadata = {
|
|
@@ -12,7 +13,26 @@ export default function RootLayout({
|
|
|
12
13
|
}) {
|
|
13
14
|
return (
|
|
14
15
|
<html lang="en">
|
|
15
|
-
<body>
|
|
16
|
+
<body>
|
|
17
|
+
<div className="min-h-screen flex flex-col">
|
|
18
|
+
{/* Header placeholder - add navigation here */}
|
|
19
|
+
<header className="border-b">
|
|
20
|
+
<div className="container mx-auto px-6 py-4">
|
|
21
|
+
<h1 className="text-xl font-bold">Your App</h1>
|
|
22
|
+
</div>
|
|
23
|
+
</header>
|
|
24
|
+
|
|
25
|
+
{/* Main content area */}
|
|
26
|
+
<div className="flex-1">{children}</div>
|
|
27
|
+
|
|
28
|
+
{/* Footer placeholder */}
|
|
29
|
+
<footer className="border-t py-4">
|
|
30
|
+
<div className="container mx-auto px-6 text-center text-sm text-muted-foreground">
|
|
31
|
+
© {new Date().getFullYear()} Your Company
|
|
32
|
+
</div>
|
|
33
|
+
</footer>
|
|
34
|
+
</div>
|
|
35
|
+
</body>
|
|
16
36
|
</html>
|
|
17
37
|
);
|
|
18
38
|
}
|
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
export default function HomePage() {
|
|
2
2
|
return (
|
|
3
|
-
<main
|
|
4
|
-
<h1
|
|
5
|
-
<p
|
|
3
|
+
<main className="container mx-auto p-6">
|
|
4
|
+
<h1 className="text-3xl font-bold mb-2">Dashboard</h1>
|
|
5
|
+
<p className="text-muted-foreground mb-6">
|
|
6
|
+
Welcome to your Standard App template
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
|
|
10
|
+
<div className="border rounded-lg p-4">
|
|
11
|
+
<h2 className="font-semibold mb-2">Quick Stats</h2>
|
|
12
|
+
<p className="text-sm text-muted-foreground">
|
|
13
|
+
Your metrics at a glance
|
|
14
|
+
</p>
|
|
15
|
+
</div>
|
|
16
|
+
<div className="border rounded-lg p-4">
|
|
17
|
+
<h2 className="font-semibold mb-2">Recent Activity</h2>
|
|
18
|
+
<p className="text-sm text-muted-foreground">Latest updates</p>
|
|
19
|
+
</div>
|
|
20
|
+
<div className="border rounded-lg p-4">
|
|
21
|
+
<h2 className="font-semibold mb-2">Actions</h2>
|
|
22
|
+
<p className="text-sm text-muted-foreground">Get started quickly</p>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
6
25
|
</main>
|
|
7
26
|
);
|
|
8
27
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export async function fetcher<T>(url: string): Promise<T> {
|
|
2
|
+
const response = await fetch(url);
|
|
3
|
+
|
|
4
|
+
if (!response.ok) {
|
|
5
|
+
throw new Error(`API error: ${response.status}`);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
return response.json();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class ApiClient {
|
|
12
|
+
private baseUrl: string;
|
|
13
|
+
|
|
14
|
+
constructor(baseUrl = '/api') {
|
|
15
|
+
this.baseUrl = baseUrl;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async get<T>(endpoint: string): Promise<T> {
|
|
19
|
+
return fetcher<T>(`${this.baseUrl}${endpoint}`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async post<T>(endpoint: string, data: unknown): Promise<T> {
|
|
23
|
+
const response = await fetch(`${this.baseUrl}${endpoint}`, {
|
|
24
|
+
method: 'POST',
|
|
25
|
+
headers: { 'Content-Type': 'application/json' },
|
|
26
|
+
body: JSON.stringify(data),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
throw new Error(`API error: ${response.status}`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return response.json();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const api = new ApiClient();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const APP_NAME = 'Your App';
|
|
2
|
+
export const APP_DESCRIPTION = 'Built with Asynx Next.js';
|
|
3
|
+
|
|
4
|
+
export const ROUTES = {
|
|
5
|
+
HOME: '/',
|
|
6
|
+
LOGIN: '/login',
|
|
7
|
+
DASHBOARD: '/dashboard',
|
|
8
|
+
SETTINGS: '/settings',
|
|
9
|
+
} as const;
|
|
10
|
+
|
|
11
|
+
export const API_ENDPOINTS = {
|
|
12
|
+
USERS: '/api/users',
|
|
13
|
+
AUTH: '/api/auth',
|
|
14
|
+
} as const;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
3
|
+
"target": "ES2020",
|
|
4
4
|
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
-
"allowJs":
|
|
5
|
+
"allowJs": true,
|
|
6
6
|
"skipLibCheck": true,
|
|
7
7
|
"strict": true,
|
|
8
8
|
"noEmit": true,
|
|
@@ -11,16 +11,17 @@
|
|
|
11
11
|
"moduleResolution": "bundler",
|
|
12
12
|
"resolveJsonModule": true,
|
|
13
13
|
"isolatedModules": true,
|
|
14
|
-
"jsx": "
|
|
14
|
+
"jsx": "preserve",
|
|
15
15
|
"incremental": true,
|
|
16
|
-
"plugins": [
|
|
16
|
+
"plugins": [
|
|
17
|
+
{
|
|
18
|
+
"name": "next"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"paths": {
|
|
22
|
+
"@/*": ["./src/*"]
|
|
23
|
+
}
|
|
17
24
|
},
|
|
18
|
-
"include": [
|
|
19
|
-
"next-env.d.ts",
|
|
20
|
-
"**/*.ts",
|
|
21
|
-
"**/*.tsx",
|
|
22
|
-
".next/types/**/*.ts",
|
|
23
|
-
".next/dev/types/**/*.ts"
|
|
24
|
-
],
|
|
25
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
25
26
|
"exclude": ["node_modules"]
|
|
26
27
|
}
|