@thinhnguyencth1204/nextcli 0.6.0 → 0.7.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/README.md +58 -47
- package/dist/cli.js +1002 -753
- package/package.json +4 -2
- package/templates/{next-base/src/lib/axios-instance.ts → features/api/src/lib/api/axios.ts} +7 -2
- package/templates/{next-base/src/lib/api-response.ts → features/api/src/lib/api/response.ts} +1 -5
- package/templates/{next-base → features/auth}/src/app/(auth)/change-password/layout.tsx +1 -1
- package/templates/{next-base → features/auth}/src/app/(auth)/sign-in/layout.tsx +1 -1
- package/templates/{next-base → features/auth}/src/app/api/v1/auth/change-password/route.ts +3 -3
- package/templates/{next-base → features/auth}/src/app/api/v1/auth/login/route.ts +3 -3
- package/templates/{next-base → features/auth}/src/app/api/v1/auth/logout/route.ts +2 -2
- package/templates/{next-base → features/auth}/src/app/api/v1/auth/me/route.ts +2 -2
- package/templates/{next-base → features/auth}/src/app/api/v1/auth/refresh/route.ts +2 -2
- package/templates/{next-base → features/auth}/src/app/api/v1/users/[id]/route.ts +3 -3
- package/templates/{next-base → features/auth}/src/app/api/v1/users/route.ts +3 -3
- package/templates/{next-base → features/auth}/src/features/auth/components/account-panel.tsx +1 -1
- package/templates/{next-base → features/auth}/src/features/auth/components/change-password-form.tsx +1 -1
- package/templates/{next-base → features/auth}/src/features/auth/components/sign-in-form.tsx +2 -2
- package/templates/{next-base → features/auth}/src/features/users/services.ts +1 -1
- package/templates/{next-base → features/auth}/src/instrumentation.ts +1 -1
- package/templates/{next-base/src/lib → features/auth/src/lib/auth}/bootstrap.ts +2 -3
- package/templates/features/auth/src/lib/auth/index.ts +1 -0
- package/templates/{next-base/src/lib → features/auth/src/lib/auth}/rbac.ts +2 -5
- package/templates/{next-base/src/lib/auth.ts → features/auth/src/lib/auth/server.ts} +2 -1
- package/templates/{next-base → features/auth}/src/lib/constants.ts +3 -0
- package/templates/features/chat/src/app/api/v1/chat/route.ts +1 -1
- package/templates/features/chat/src/features/chat/api/use-chat-history.ts +1 -1
- package/templates/features/chat/src/features/chat/api/use-send-message.ts +1 -1
- package/templates/{next-base → features/dashboard}/src/app/(dashboard)/layout.tsx +1 -1
- package/templates/features/dashboard/src/app/page.tsx +5 -0
- package/templates/{next-base → features/dashboard}/src/components/layout/private/nav-user.tsx +1 -1
- package/templates/{next-base → features/database}/prisma/schema.prisma +1 -15
- package/templates/{next-base → features/database}/prisma.config.ts +2 -2
- package/templates/features/database/src/lib/prisma.ts +23 -0
- package/templates/{next-base → features/example}/src/app/api/v1/example/route.ts +2 -2
- package/templates/{next-base → features/example}/src/example/api/use-example.ts +1 -1
- package/templates/{next-base → features/example}/src/example/api/use-mutations.ts +1 -1
- package/templates/{next-base → features/example}/src/example/services.ts +1 -1
- package/templates/features/i18n/next.config.ts +17 -0
- package/templates/features/i18n/src/app/layout.tsx +42 -0
- package/templates/next-base/.env +0 -14
- package/templates/next-base/.env.development +0 -14
- package/templates/next-base/.env.example +0 -14
- package/templates/next-base/PROJECT_STRUCTURE.md +33 -55
- package/templates/next-base/SETUP.md +12 -60
- package/templates/next-base/bun.lock +17 -0
- package/templates/next-base/next.config.ts +1 -4
- package/templates/next-base/nextcli.json +3 -3
- package/templates/next-base/package.json +1 -21
- package/templates/next-base/src/app/layout.tsx +6 -14
- package/templates/next-base/src/app/page.tsx +25 -2
- package/templates/next-base/prisma/migrations/20260612000000_init/migration.sql +0 -104
- package/templates/next-base/prisma/migrations/migration_lock.toml +0 -3
- package/templates/next-base/src/app/(auth)/.gitkeep +0 -1
- /package/templates/{next-base → features/api}/src/components/providers/query-provider.tsx +0 -0
- /package/templates/{next-base/src/lib → features/api/src/lib/api}/token-store.ts +0 -0
- /package/templates/{next-base → features/auth}/messages/vi/auth.json +0 -0
- /package/templates/{next-base/prisma/migrations → features/auth/src/app/(auth)}/.gitkeep +0 -0
- /package/templates/{next-base → features/auth}/src/app/(auth)/change-password/page.tsx +0 -0
- /package/templates/{next-base → features/auth}/src/app/(auth)/layout.tsx +0 -0
- /package/templates/{next-base → features/auth}/src/app/(auth)/sign-in/page.tsx +0 -0
- /package/templates/{next-base → features/auth}/src/app/api/auth/[...all]/route.ts +0 -0
- /package/templates/{next-base → features/auth}/src/features/auth/validations.ts +0 -0
- /package/templates/{next-base → features/auth}/src/features/users/validations.ts +0 -0
- /package/templates/{next-base/src/lib/auth-client.ts → features/auth/src/lib/auth/client.ts} +0 -0
- /package/templates/{next-base/src/lib/auth-cookies.ts → features/auth/src/lib/auth/cookies.ts} +0 -0
- /package/templates/{next-base → features/dashboard}/src/app/(dashboard)/account/page.tsx +0 -0
- /package/templates/{next-base → features/dashboard}/src/app/(dashboard)/dashboard/page.tsx +0 -0
- /package/templates/{next-base → features/dashboard}/src/components/layout/private/app-sidebar.tsx +0 -0
- /package/templates/{next-base → features/dashboard}/src/components/layout/private/dashboard-layout.tsx +0 -0
- /package/templates/{next-base → features/dashboard}/src/components/layout/private/nav-sidebar.tsx +0 -0
- /package/templates/{next-base → features/dashboard}/src/components/ui/data-table/data-table-column-header.tsx +0 -0
- /package/templates/{next-base → features/dashboard}/src/components/ui/data-table/data-table-filter-list.tsx +0 -0
- /package/templates/{next-base → features/dashboard}/src/components/ui/data-table/data-table-pagination.tsx +0 -0
- /package/templates/{next-base → features/dashboard}/src/components/ui/data-table/data-table-skeleton.tsx +0 -0
- /package/templates/{next-base → features/dashboard}/src/components/ui/data-table/data-table-toolbar.tsx +0 -0
- /package/templates/{next-base → features/dashboard}/src/components/ui/data-table/data-table-view-options.tsx +0 -0
- /package/templates/{next-base → features/dashboard}/src/components/ui/data-table/data-table.tsx +0 -0
- /package/templates/{next-base → features/dashboard}/src/components/ui/sidebar.tsx +0 -0
- /package/templates/{next-base → features/dashboard}/src/data/sidebar-modules.ts +0 -0
- /package/templates/{next-base → features/dashboard}/src/hooks/table/use-data-table.ts +0 -0
- /package/templates/{next-base → features/dashboard}/src/hooks/use-mobile.ts +0 -0
- /package/templates/{next-base → features/dashboard}/src/types/data-table.ts +0 -0
- /package/templates/{next-base/src/lib → features/database/src/lib/db}/prisma.ts +0 -0
- /package/templates/{next-base → features/example}/messages/vi/example.json +0 -0
- /package/templates/{next-base → features/example}/src/app/(dashboard)/example/page.tsx +0 -0
- /package/templates/{next-base → features/example}/src/example/components/example-table.tsx +0 -0
- /package/templates/{next-base → features/example}/src/example/validations.ts +0 -0
- /package/templates/{next-base → features/i18n}/messages/vi/common.json +0 -0
- /package/templates/{next-base → features/i18n}/src/components/layout/private/locale-switcher.tsx +0 -0
- /package/templates/{next-base → features/i18n}/src/i18n/config.ts +0 -0
- /package/templates/{next-base → features/i18n}/src/i18n/namespaces.ts +0 -0
- /package/templates/{next-base → features/i18n}/src/i18n/request.ts +0 -0
- /package/templates/{next-base → features/supabase}/src/lib/supabase/client.ts +0 -0
- /package/templates/{next-base → features/supabase}/src/lib/supabase/storage-config.ts +0 -0
- /package/templates/{next-base → features/supabase}/src/lib/supabase/storage.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Project structure
|
|
2
2
|
|
|
3
|
-
Generated by NexTCLI. Folders marked **(module)**
|
|
3
|
+
Generated by NexTCLI. Folders marked **(module)** appear only when that add-on is enabled.
|
|
4
4
|
|
|
5
5
|
## Root
|
|
6
6
|
|
|
@@ -9,22 +9,15 @@ Generated by NexTCLI. Folders marked **(module)** or **(feature)** appear only w
|
|
|
9
9
|
| `nextcli.json` | Manifest: CLI version, locales, namespaces, modules, features |
|
|
10
10
|
| `SETUP.md` | Env + branding setup (this repo) |
|
|
11
11
|
| `PROJECT_STRUCTURE.md` | Folder map (this file) |
|
|
12
|
-
| `prisma/` | Schema + migrations |
|
|
13
|
-
| `messages/` | i18n JSON per locale/namespace |
|
|
14
12
|
| `public/` | Static assets (`logo.svg`, etc.) |
|
|
15
13
|
|
|
16
|
-
## `src/app/` — App Router
|
|
14
|
+
## `src/app/` — App Router (base)
|
|
17
15
|
|
|
18
|
-
| Path
|
|
19
|
-
|
|
|
20
|
-
| `layout.tsx`
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `(dashboard)/` | Protected shell (session + password guard) |
|
|
24
|
-
| `api/auth/[...all]/` | Better Auth passthrough (not wrapped) |
|
|
25
|
-
| `api/v1/` | Project API envelope (`ok` / `fail`) |
|
|
26
|
-
| `api/v1/users/` | User CRUD + RBAC **(base)** |
|
|
27
|
-
| `api/v1/example/` | Demo CRUD sample |
|
|
16
|
+
| Path | Purpose |
|
|
17
|
+
| ------------- | --------------------------------------- |
|
|
18
|
+
| `layout.tsx` | Root layout, metadata from `branding` |
|
|
19
|
+
| `page.tsx` | Welcome landing page |
|
|
20
|
+
| `globals.css` | Design tokens (`nextcli:theme` markers) |
|
|
28
21
|
|
|
29
22
|
## `src/config/`
|
|
30
23
|
|
|
@@ -32,56 +25,41 @@ Generated by NexTCLI. Folders marked **(module)** or **(feature)** appear only w
|
|
|
32
25
|
| ------------- | ------------------------------------ |
|
|
33
26
|
| `branding.ts` | Project name, logo path, description |
|
|
34
27
|
|
|
35
|
-
## `src/lib/` — Shared runtime
|
|
36
|
-
|
|
37
|
-
| Path | Purpose |
|
|
38
|
-
| ---------------------------- | --------------------------------------------------------------- |
|
|
39
|
-
| `auth.ts` / `auth-client.ts` | Better Auth (username + JWT) |
|
|
40
|
-
| `bootstrap.ts` | Seeds `admin` role/user on startup |
|
|
41
|
-
| `rbac.ts` | Role hierarchy guards |
|
|
42
|
-
| `prisma.ts` | DB client |
|
|
43
|
-
| `api-response.ts` | `/api/v1/*` envelope helpers |
|
|
44
|
-
| `supabase/` | Supabase client + Storage helpers |
|
|
45
|
-
| `email/` | **(module: `email`)** provider-agnostic email helper + adapters |
|
|
46
|
-
|
|
47
|
-
## `src/features/` vs `src/example/`
|
|
48
|
-
|
|
49
|
-
| Path | Purpose |
|
|
50
|
-
| ------------------ | --------------------------------------------------------- |
|
|
51
|
-
| `features/auth/` | Sign-in + change-password UI |
|
|
52
|
-
| `features/users/` | User validations/services for API |
|
|
53
|
-
| `example/` | Starter demo feature (rename for production) |
|
|
54
|
-
| `features/<name>/` | **(feature: `nextcli add feature <name>`)** CRUD scaffold |
|
|
55
|
-
|
|
56
28
|
## `src/components/`
|
|
57
29
|
|
|
58
|
-
| Path | Purpose
|
|
59
|
-
| ------------------- |
|
|
60
|
-
| `branding/logo.tsx` | Logo + project name
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
30
|
+
| Path | Purpose |
|
|
31
|
+
| ------------------- | ----------------------- |
|
|
32
|
+
| `branding/logo.tsx` | Logo + project name |
|
|
33
|
+
| `ui/` | shadcn-style primitives |
|
|
34
|
+
| `providers/` | Theme provider |
|
|
63
35
|
|
|
64
|
-
## `
|
|
65
|
-
|
|
66
|
-
Locale config with `nextcli:locales` / `nextcli:namespaces` markers (patched by `nextcli add language` / `add feature`).
|
|
36
|
+
## Optional modules (via `nextcli add module`)
|
|
67
37
|
|
|
68
|
-
|
|
38
|
+
| Module | Adds |
|
|
39
|
+
| ------------------- | ------------------------------------------------------------ |
|
|
40
|
+
| `database` | Prisma schema, client, `DATABASE_URL`, db scripts |
|
|
41
|
+
| `supabase` | Supabase browser client + Storage helpers |
|
|
42
|
+
| `auth` | Better Auth, sign-in pages, user APIs, bootstrap admin |
|
|
43
|
+
| `api` | Axios client, API envelope helpers, React Query provider |
|
|
44
|
+
| `i18n` | next-intl config, messages, locale switcher |
|
|
45
|
+
| `dashboard` | Protected dashboard shell, sidebar, data-table UI |
|
|
46
|
+
| `example` | Starter CRUD demo feature + `Example` Prisma model |
|
|
47
|
+
| `chat` | Chat routes, hooks, Prisma chat models (+ auto deps) |
|
|
48
|
+
| `supabase-realtime` | Realtime channel helpers (+ auto `supabase`) |
|
|
49
|
+
| `seo` | robots/sitemap/JSON-LD helpers |
|
|
50
|
+
| `email` | `src/lib/email/*`, `src/emails/*` (provider: SMTP or Resend) |
|
|
69
51
|
|
|
70
|
-
**
|
|
52
|
+
Module **env variables** and where to find them: see `SETUP.md` → **Optional module environment**.
|
|
71
53
|
|
|
72
|
-
##
|
|
54
|
+
## Generated features
|
|
73
55
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
| `
|
|
77
|
-
| `supabase-realtime` | Realtime channel helpers |
|
|
78
|
-
| `seo` | robots/sitemap/JSON-LD helpers |
|
|
79
|
-
| `email` | `src/lib/email/*`, `src/emails/*` (provider: SMTP or Resend) |
|
|
56
|
+
| Path | Purpose |
|
|
57
|
+
| ------------------ | --------------------------------------------------------- |
|
|
58
|
+
| `features/<name>/` | **(feature: `nextcli add feature <name>`)** CRUD scaffold |
|
|
80
59
|
|
|
81
|
-
|
|
60
|
+
Requires `database` and `api` modules in the project.
|
|
82
61
|
|
|
83
62
|
## Notes
|
|
84
63
|
|
|
64
|
+
- Review `prisma/schema.prisma` before production migrations when `database` is enabled.
|
|
85
65
|
- Do not wrap `api/auth/[...all]` responses — Better Auth expects raw format.
|
|
86
|
-
- Review `prisma/schema.prisma` before production migrations (demo `Example` model).
|
|
87
|
-
- Super-admin account `admin` cannot be modified/deleted via user APIs.
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Quick reference for env vars and branding after `nextcli create`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Minimal base project
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
2. `bun run db:migrate` — applies `prisma/migrations` (includes `Role`, `User.username`, `requirePasswordChange`).
|
|
9
|
-
3. `bun run dev` — bootstrap seeds `admin` / `admin` on first start.
|
|
7
|
+
The default template ships a lightweight Next.js shell with branding, theme, and UI primitives only. No database, auth, or dashboard code is included until you select modules at create time or run `nextcli add module`.
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
## First run
|
|
10
|
+
|
|
11
|
+
1. `bun run dev` (or your package manager equivalent)
|
|
12
|
+
2. Open `http://localhost:3000`
|
|
13
|
+
|
|
14
|
+
When you add the `database` module, run `bun run db:migrate` before relying on Prisma models.
|
|
12
15
|
|
|
13
16
|
## Branding (edit in repo, not env)
|
|
14
17
|
|
|
@@ -17,26 +20,14 @@ Quick reference for env vars and branding after `nextcli create`.
|
|
|
17
20
|
| Display name, slug, description, logo path | `src/config/branding.ts` |
|
|
18
21
|
| Logo file | `public/logo.svg` (or update `logoPath`) |
|
|
19
22
|
| Theme colors (primary, sidebar, …) | `src/app/globals.css` between `nextcli:theme:start` / `nextcli:theme:end` |
|
|
20
|
-
| Sidebar/header labels (i18n) | `messages/<locale>/common.json` → `appName` |
|
|
21
23
|
|
|
22
24
|
## Core environment variables
|
|
23
25
|
|
|
24
|
-
Set in `.env` / `.env.development
|
|
25
|
-
|
|
26
|
-
| Variable | Purpose | Where to get |
|
|
27
|
-
| ------------------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
28
|
-
| `DATABASE_URL` | Supabase pooled Postgres URL (Prisma `url`) | Supabase Dashboard → Connect → ORMs → Prisma → pooled URL (`:6543`, `?pgbouncer=true`) |
|
|
29
|
-
| `DIRECT_URL` | Supabase direct Postgres URL (Prisma `directUrl`) | Supabase Dashboard → Connect → ORMs → Prisma → direct/session URL (`:5432`) |
|
|
30
|
-
| `NEXT_PUBLIC_SUPABASE_URL` | Supabase client URL | Supabase Dashboard → Project Settings → API → Project URL |
|
|
31
|
-
| `NEXT_PUBLIC_SUPABASE_ANON_KEY` | Browser-safe anon API key (public key used by client SDK) | Same page → Project API keys → `anon` `public` |
|
|
32
|
-
| `NEXT_PUBLIC_SUPABASE_STORAGE_BUCKET` | Storage bucket name used by app uploads/reads (`public` is the default bucket name) | Storage → create/select bucket → use that bucket name |
|
|
33
|
-
| `BETTER_AUTH_SECRET` | Auth signing secret | Auto-generated on create; rotate in production |
|
|
34
|
-
| `BETTER_AUTH_URL` | Server auth base URL | Your app URL (e.g. `http://localhost:3000`) |
|
|
35
|
-
| `NEXT_PUBLIC_APP_URL` | Client-visible app URL | Same as public site URL |
|
|
26
|
+
Set in `.env` / `.env.development`.
|
|
36
27
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
| Variable | Purpose | Where to get |
|
|
29
|
+
| --------------------- | ---------------------- | ------------------------------------- |
|
|
30
|
+
| `NEXT_PUBLIC_APP_URL` | Client-visible app URL | Your public site URL (e.g. localhost) |
|
|
40
31
|
|
|
41
32
|
## Optional module environment
|
|
42
33
|
|
|
@@ -50,45 +41,6 @@ Reference for all optional modules. Matching keys are merged into `.env` when se
|
|
|
50
41
|
|
|
51
42
|
<!-- nextcli:module-env:start -->
|
|
52
43
|
|
|
53
|
-
### Module: Chat module (`chat`)
|
|
54
|
-
|
|
55
|
-
| Variable | Where to get |
|
|
56
|
-
| ------------------------- | ---------------------------------------------------- |
|
|
57
|
-
| `NEXT_PUBLIC_ENABLE_CHAT` | Set `true` when chat module is enabled (auto on add) |
|
|
58
|
-
|
|
59
|
-
Requires `supabase-realtime` (auto-added). Run `db:migrate` after add — chat Prisma models are appended.
|
|
60
|
-
|
|
61
|
-
### Module: Supabase Realtime (`supabase-realtime`)
|
|
62
|
-
|
|
63
|
-
Uses the base Supabase URL/anon key. Enable Realtime on tables in Supabase Dashboard → Database → Replication.
|
|
64
|
-
|
|
65
|
-
### Module: SEO pack (`seo`)
|
|
66
|
-
|
|
67
|
-
No extra env keys. Edit `src/app/robots.ts`, `sitemap.ts`, and JSON-LD helpers after add.
|
|
68
|
-
|
|
69
|
-
### Module: Email module (`email`)
|
|
70
|
-
|
|
71
|
-
| Variable | Where to get |
|
|
72
|
-
| ---------------- | ------------------ |
|
|
73
|
-
| `EMAIL_PROVIDER` | `resend` or `smtp` |
|
|
74
|
-
|
|
75
|
-
When `EMAIL_PROVIDER=resend`:
|
|
76
|
-
|
|
77
|
-
| Variable | Where to get |
|
|
78
|
-
| ------------------- | ------------------------------------------------------------------ |
|
|
79
|
-
| `RESEND_API_KEY` | resend.com → API Keys → Create |
|
|
80
|
-
| `RESEND_FROM_EMAIL` | resend.com → Domains → verify domain → use `Name <you@domain.com>` |
|
|
81
|
-
|
|
82
|
-
When `EMAIL_PROVIDER=smtp`:
|
|
83
|
-
|
|
84
|
-
| Variable | Where to get |
|
|
85
|
-
| --------------- | -------------------------------------------- |
|
|
86
|
-
| `SMTP_HOST` | SMTP provider host (Mailgun, SES, etc.) |
|
|
87
|
-
| `SMTP_PORT` | SMTP provider port (commonly `587` or `465`) |
|
|
88
|
-
| `SMTP_USER` | SMTP username |
|
|
89
|
-
| `SMTP_PASSWORD` | SMTP password or app-specific token |
|
|
90
|
-
| `SMTP_FROM` | Sender email (or `Name <mail@domain.com>`) |
|
|
91
|
-
|
|
92
44
|
<!-- nextcli:module-env:end -->
|
|
93
45
|
|
|
94
46
|
## After adding modules
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"@radix-ui/react-slot": "^1.2.3",
|
|
20
20
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
21
21
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
22
|
+
"@supabase/supabase-js": "^2.44.2",
|
|
22
23
|
"@tanstack/react-form": "^1.0.3",
|
|
23
24
|
"@tanstack/react-query": "^5.56.2",
|
|
24
25
|
"@tanstack/react-query-devtools": "^5.56.2",
|
|
@@ -412,6 +413,20 @@
|
|
|
412
413
|
|
|
413
414
|
"@standard-schema/spec": ["@standard-schema/spec@1.0.0", "", {}, "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA=="],
|
|
414
415
|
|
|
416
|
+
"@supabase/auth-js": ["@supabase/auth-js@2.108.1", "", { "dependencies": { "tslib": "2.8.1" } }, "sha512-Lle5rKU8f9LF3K5dDd8Or8mkkG+ptzRZZWKPVMm9B9UuovH65Ss2+iFnQqRsCqaGouvJEcTWyl0cj2riNrrDLQ=="],
|
|
417
|
+
|
|
418
|
+
"@supabase/functions-js": ["@supabase/functions-js@2.108.1", "", { "dependencies": { "tslib": "2.8.1" } }, "sha512-fxBRW/A4IG7ADQztVt0NaEy5ysiO1WJ2pbldsnBchrkHuyepX0Krek9qA9T4gUQBVVTCE9Ea4pdsM5hfn3nc4A=="],
|
|
419
|
+
|
|
420
|
+
"@supabase/phoenix": ["@supabase/phoenix@0.4.2", "", {}, "sha512-YSAGnmDAfuleFCVt3CeurQZAhxRfXWeZIIkwp7NhYzQ1UwW6ePSnzsFAiUm/mbCkfoCf70QQHKW/K6RKh52a4A=="],
|
|
421
|
+
|
|
422
|
+
"@supabase/postgrest-js": ["@supabase/postgrest-js@2.108.1", "", { "dependencies": { "tslib": "2.8.1" } }, "sha512-9lj2MCPPMgSTaJ5y+amnhb3TWPtMFVlbDn2hmX/VV91xQU4j0AauwfMaBErHBJ+zzsSwjc0jLU+zLIZFLQzfig=="],
|
|
423
|
+
|
|
424
|
+
"@supabase/realtime-js": ["@supabase/realtime-js@2.108.1", "", { "dependencies": { "@supabase/phoenix": "^0.4.2", "tslib": "2.8.1" } }, "sha512-mHGGqOjwd1XTydcoffUqEMsbFQHUi6A3uhQ0EXr3iqzpLqItxKA9nbN6gIQxrZ7JRRnuUe/iOFPUkYV9Tdc5lg=="],
|
|
425
|
+
|
|
426
|
+
"@supabase/storage-js": ["@supabase/storage-js@2.108.1", "", { "dependencies": { "iceberg-js": "^0.8.1", "tslib": "2.8.1" } }, "sha512-Er0SGGt85iT6ye+SSh98Az6L2CesoZJuyzEZYH2oBOAnIxa9Nn4CtwUC3veGxYggoT56X+3tVuuQeDBP8kR8sg=="],
|
|
427
|
+
|
|
428
|
+
"@supabase/supabase-js": ["@supabase/supabase-js@2.108.1", "", { "dependencies": { "@supabase/auth-js": "2.108.1", "@supabase/functions-js": "2.108.1", "@supabase/postgrest-js": "2.108.1", "@supabase/realtime-js": "2.108.1", "@supabase/storage-js": "2.108.1" } }, "sha512-V/1hRKLSCJ0zEL+9QFRBUtivvePfOsaAYQmC0HhFNSHC2F3xFs4jSF3YhkLmzex6E4V4FGvmBDOP72D/53NnZA=="],
|
|
429
|
+
|
|
415
430
|
"@swc/core": ["@swc/core@1.15.41", "", { "dependencies": { "@swc/counter": "^0.1.3", "@swc/types": "^0.1.26" }, "optionalDependencies": { "@swc/core-darwin-arm64": "1.15.41", "@swc/core-darwin-x64": "1.15.41", "@swc/core-linux-arm-gnueabihf": "1.15.41", "@swc/core-linux-arm64-gnu": "1.15.41", "@swc/core-linux-arm64-musl": "1.15.41", "@swc/core-linux-ppc64-gnu": "1.15.41", "@swc/core-linux-s390x-gnu": "1.15.41", "@swc/core-linux-x64-gnu": "1.15.41", "@swc/core-linux-x64-musl": "1.15.41", "@swc/core-win32-arm64-msvc": "1.15.41", "@swc/core-win32-ia32-msvc": "1.15.41", "@swc/core-win32-x64-msvc": "1.15.41" }, "peerDependencies": { "@swc/helpers": ">=0.5.17" }, "optionalPeers": ["@swc/helpers"] }, "sha512-03nQq/082QRJJiOvp3FGbgxTGyyxMxohPTjhk/W9bD2J0tk4ukITI7goOhOO2WbaHn/lsPmo/zf8+DIXhwpgYQ=="],
|
|
416
431
|
|
|
417
432
|
"@swc/core-darwin-arm64": ["@swc/core-darwin-arm64@1.15.41", "", { "os": "darwin", "cpu": "arm64" }, "sha512-kREh6J5paQFvP3i7f/4FbqRNOJREutVFVOkder4GVyCBQ39YmER55cW/y1NNjwrchzFqgYswFn0mMDCqbqKzrw=="],
|
|
@@ -884,6 +899,8 @@
|
|
|
884
899
|
|
|
885
900
|
"https-proxy-agent": ["https-proxy-agent@5.0.1", "", { "dependencies": { "agent-base": "6", "debug": "4" } }, "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA=="],
|
|
886
901
|
|
|
902
|
+
"iceberg-js": ["iceberg-js@0.8.1", "", {}, "sha512-1dhVQZXhcHje7798IVM+xoo/1ZdVfzOMIc8/rgVSijRK38EDqOJoGula9N/8ZI5RD8QTxNQtK/Gozpr+qUqRRA=="],
|
|
903
|
+
|
|
887
904
|
"iconv-lite": ["iconv-lite@0.7.2", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw=="],
|
|
888
905
|
|
|
889
906
|
"icu-minify": ["icu-minify@4.13.0", "", { "dependencies": { "@formatjs/icu-messageformat-parser": "^3.4.0" } }, "sha512-SIFMeUHZJjzS5RvIGvybKvWoHjDm9cGVEs2EpJ8PmywOdJLWyblPm7TdPLLoUtkJtwQD7iGhl2WMptZ+N0on+w=="],
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { NextConfig } from "next";
|
|
2
|
-
import createNextIntlPlugin from "next-intl/plugin";
|
|
3
2
|
import path from "node:path";
|
|
4
3
|
import { fileURLToPath } from "node:url";
|
|
5
4
|
|
|
@@ -12,6 +11,4 @@ const nextConfig: NextConfig = {
|
|
|
12
11
|
},
|
|
13
12
|
};
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export default withNextIntl(nextConfig);
|
|
14
|
+
export default nextConfig;
|
|
@@ -7,15 +7,9 @@
|
|
|
7
7
|
"dev": "next dev",
|
|
8
8
|
"build": "next build",
|
|
9
9
|
"start": "next start",
|
|
10
|
-
"lint": "eslint ."
|
|
11
|
-
"postinstall": "prisma generate",
|
|
12
|
-
"db:generate": "prisma generate",
|
|
13
|
-
"db:migrate": "prisma migrate dev",
|
|
14
|
-
"db:studio": "prisma studio"
|
|
10
|
+
"lint": "eslint ."
|
|
15
11
|
},
|
|
16
12
|
"dependencies": {
|
|
17
|
-
"@prisma/client": "^7.8.0",
|
|
18
|
-
"@prisma/adapter-pg": "^7.8.0",
|
|
19
13
|
"@radix-ui/react-avatar": "^1.1.10",
|
|
20
14
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
21
15
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
@@ -27,25 +21,13 @@
|
|
|
27
21
|
"@radix-ui/react-slot": "^1.2.3",
|
|
28
22
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
29
23
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
30
|
-
"@supabase/supabase-js": "^2.44.2",
|
|
31
|
-
"@tanstack/react-form": "^1.0.3",
|
|
32
|
-
"@tanstack/react-query": "^5.56.2",
|
|
33
|
-
"@tanstack/react-query-devtools": "^5.56.2",
|
|
34
|
-
"@tanstack/react-table": "^8.20.5",
|
|
35
|
-
"@dnd-kit/core": "^6.3.1",
|
|
36
|
-
"axios": "^1.7.7",
|
|
37
|
-
"better-auth": "^1.6.11",
|
|
38
24
|
"class-variance-authority": "^0.7.0",
|
|
39
25
|
"clsx": "^2.1.1",
|
|
40
|
-
"date-fns": "^3.6.0",
|
|
41
26
|
"lucide-react": "^0.525.0",
|
|
42
27
|
"next": "^16.1.6",
|
|
43
|
-
"next-intl": "^4.13.0",
|
|
44
28
|
"next-themes": "^0.4.6",
|
|
45
|
-
"nuqs": "^2.8.1",
|
|
46
29
|
"react": "^19.0.0",
|
|
47
30
|
"react-dom": "^19.0.0",
|
|
48
|
-
"pg": "^8.16.3",
|
|
49
31
|
"sonner": "^1.7.1",
|
|
50
32
|
"tailwind-merge": "^2.5.3",
|
|
51
33
|
"tw-animate-css": "^1.3.0",
|
|
@@ -53,13 +35,11 @@
|
|
|
53
35
|
},
|
|
54
36
|
"devDependencies": {
|
|
55
37
|
"@tailwindcss/postcss": "^4.1.11",
|
|
56
|
-
"dotenv": "^17.4.2",
|
|
57
38
|
"@types/node": "^22.7.4",
|
|
58
39
|
"@types/react": "^19.0.0",
|
|
59
40
|
"@types/react-dom": "^19.0.0",
|
|
60
41
|
"eslint": "^9.11.1",
|
|
61
42
|
"eslint-config-next": "^16.1.6",
|
|
62
|
-
"prisma": "^7.8.0",
|
|
63
43
|
"tailwindcss": "^4.1.11",
|
|
64
44
|
"typescript": "^5.6.2"
|
|
65
45
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { Metadata } from "next";
|
|
2
2
|
import { Be_Vietnam_Pro } from "next/font/google";
|
|
3
|
-
import { getLocale, getMessages } from "next-intl/server";
|
|
4
|
-
import { NextIntlClientProvider } from "next-intl";
|
|
5
3
|
import { Toaster } from "sonner";
|
|
6
4
|
import type { ReactNode } from "react";
|
|
7
|
-
import { QueryProvider } from "@/components/providers/query-provider";
|
|
8
5
|
import { ThemeProvider } from "@/components/providers/theme-provider";
|
|
9
6
|
import { branding } from "@/config/branding";
|
|
10
7
|
import "@/app/globals.css";
|
|
@@ -19,23 +16,18 @@ export const metadata: Metadata = {
|
|
|
19
16
|
description: branding.description,
|
|
20
17
|
};
|
|
21
18
|
|
|
22
|
-
export default
|
|
19
|
+
export default function RootLayout({
|
|
23
20
|
children,
|
|
24
21
|
}: Readonly<{
|
|
25
22
|
children: ReactNode;
|
|
26
23
|
}>) {
|
|
27
|
-
const locale = await getLocale();
|
|
28
|
-
const messages = await getMessages();
|
|
29
|
-
|
|
30
24
|
return (
|
|
31
|
-
<html lang=
|
|
25
|
+
<html lang="vi" suppressHydrationWarning>
|
|
32
26
|
<body className={beVietnamPro.className}>
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</ThemeProvider>
|
|
38
|
-
</NextIntlClientProvider>
|
|
27
|
+
<ThemeProvider attribute="class" defaultTheme="light" enableSystem>
|
|
28
|
+
{children}
|
|
29
|
+
<Toaster richColors position="top-right" />
|
|
30
|
+
</ThemeProvider>
|
|
39
31
|
</body>
|
|
40
32
|
</html>
|
|
41
33
|
);
|
|
@@ -1,5 +1,28 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
import { branding } from "@/config/branding";
|
|
3
|
+
import { Button } from "@/components/ui/button";
|
|
2
4
|
|
|
3
5
|
export default function HomePage() {
|
|
4
|
-
|
|
6
|
+
return (
|
|
7
|
+
<main className="flex min-h-screen flex-col items-center justify-center gap-6 p-8 text-center">
|
|
8
|
+
<h1 className="text-3xl font-semibold tracking-tight">
|
|
9
|
+
{branding.projectName}
|
|
10
|
+
</h1>
|
|
11
|
+
<p className="text-muted-foreground max-w-md text-sm">
|
|
12
|
+
{branding.description}
|
|
13
|
+
</p>
|
|
14
|
+
<p className="text-muted-foreground max-w-lg text-sm">
|
|
15
|
+
This project was scaffolded with NexTCLI. Add optional modules with{" "}
|
|
16
|
+
<code className="bg-muted rounded px-1.5 py-0.5 text-xs">
|
|
17
|
+
nextcli add module
|
|
18
|
+
</code>{" "}
|
|
19
|
+
to enable database, auth, dashboard, and more.
|
|
20
|
+
</p>
|
|
21
|
+
<Button asChild variant="outline">
|
|
22
|
+
<Link href="https://github.com/thinhnguyencth1204/NexTCLI">
|
|
23
|
+
NexTCLI docs
|
|
24
|
+
</Link>
|
|
25
|
+
</Button>
|
|
26
|
+
</main>
|
|
27
|
+
);
|
|
5
28
|
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
-- CreateTable
|
|
2
|
-
CREATE TABLE "Role" (
|
|
3
|
-
"id" TEXT NOT NULL,
|
|
4
|
-
"name" TEXT NOT NULL,
|
|
5
|
-
"level" INTEGER NOT NULL,
|
|
6
|
-
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
7
|
-
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
8
|
-
|
|
9
|
-
CONSTRAINT "Role_pkey" PRIMARY KEY ("id")
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
-- CreateTable
|
|
13
|
-
CREATE TABLE "User" (
|
|
14
|
-
"id" TEXT NOT NULL,
|
|
15
|
-
"email" TEXT,
|
|
16
|
-
"username" TEXT NOT NULL,
|
|
17
|
-
"displayUsername" TEXT,
|
|
18
|
-
"name" TEXT,
|
|
19
|
-
"image" TEXT,
|
|
20
|
-
"emailVerified" BOOLEAN NOT NULL DEFAULT false,
|
|
21
|
-
"requirePasswordChange" BOOLEAN NOT NULL DEFAULT false,
|
|
22
|
-
"roleId" TEXT,
|
|
23
|
-
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
24
|
-
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
25
|
-
|
|
26
|
-
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
-- CreateTable
|
|
30
|
-
CREATE TABLE "Example" (
|
|
31
|
-
"id" TEXT NOT NULL,
|
|
32
|
-
"name" TEXT NOT NULL,
|
|
33
|
-
"description" TEXT,
|
|
34
|
-
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
35
|
-
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
36
|
-
|
|
37
|
-
CONSTRAINT "Example_pkey" PRIMARY KEY ("id")
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
-- CreateTable
|
|
41
|
-
CREATE TABLE "Session" (
|
|
42
|
-
"id" TEXT NOT NULL,
|
|
43
|
-
"token" TEXT NOT NULL,
|
|
44
|
-
"expiresAt" TIMESTAMP(3) NOT NULL,
|
|
45
|
-
"ipAddress" TEXT,
|
|
46
|
-
"userAgent" TEXT,
|
|
47
|
-
"userId" TEXT NOT NULL,
|
|
48
|
-
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
49
|
-
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
50
|
-
|
|
51
|
-
CONSTRAINT "Session_pkey" PRIMARY KEY ("id")
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
-- CreateTable
|
|
55
|
-
CREATE TABLE "Account" (
|
|
56
|
-
"id" TEXT NOT NULL,
|
|
57
|
-
"accountId" TEXT NOT NULL,
|
|
58
|
-
"providerId" TEXT NOT NULL,
|
|
59
|
-
"userId" TEXT NOT NULL,
|
|
60
|
-
"accessToken" TEXT,
|
|
61
|
-
"refreshToken" TEXT,
|
|
62
|
-
"idToken" TEXT,
|
|
63
|
-
"accessTokenExpiresAt" TIMESTAMP(3),
|
|
64
|
-
"refreshTokenExpiresAt" TIMESTAMP(3),
|
|
65
|
-
"scope" TEXT,
|
|
66
|
-
"password" TEXT,
|
|
67
|
-
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
68
|
-
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
69
|
-
|
|
70
|
-
CONSTRAINT "Account_pkey" PRIMARY KEY ("id")
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
-- CreateTable
|
|
74
|
-
CREATE TABLE "Verification" (
|
|
75
|
-
"id" TEXT NOT NULL,
|
|
76
|
-
"identifier" TEXT NOT NULL,
|
|
77
|
-
"value" TEXT NOT NULL,
|
|
78
|
-
"expiresAt" TIMESTAMP(3) NOT NULL,
|
|
79
|
-
"createdAt" TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP,
|
|
80
|
-
"updatedAt" TIMESTAMP(3),
|
|
81
|
-
|
|
82
|
-
CONSTRAINT "Verification_pkey" PRIMARY KEY ("id")
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
-- CreateIndex
|
|
86
|
-
CREATE UNIQUE INDEX "Role_name_key" ON "Role"("name");
|
|
87
|
-
|
|
88
|
-
-- CreateIndex
|
|
89
|
-
CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
|
|
90
|
-
|
|
91
|
-
-- CreateIndex
|
|
92
|
-
CREATE UNIQUE INDEX "Session_token_key" ON "Session"("token");
|
|
93
|
-
|
|
94
|
-
-- CreateIndex
|
|
95
|
-
CREATE UNIQUE INDEX "Account_providerId_accountId_key" ON "Account"("providerId", "accountId");
|
|
96
|
-
|
|
97
|
-
-- AddForeignKey
|
|
98
|
-
ALTER TABLE "User" ADD CONSTRAINT "User_roleId_fkey" FOREIGN KEY ("roleId") REFERENCES "Role"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
99
|
-
|
|
100
|
-
-- AddForeignKey
|
|
101
|
-
ALTER TABLE "Session" ADD CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
102
|
-
|
|
103
|
-
-- AddForeignKey
|
|
104
|
-
ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/{next-base/src/lib/auth-client.ts → features/auth/src/lib/auth/client.ts}
RENAMED
|
File without changes
|
/package/templates/{next-base/src/lib/auth-cookies.ts → features/auth/src/lib/auth/cookies.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/{next-base → features/dashboard}/src/components/layout/private/app-sidebar.tsx
RENAMED
|
File without changes
|
|
File without changes
|
/package/templates/{next-base → features/dashboard}/src/components/layout/private/nav-sidebar.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/{next-base → features/dashboard}/src/components/ui/data-table/data-table.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/{next-base → features/i18n}/src/components/layout/private/locale-switcher.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|