@donotdev/cli 0.0.36 → 0.1.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.
- package/LICENSE.md +21 -48
- package/dependencies-matrix.json +24 -24
- package/dist/bin/commands/agent-setup.js +6965 -125
- package/dist/bin/commands/build.js +6 -3
- package/dist/bin/commands/bump.js +35 -15
- package/dist/bin/commands/cacheout.js +19 -3
- package/dist/bin/commands/coach.js +6 -3
- package/dist/bin/commands/create-app.js +18 -4
- package/dist/bin/commands/create-project.js +19 -5
- package/dist/bin/commands/db.js +1700 -3786
- package/dist/bin/commands/deploy.js +144 -98
- package/dist/bin/commands/dev.js +8 -7
- package/dist/bin/commands/doctor.js +6 -3
- package/dist/bin/commands/emu.js +8 -7
- package/dist/bin/commands/format.js +7 -5
- package/dist/bin/commands/get-demo.js +18 -4
- package/dist/bin/commands/make-admin.js +1809 -179
- package/dist/bin/commands/preview.js +8 -7
- package/dist/bin/commands/seed.js +1700 -3786
- package/dist/bin/commands/setup-cicd.js +6 -3
- package/dist/bin/commands/setup.js +23 -20
- package/dist/bin/commands/staging.js +144 -98
- package/dist/bin/commands/sync-secrets.js +6 -3
- package/dist/bin/commands/type-check.js +6 -3
- package/dist/bin/commands/wai.js +6 -3
- package/dist/bin/dndev.js +21 -1
- package/dist/bin/donotdev.js +21 -1
- package/dist/index.js +172 -107
- package/package.json +2 -2
- package/templates/app-next/src/locales/home_en.json.example +6 -6
- package/templates/app-vite/src/locales/home_en.json.example +6 -6
- package/templates/functions-supabase/supabase/functions/.env.example +12 -0
- package/templates/functions-supabase/supabase/functions/disconnect-oauth/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/exchange-token/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/get-connections/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/refresh-token/index.ts.example +7 -0
- package/templates/preset-admin/src/pages/DashboardPage.tsx.example +189 -0
- package/templates/preset-admin/src/pages/EntityPage.tsx.example +84 -0
- package/templates/preset-admin/src/pages/ReportsPage.tsx.example +243 -0
- package/templates/preset-admin/src/pages/SettingsPage.tsx.example +283 -0
- package/templates/preset-admin/src/pages/UsersPage.tsx.example +128 -0
- package/templates/preset-ecommerce/src/pages/CartPage.tsx.example +167 -0
- package/templates/preset-ecommerce/src/pages/CatalogPage.tsx.example +187 -0
- package/templates/preset-ecommerce/src/pages/CheckoutPage.tsx.example +244 -0
- package/templates/preset-ecommerce/src/pages/HomePage.tsx.example +268 -0
- package/templates/preset-ecommerce/src/pages/ProductPage.tsx.example +228 -0
- package/templates/preset-landing/src/pages/AboutPage.tsx.example +237 -0
- package/templates/preset-landing/src/pages/ContactPage.tsx.example +192 -0
- package/templates/preset-landing/src/pages/HomePage.tsx.example +399 -0
- package/templates/preset-saas/src/pages/DashboardPage.tsx.example +195 -0
- package/templates/preset-saas/src/pages/HomePage.tsx.example +270 -0
- package/templates/preset-saas/src/pages/PricingPage.tsx.example +204 -0
- package/templates/preset-saas/src/pages/ProfilePage.tsx.example +191 -0
- package/templates/preset-saas/src/pages/SettingsPage.tsx.example +292 -0
- package/templates/root-consumer/.claude/commands/brainstorm.md.example +28 -0
- package/templates/root-consumer/.claude/commands/design.md.example +31 -0
- package/templates/root-consumer/.claude/commands/grill.md.example +33 -6
- package/templates/root-consumer/.claude/skills/brainstorm/SKILL.md.example +16 -0
- package/templates/root-consumer/.claude/skills/build/SKILL.md.example +50 -0
- package/templates/root-consumer/.claude/skills/design/SKILL.md.example +17 -0
- package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +11 -5
- package/templates/root-consumer/guides/dndev/SETUP_OAUTH.md.example +2 -1
- package/templates/root-consumer/guides/dndev/advanced/COOKIE_REFERENCE.md.example +252 -252
- package/templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example +174 -174
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Landing Home Page
|
|
3
|
+
*
|
|
4
|
+
* Main marketing landing page for {{appName}}.
|
|
5
|
+
* Multi-section single-page layout with hero, features, social proof, and CTA.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
Rocket,
|
|
10
|
+
Shield,
|
|
11
|
+
Zap,
|
|
12
|
+
Globe,
|
|
13
|
+
BarChart3,
|
|
14
|
+
Layers,
|
|
15
|
+
Home,
|
|
16
|
+
Star,
|
|
17
|
+
Building2,
|
|
18
|
+
Sparkles,
|
|
19
|
+
} from 'lucide-react';
|
|
20
|
+
|
|
21
|
+
import {
|
|
22
|
+
HeroSection,
|
|
23
|
+
Section,
|
|
24
|
+
Card,
|
|
25
|
+
Grid,
|
|
26
|
+
Stack,
|
|
27
|
+
Text,
|
|
28
|
+
CallToAction,
|
|
29
|
+
Accordion,
|
|
30
|
+
Marquee,
|
|
31
|
+
SplitReveal,
|
|
32
|
+
Carousel,
|
|
33
|
+
Roadmap,
|
|
34
|
+
Badge,
|
|
35
|
+
} from '@donotdev/components';
|
|
36
|
+
import { FeatureCard } from '@donotdev/ui';
|
|
37
|
+
import type { PageMeta } from '@donotdev/core';
|
|
38
|
+
import { useTranslation } from '@donotdev/core';
|
|
39
|
+
import { PageContainer } from '@donotdev/ui';
|
|
40
|
+
|
|
41
|
+
export const NAMESPACE = 'home';
|
|
42
|
+
|
|
43
|
+
export const meta: PageMeta = {
|
|
44
|
+
namespace: NAMESPACE,
|
|
45
|
+
icon: <Home />,
|
|
46
|
+
route: '/',
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default function HomePage() {
|
|
50
|
+
const { t } = useTranslation(NAMESPACE);
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<PageContainer variant="full">
|
|
54
|
+
{/* ================================================================ */}
|
|
55
|
+
{/* HERO */}
|
|
56
|
+
{/* ================================================================ */}
|
|
57
|
+
|
|
58
|
+
<HeroSection
|
|
59
|
+
badge={t('hero.badge', 'Now available - Start building today')}
|
|
60
|
+
title={t('hero.title', 'Build remarkable products with {{appName}}')}
|
|
61
|
+
subtitle={t(
|
|
62
|
+
'hero.subtitle',
|
|
63
|
+
'The platform that helps teams ship faster, iterate smarter, and scale without compromise. From idea to production in record time.'
|
|
64
|
+
)}
|
|
65
|
+
variant="primary"
|
|
66
|
+
/>
|
|
67
|
+
|
|
68
|
+
{/* ================================================================ */}
|
|
69
|
+
{/* TRUSTED BY */}
|
|
70
|
+
{/* ================================================================ */}
|
|
71
|
+
|
|
72
|
+
<Section tone="ghost" textAlign="center">
|
|
73
|
+
<Stack align="center" gap="medium">
|
|
74
|
+
<Text level="caption" variant="muted">
|
|
75
|
+
{t('trusted.label', 'Trusted by forward-thinking teams worldwide')}
|
|
76
|
+
</Text>
|
|
77
|
+
<Marquee
|
|
78
|
+
items={[
|
|
79
|
+
{ name: 'Acme Corp' },
|
|
80
|
+
{ name: 'Globex' },
|
|
81
|
+
{ name: 'Initech' },
|
|
82
|
+
{ name: 'Umbrella' },
|
|
83
|
+
{ name: 'Cyberdyne' },
|
|
84
|
+
{ name: 'Stark Industries' },
|
|
85
|
+
{ name: 'Wayne Enterprises' },
|
|
86
|
+
{ name: 'Oscorp' },
|
|
87
|
+
]}
|
|
88
|
+
renderItem={(item) => (
|
|
89
|
+
<Badge variant="outline" tooltip={item.name}>
|
|
90
|
+
<Stack direction="row" align="center" gap="tight">
|
|
91
|
+
<Building2 />
|
|
92
|
+
<Text level="body" weight="bold">
|
|
93
|
+
{item.name}
|
|
94
|
+
</Text>
|
|
95
|
+
</Stack>
|
|
96
|
+
</Badge>
|
|
97
|
+
)}
|
|
98
|
+
speed={30}
|
|
99
|
+
pauseOnHover
|
|
100
|
+
gap="large"
|
|
101
|
+
/>
|
|
102
|
+
</Stack>
|
|
103
|
+
</Section>
|
|
104
|
+
|
|
105
|
+
{/* ================================================================ */}
|
|
106
|
+
{/* FEATURES */}
|
|
107
|
+
{/* ================================================================ */}
|
|
108
|
+
|
|
109
|
+
<Section
|
|
110
|
+
title={t('features.title', 'Everything you need to succeed')}
|
|
111
|
+
tone="muted"
|
|
112
|
+
textAlign="center"
|
|
113
|
+
>
|
|
114
|
+
<Grid cols={[1, 2, 2, 3]} gap="large">
|
|
115
|
+
<FeatureCard
|
|
116
|
+
icon={<Zap />}
|
|
117
|
+
title={t('features.speed.title', 'Lightning Fast')}
|
|
118
|
+
subtitle={t(
|
|
119
|
+
'features.speed.subtitle',
|
|
120
|
+
'Optimized for performance at every layer. Sub-second load times out of the box.'
|
|
121
|
+
)}
|
|
122
|
+
/>
|
|
123
|
+
<FeatureCard
|
|
124
|
+
icon={<Shield />}
|
|
125
|
+
title={t('features.security.title', 'Enterprise Security')}
|
|
126
|
+
subtitle={t(
|
|
127
|
+
'features.security.subtitle',
|
|
128
|
+
'Built-in encryption, role-based access, and compliance tooling from day one.'
|
|
129
|
+
)}
|
|
130
|
+
/>
|
|
131
|
+
<FeatureCard
|
|
132
|
+
icon={<Globe />}
|
|
133
|
+
title={t('features.i18n.title', 'Global Ready')}
|
|
134
|
+
subtitle={t(
|
|
135
|
+
'features.i18n.subtitle',
|
|
136
|
+
'Multi-language, RTL support, and locale-aware formatting baked into the core.'
|
|
137
|
+
)}
|
|
138
|
+
/>
|
|
139
|
+
<FeatureCard
|
|
140
|
+
icon={<BarChart3 />}
|
|
141
|
+
title={t('features.analytics.title', 'Real-time Analytics')}
|
|
142
|
+
subtitle={t(
|
|
143
|
+
'features.analytics.subtitle',
|
|
144
|
+
'Understand your users with live dashboards, funnels, and cohort analysis.'
|
|
145
|
+
)}
|
|
146
|
+
/>
|
|
147
|
+
<FeatureCard
|
|
148
|
+
icon={<Layers />}
|
|
149
|
+
title={t('features.modular.title', 'Modular Architecture')}
|
|
150
|
+
subtitle={t(
|
|
151
|
+
'features.modular.subtitle',
|
|
152
|
+
'Pick what you need. Every module is independent, tree-shakeable, and replaceable.'
|
|
153
|
+
)}
|
|
154
|
+
/>
|
|
155
|
+
<FeatureCard
|
|
156
|
+
icon={<Rocket />}
|
|
157
|
+
title={t('features.deploy.title', 'One-click Deploy')}
|
|
158
|
+
subtitle={t(
|
|
159
|
+
'features.deploy.subtitle',
|
|
160
|
+
'Push to production with confidence. Zero-downtime deployments with automatic rollback.'
|
|
161
|
+
)}
|
|
162
|
+
/>
|
|
163
|
+
</Grid>
|
|
164
|
+
</Section>
|
|
165
|
+
|
|
166
|
+
{/* ================================================================ */}
|
|
167
|
+
{/* SPLIT REVEAL - PROBLEM / SOLUTION */}
|
|
168
|
+
{/* ================================================================ */}
|
|
169
|
+
|
|
170
|
+
<Section tone="ghost">
|
|
171
|
+
<SplitReveal
|
|
172
|
+
left={
|
|
173
|
+
<Stack gap="large">
|
|
174
|
+
<Text as="h2" level="h2">
|
|
175
|
+
{t('split.title', 'Stop wrestling with infrastructure')}
|
|
176
|
+
</Text>
|
|
177
|
+
<Text level="body" variant="muted">
|
|
178
|
+
{t(
|
|
179
|
+
'split.description',
|
|
180
|
+
'Most teams spend 60% of their time on boilerplate, config, and deployment. {{appName}} handles the undifferentiated heavy lifting so you can focus on what makes your product unique.'
|
|
181
|
+
)}
|
|
182
|
+
</Text>
|
|
183
|
+
<Text level="body">
|
|
184
|
+
{t(
|
|
185
|
+
'split.result',
|
|
186
|
+
'Teams using {{appShortName}} ship their first feature in hours, not weeks. Production-ready from the start.'
|
|
187
|
+
)}
|
|
188
|
+
</Text>
|
|
189
|
+
</Stack>
|
|
190
|
+
}
|
|
191
|
+
right={
|
|
192
|
+
<Stack gap="medium">
|
|
193
|
+
<Card
|
|
194
|
+
title={t('split.stat1.title', '10x')}
|
|
195
|
+
content={t('split.stat1.desc', 'Faster time to first deploy')}
|
|
196
|
+
elevated
|
|
197
|
+
/>
|
|
198
|
+
<Card
|
|
199
|
+
title={t('split.stat2.title', '73%')}
|
|
200
|
+
content={t('split.stat2.desc', 'Less boilerplate code')}
|
|
201
|
+
elevated
|
|
202
|
+
/>
|
|
203
|
+
<Card
|
|
204
|
+
title={t('split.stat3.title', '99.9%')}
|
|
205
|
+
content={t('split.stat3.desc', 'Uptime SLA guaranteed')}
|
|
206
|
+
elevated
|
|
207
|
+
/>
|
|
208
|
+
</Stack>
|
|
209
|
+
}
|
|
210
|
+
useStatCards
|
|
211
|
+
stagger
|
|
212
|
+
/>
|
|
213
|
+
</Section>
|
|
214
|
+
|
|
215
|
+
{/* ================================================================ */}
|
|
216
|
+
{/* HOW IT WORKS */}
|
|
217
|
+
{/* ================================================================ */}
|
|
218
|
+
|
|
219
|
+
<Section
|
|
220
|
+
title={t('roadmap.title', 'Up and running in four steps')}
|
|
221
|
+
tone="accent"
|
|
222
|
+
textAlign="center"
|
|
223
|
+
>
|
|
224
|
+
<Roadmap
|
|
225
|
+
steps={[
|
|
226
|
+
{
|
|
227
|
+
title: t('roadmap.step1.title', 'Initialize'),
|
|
228
|
+
description: t(
|
|
229
|
+
'roadmap.step1.desc',
|
|
230
|
+
'Run a single command to scaffold your project with the right structure, tooling, and configuration.'
|
|
231
|
+
),
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
title: t('roadmap.step2.title', 'Model'),
|
|
235
|
+
description: t(
|
|
236
|
+
'roadmap.step2.desc',
|
|
237
|
+
'Define your data entities, relationships, and business rules. The framework generates types, validation, and API endpoints.'
|
|
238
|
+
),
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
title: t('roadmap.step3.title', 'Compose'),
|
|
242
|
+
description: t(
|
|
243
|
+
'roadmap.step3.desc',
|
|
244
|
+
'Build your UI by assembling production-grade components. Responsive, accessible, and themed by default.'
|
|
245
|
+
),
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
title: t('roadmap.step4.title', 'Ship'),
|
|
249
|
+
description: t(
|
|
250
|
+
'roadmap.step4.desc',
|
|
251
|
+
'Deploy to production with one command. CI/CD, monitoring, and scaling are handled automatically.'
|
|
252
|
+
),
|
|
253
|
+
},
|
|
254
|
+
]}
|
|
255
|
+
/>
|
|
256
|
+
</Section>
|
|
257
|
+
|
|
258
|
+
{/* ================================================================ */}
|
|
259
|
+
{/* TESTIMONIALS */}
|
|
260
|
+
{/* ================================================================ */}
|
|
261
|
+
|
|
262
|
+
<Section
|
|
263
|
+
title={t('testimonials.title', 'What our users say')}
|
|
264
|
+
tone="muted"
|
|
265
|
+
textAlign="center"
|
|
266
|
+
>
|
|
267
|
+
<Carousel
|
|
268
|
+
items={[
|
|
269
|
+
{
|
|
270
|
+
name: 'Sarah Chen',
|
|
271
|
+
role: 'CTO, Nexaflow',
|
|
272
|
+
quote: t(
|
|
273
|
+
'testimonials.1',
|
|
274
|
+
'We rebuilt our entire platform on {{appShortName}} in three weeks. What used to take a quarter now takes days.'
|
|
275
|
+
),
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
name: 'Marcus Rivera',
|
|
279
|
+
role: 'Lead Engineer, Datawise',
|
|
280
|
+
quote: t(
|
|
281
|
+
'testimonials.2',
|
|
282
|
+
'The developer experience is unmatched. Every decision feels intentional. No bloat, no surprises.'
|
|
283
|
+
),
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
name: 'Aiko Tanaka',
|
|
287
|
+
role: 'Founder, KaizenLab',
|
|
288
|
+
quote: t(
|
|
289
|
+
'testimonials.3',
|
|
290
|
+
'I shipped my SaaS MVP as a solo founder in a weekend. Authentication, payments, CRUD - all just worked.'
|
|
291
|
+
),
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: 'Liam O\'Brien',
|
|
295
|
+
role: 'VP Engineering, ScaleStack',
|
|
296
|
+
quote: t(
|
|
297
|
+
'testimonials.4',
|
|
298
|
+
'Finally a framework that respects our time. Zero config to get started, infinite flexibility when we need it.'
|
|
299
|
+
),
|
|
300
|
+
},
|
|
301
|
+
]}
|
|
302
|
+
renderItem={(item) => (
|
|
303
|
+
<Card
|
|
304
|
+
title={item.name}
|
|
305
|
+
subtitle={item.role}
|
|
306
|
+
content={item.quote}
|
|
307
|
+
icon={<Star />}
|
|
308
|
+
elevated
|
|
309
|
+
/>
|
|
310
|
+
)}
|
|
311
|
+
slidesToShow={1}
|
|
312
|
+
showArrows
|
|
313
|
+
infinite
|
|
314
|
+
/>
|
|
315
|
+
</Section>
|
|
316
|
+
|
|
317
|
+
{/* ================================================================ */}
|
|
318
|
+
{/* FAQ */}
|
|
319
|
+
{/* ================================================================ */}
|
|
320
|
+
|
|
321
|
+
<Section
|
|
322
|
+
title={t('faq.title', 'Frequently asked questions')}
|
|
323
|
+
tone="ghost"
|
|
324
|
+
>
|
|
325
|
+
<Accordion
|
|
326
|
+
type="single"
|
|
327
|
+
collapsible
|
|
328
|
+
items={[
|
|
329
|
+
{
|
|
330
|
+
title: t('faq.q1.title', 'Is {{appShortName}} free to use?'),
|
|
331
|
+
content: t(
|
|
332
|
+
'faq.q1.answer',
|
|
333
|
+
'Yes. The core framework is open-source under the MIT license. We offer premium support and managed hosting for teams that need it.'
|
|
334
|
+
),
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
title: t('faq.q2.title', 'What backends are supported?'),
|
|
338
|
+
content: t(
|
|
339
|
+
'faq.q2.answer',
|
|
340
|
+
'Firebase, Supabase, and Vercel are supported out of the box. The architecture is provider-agnostic, so adding a custom backend is straightforward.'
|
|
341
|
+
),
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
title: t('faq.q3.title', 'Can I use it for an existing project?'),
|
|
345
|
+
content: t(
|
|
346
|
+
'faq.q3.answer',
|
|
347
|
+
'Absolutely. Each package is independent and can be adopted incrementally. Start with the component library or the CRUD module and expand from there.'
|
|
348
|
+
),
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
title: t('faq.q4.title', 'How does it handle scaling?'),
|
|
352
|
+
content: t(
|
|
353
|
+
'faq.q4.answer',
|
|
354
|
+
'The framework is designed for serverless-first architecture. Functions scale to zero when idle and auto-scale under load. No infrastructure management required.'
|
|
355
|
+
),
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
title: t('faq.q5.title', 'Is there a component library?'),
|
|
359
|
+
content: t(
|
|
360
|
+
'faq.q5.answer',
|
|
361
|
+
'Yes. Over 60 production-ready components with full accessibility, theming, responsive behavior, and RTL support. All documented with live examples.'
|
|
362
|
+
),
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
title: t('faq.q6.title', 'What about mobile?'),
|
|
366
|
+
content: t(
|
|
367
|
+
'faq.q6.answer',
|
|
368
|
+
'Web apps are fully responsive by default. For native mobile, we provide an Expo template with shared business logic and consistent design tokens.'
|
|
369
|
+
),
|
|
370
|
+
},
|
|
371
|
+
]}
|
|
372
|
+
/>
|
|
373
|
+
</Section>
|
|
374
|
+
|
|
375
|
+
{/* ================================================================ */}
|
|
376
|
+
{/* FINAL CTA */}
|
|
377
|
+
{/* ================================================================ */}
|
|
378
|
+
|
|
379
|
+
<Section tone="primary">
|
|
380
|
+
<CallToAction
|
|
381
|
+
title={t('cta.title', 'Ready to build something remarkable?')}
|
|
382
|
+
subtitle={t(
|
|
383
|
+
'cta.subtitle',
|
|
384
|
+
'Join thousands of developers who ship faster with {{appName}}. Get started in under two minutes.'
|
|
385
|
+
)}
|
|
386
|
+
tone="primary"
|
|
387
|
+
primaryAction={{
|
|
388
|
+
label: t('cta.primary', 'Get Started Free'),
|
|
389
|
+
icon: <Sparkles />,
|
|
390
|
+
}}
|
|
391
|
+
secondaryAction={{
|
|
392
|
+
label: t('cta.secondary', 'View Documentation'),
|
|
393
|
+
icon: <Layers />,
|
|
394
|
+
}}
|
|
395
|
+
/>
|
|
396
|
+
</Section>
|
|
397
|
+
</PageContainer>
|
|
398
|
+
);
|
|
399
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
// {{appName}} - Dashboard Page
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
LayoutDashboard,
|
|
6
|
+
DollarSign,
|
|
7
|
+
Users,
|
|
8
|
+
ShoppingCart,
|
|
9
|
+
TrendingUp,
|
|
10
|
+
Plus,
|
|
11
|
+
FileText,
|
|
12
|
+
Send,
|
|
13
|
+
Download,
|
|
14
|
+
Activity,
|
|
15
|
+
ArrowUpRight,
|
|
16
|
+
ArrowDownRight,
|
|
17
|
+
} from 'lucide-react';
|
|
18
|
+
|
|
19
|
+
import {
|
|
20
|
+
Badge,
|
|
21
|
+
BADGE_VARIANT,
|
|
22
|
+
Button,
|
|
23
|
+
BUTTON_VARIANT,
|
|
24
|
+
Card,
|
|
25
|
+
CARD_VARIANT,
|
|
26
|
+
Grid,
|
|
27
|
+
HeroSection,
|
|
28
|
+
List,
|
|
29
|
+
Section,
|
|
30
|
+
Stack,
|
|
31
|
+
Text,
|
|
32
|
+
} from '@donotdev/components';
|
|
33
|
+
import { useTranslation } from '@donotdev/core';
|
|
34
|
+
import { PageContainer, Link } from '@donotdev/ui';
|
|
35
|
+
import { useAuth } from '@donotdev/auth';
|
|
36
|
+
|
|
37
|
+
import type { PageMeta } from '@donotdev/core';
|
|
38
|
+
|
|
39
|
+
export const NAMESPACE = 'dashboard';
|
|
40
|
+
|
|
41
|
+
export const meta: PageMeta = {
|
|
42
|
+
namespace: NAMESPACE,
|
|
43
|
+
icon: <LayoutDashboard />,
|
|
44
|
+
auth: true,
|
|
45
|
+
preset: 'admin',
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const statsData = [
|
|
49
|
+
{
|
|
50
|
+
label: 'Monthly Revenue',
|
|
51
|
+
value: '$12,450',
|
|
52
|
+
change: '+14.2%',
|
|
53
|
+
trend: 'up' as const,
|
|
54
|
+
icon: DollarSign,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: 'Active Users',
|
|
58
|
+
value: '2,340',
|
|
59
|
+
change: '+7.1%',
|
|
60
|
+
trend: 'up' as const,
|
|
61
|
+
icon: Users,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: 'New Orders',
|
|
65
|
+
value: '184',
|
|
66
|
+
change: '-3.2%',
|
|
67
|
+
trend: 'down' as const,
|
|
68
|
+
icon: ShoppingCart,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: 'Conversion Rate',
|
|
72
|
+
value: '3.24%',
|
|
73
|
+
change: '+1.8%',
|
|
74
|
+
trend: 'up' as const,
|
|
75
|
+
icon: TrendingUp,
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
const recentActivity = [
|
|
80
|
+
{ text: 'New subscription: Pro plan - john@example.com', time: '2 min ago' },
|
|
81
|
+
{ text: 'Payment received: $29.00 from sarah@company.co', time: '15 min ago' },
|
|
82
|
+
{ text: 'User upgraded: Free to Pro - mike@startup.io', time: '1 hour ago' },
|
|
83
|
+
{ text: 'Support ticket resolved: #1284', time: '2 hours ago' },
|
|
84
|
+
{ text: 'New sign-up: alex@enterprise.com', time: '3 hours ago' },
|
|
85
|
+
{ text: 'Invoice generated: INV-2024-0891', time: '4 hours ago' },
|
|
86
|
+
{ text: 'Webhook delivered: subscription.updated', time: '5 hours ago' },
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
export default function DashboardPage() {
|
|
90
|
+
const { t } = useTranslation(NAMESPACE);
|
|
91
|
+
const user = useAuth('user');
|
|
92
|
+
|
|
93
|
+
const displayName = user?.displayName ?? t('dashboard.defaultUser', 'there');
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<PageContainer>
|
|
97
|
+
<HeroSection
|
|
98
|
+
title={t('dashboard.hero.title', 'Welcome back, {{name}}', { name: displayName })}
|
|
99
|
+
subtitle={t('dashboard.hero.subtitle', 'Here is what is happening with your business today.')}
|
|
100
|
+
/>
|
|
101
|
+
|
|
102
|
+
<Section title={t('dashboard.stats.title', 'Key Metrics')}>
|
|
103
|
+
<Grid cols={[1, 2, 4, 4]} gap="medium">
|
|
104
|
+
{statsData.map((stat) => (
|
|
105
|
+
<Card
|
|
106
|
+
key={stat.label}
|
|
107
|
+
icon={stat.icon}
|
|
108
|
+
title={stat.value}
|
|
109
|
+
subtitle={stat.label}
|
|
110
|
+
footer={
|
|
111
|
+
<Stack direction="row" align="center" gap="tight">
|
|
112
|
+
{stat.trend === 'up' ? (
|
|
113
|
+
<ArrowUpRight style={{ width: 'var(--icon-xs)', height: 'var(--icon-xs)', color: 'var(--success)' }} />
|
|
114
|
+
) : (
|
|
115
|
+
<ArrowDownRight style={{ width: 'var(--icon-xs)', height: 'var(--icon-xs)', color: 'var(--destructive)' }} />
|
|
116
|
+
)}
|
|
117
|
+
<Text
|
|
118
|
+
level="caption"
|
|
119
|
+
variant={stat.trend === 'up' ? 'success' : 'destructive'}
|
|
120
|
+
>
|
|
121
|
+
{stat.change}
|
|
122
|
+
</Text>
|
|
123
|
+
<Text level="caption" variant="muted">
|
|
124
|
+
{t('dashboard.stats.vsLastMonth', 'vs last month')}
|
|
125
|
+
</Text>
|
|
126
|
+
</Stack>
|
|
127
|
+
}
|
|
128
|
+
/>
|
|
129
|
+
))}
|
|
130
|
+
</Grid>
|
|
131
|
+
</Section>
|
|
132
|
+
|
|
133
|
+
<Grid cols={[1, 1, 2, 2]} gap="medium">
|
|
134
|
+
<Section title={t('dashboard.activity.title', 'Recent Activity')}>
|
|
135
|
+
<Card
|
|
136
|
+
content={
|
|
137
|
+
<Stack gap="tight">
|
|
138
|
+
{recentActivity.map((item, i) => (
|
|
139
|
+
<Stack key={i} direction="row" justify="space-between" align="center" gap="medium">
|
|
140
|
+
<Stack direction="row" align="center" gap="tight">
|
|
141
|
+
<Activity
|
|
142
|
+
style={{
|
|
143
|
+
width: 'var(--icon-xs)',
|
|
144
|
+
height: 'var(--icon-xs)',
|
|
145
|
+
color: 'var(--muted-foreground)',
|
|
146
|
+
flexShrink: 0,
|
|
147
|
+
}}
|
|
148
|
+
/>
|
|
149
|
+
<Text level="small">{item.text}</Text>
|
|
150
|
+
</Stack>
|
|
151
|
+
<Text level="caption" variant="muted" style={{ whiteSpace: 'nowrap' }}>
|
|
152
|
+
{item.time}
|
|
153
|
+
</Text>
|
|
154
|
+
</Stack>
|
|
155
|
+
))}
|
|
156
|
+
</Stack>
|
|
157
|
+
}
|
|
158
|
+
/>
|
|
159
|
+
</Section>
|
|
160
|
+
|
|
161
|
+
<Section title={t('dashboard.quickActions.title', 'Quick Actions')}>
|
|
162
|
+
<Stack gap="medium">
|
|
163
|
+
<Card
|
|
164
|
+
title={t('dashboard.quickActions.newProject', 'Create New Project')}
|
|
165
|
+
subtitle={t('dashboard.quickActions.newProjectDesc', 'Start a new project from scratch or use a template.')}
|
|
166
|
+
icon={Plus}
|
|
167
|
+
clickable
|
|
168
|
+
footer={
|
|
169
|
+
<Button variant={BUTTON_VARIANT.PRIMARY} icon={Plus} fullWidth>
|
|
170
|
+
{t('dashboard.quickActions.newProjectBtn', 'New Project')}
|
|
171
|
+
</Button>
|
|
172
|
+
}
|
|
173
|
+
/>
|
|
174
|
+
<Grid cols={[1, 2, 2, 2]} gap="tight">
|
|
175
|
+
<Button variant={BUTTON_VARIANT.OUTLINE} icon={FileText}>
|
|
176
|
+
{t('dashboard.quickActions.viewReports', 'View Reports')}
|
|
177
|
+
</Button>
|
|
178
|
+
<Button variant={BUTTON_VARIANT.OUTLINE} icon={Send}>
|
|
179
|
+
{t('dashboard.quickActions.sendInvite', 'Invite Member')}
|
|
180
|
+
</Button>
|
|
181
|
+
<Button variant={BUTTON_VARIANT.OUTLINE} icon={Download}>
|
|
182
|
+
{t('dashboard.quickActions.exportData', 'Export Data')}
|
|
183
|
+
</Button>
|
|
184
|
+
<Link path="/settings">
|
|
185
|
+
<Button variant={BUTTON_VARIANT.GHOST} fullWidth>
|
|
186
|
+
{t('dashboard.quickActions.settings', 'Settings')}
|
|
187
|
+
</Button>
|
|
188
|
+
</Link>
|
|
189
|
+
</Grid>
|
|
190
|
+
</Stack>
|
|
191
|
+
</Section>
|
|
192
|
+
</Grid>
|
|
193
|
+
</PageContainer>
|
|
194
|
+
);
|
|
195
|
+
}
|