create-reactivite 1.4.0 โ 1.6.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 +326 -290
- package/index.js +1 -1
- package/package.json +4 -2
- package/template/package.json +22 -22
- package/template/pnpm-lock.yaml +3274 -3274
- package/template/src/components/author-credit.tsx +25 -25
- package/template2/.env.example +8 -8
- package/template2/.husky/pre-commit +4 -4
- package/template2/.prettierrc +5 -5
- package/template2/README.md +73 -73
- package/template2/__tests__/example.test.ts +20 -20
- package/template2/_gitignore +37 -37
- package/template2/app/[locale]/(private)/dashboard/page.tsx +52 -52
- package/template2/app/[locale]/(public)/login/page.tsx +83 -83
- package/template2/app/[locale]/layout.tsx +58 -58
- package/template2/app/[locale]/locales.ts +10 -10
- package/template2/app/[locale]/page.tsx +38 -38
- package/template2/app/api/clear-session/route.ts +10 -10
- package/template2/app/globals.css +127 -127
- package/template2/app/layout.tsx +7 -7
- package/template2/app/page.tsx +6 -6
- package/template2/components/AuthEventListener.tsx +22 -22
- package/template2/components/author-credit.tsx +25 -25
- package/template2/components/theme-provider.tsx +78 -78
- package/template2/components/ui/button.tsx +60 -60
- package/template2/components/ui/card.tsx +92 -92
- package/template2/components/ui/input.tsx +21 -21
- package/template2/components/ui/label.tsx +24 -24
- package/template2/components/ui/sonner.tsx +40 -40
- package/template2/components.json +22 -22
- package/template2/config/constants.ts +7 -7
- package/template2/config/env.ts +5 -5
- package/template2/contexts/translation-context.tsx +70 -70
- package/template2/eslint.config.mjs +18 -18
- package/template2/hoc/provider.tsx +27 -27
- package/template2/lib/paramsSerializer.ts +40 -40
- package/template2/lib/utils.ts +6 -6
- package/template2/locales/az.json +20 -20
- package/template2/locales/en.json +20 -20
- package/template2/next-env.d.ts +1 -1
- package/template2/next.config.ts +17 -17
- package/template2/orval.config.ts +66 -66
- package/template2/package.json +62 -62
- package/template2/postcss.config.mjs +7 -7
- package/template2/scripts/fix-generated-types.mjs +13 -13
- package/template2/services/generated/.gitkeep +2 -2
- package/template2/services/httpClient/httpClient.ts +70 -70
- package/template2/services/httpClient/orvalMutator.ts +10 -10
- package/template2/store/example-store.tsx +16 -16
- package/template2/store/user-store.tsx +29 -29
- package/template2/testing/msw/handlers/index.ts +6 -6
- package/template2/testing/msw/server.ts +4 -4
- package/template2/tsconfig.json +34 -34
- package/template2/vitest.config.ts +17 -17
- package/template2/vitest.setup.ts +7 -7
- package/template3/README.md +34 -34
- package/template3/_gitignore +16 -16
- package/template3/components.json +21 -0
- package/template3/index.html +8 -2
- package/template3/package-lock.json +3934 -0
- package/template3/package.json +48 -22
- package/template3/postcss.config.mjs +5 -0
- package/template3/rspack.config.mjs +59 -51
- package/template3/src/App.tsx +16 -11
- package/template3/src/components/author-credit.tsx +42 -42
- package/template3/src/components/layout.tsx +59 -0
- package/template3/src/components/matrix-rain.tsx +71 -0
- package/template3/src/components/ui/accordion.tsx +64 -0
- package/template3/src/components/ui/alert-dialog.tsx +196 -0
- package/template3/src/components/ui/alert.tsx +66 -0
- package/template3/src/components/ui/aspect-ratio.tsx +11 -0
- package/template3/src/components/ui/avatar.tsx +107 -0
- package/template3/src/components/ui/badge.tsx +48 -0
- package/template3/src/components/ui/breadcrumb.tsx +109 -0
- package/template3/src/components/ui/button-group.tsx +83 -0
- package/template3/src/components/ui/button.tsx +64 -0
- package/template3/src/components/ui/calendar.tsx +218 -0
- package/template3/src/components/ui/card.tsx +92 -0
- package/template3/src/components/ui/carousel.tsx +241 -0
- package/template3/src/components/ui/chart.tsx +372 -0
- package/template3/src/components/ui/checkbox.tsx +32 -0
- package/template3/src/components/ui/collapsible.tsx +31 -0
- package/template3/src/components/ui/combobox.tsx +310 -0
- package/template3/src/components/ui/command.tsx +184 -0
- package/template3/src/components/ui/context-menu.tsx +252 -0
- package/template3/src/components/ui/dialog.tsx +156 -0
- package/template3/src/components/ui/direction.tsx +22 -0
- package/template3/src/components/ui/drawer.tsx +133 -0
- package/template3/src/components/ui/dropdown-menu.tsx +257 -0
- package/template3/src/components/ui/empty.tsx +104 -0
- package/template3/src/components/ui/field.tsx +248 -0
- package/template3/src/components/ui/form.tsx +165 -0
- package/template3/src/components/ui/hover-card.tsx +42 -0
- package/template3/src/components/ui/input-group.tsx +168 -0
- package/template3/src/components/ui/input-otp.tsx +77 -0
- package/template3/src/components/ui/input.tsx +21 -0
- package/template3/src/components/ui/item.tsx +193 -0
- package/template3/src/components/ui/kbd.tsx +28 -0
- package/template3/src/components/ui/label.tsx +22 -0
- package/template3/src/components/ui/menubar.tsx +276 -0
- package/template3/src/components/ui/native-select.tsx +62 -0
- package/template3/src/components/ui/navigation-menu.tsx +168 -0
- package/template3/src/components/ui/pagination.tsx +127 -0
- package/template3/src/components/ui/popover.tsx +87 -0
- package/template3/src/components/ui/progress.tsx +31 -0
- package/template3/src/components/ui/radio-group.tsx +43 -0
- package/template3/src/components/ui/resizable.tsx +53 -0
- package/template3/src/components/ui/scroll-area.tsx +56 -0
- package/template3/src/components/ui/select.tsx +190 -0
- package/template3/src/components/ui/separator.tsx +26 -0
- package/template3/src/components/ui/sheet.tsx +143 -0
- package/template3/src/components/ui/sidebar.tsx +724 -0
- package/template3/src/components/ui/skeleton.tsx +13 -0
- package/template3/src/components/ui/slider.tsx +61 -0
- package/template3/src/components/ui/sonner.tsx +40 -0
- package/template3/src/components/ui/spinner.tsx +16 -0
- package/template3/src/components/ui/switch.tsx +33 -0
- package/template3/src/components/ui/table.tsx +116 -0
- package/template3/src/components/ui/tabs.tsx +89 -0
- package/template3/src/components/ui/textarea.tsx +18 -0
- package/template3/src/components/ui/toggle-group.tsx +83 -0
- package/template3/src/components/ui/toggle.tsx +47 -0
- package/template3/src/components/ui/tooltip.tsx +55 -0
- package/template3/src/hooks/use-mobile.ts +19 -0
- package/template3/src/index.css +175 -32
- package/template3/src/lib/utils.ts +6 -0
- package/template3/src/main.tsx +10 -10
- package/template3/src/pages/about.tsx +113 -0
- package/template3/src/pages/contact.tsx +111 -0
- package/template3/src/pages/home.tsx +81 -0
- package/template3/tsconfig.json +24 -20
- package/template2/tsconfig.tsbuildinfo +0 -1
package/README.md
CHANGED
|
@@ -1,290 +1,326 @@
|
|
|
1
|
-
# create-reactivite
|
|
2
|
-
|
|
3
|
-
A modern frontend boilerplate generator. On run it asks which template you want, then scaffolds a production-ready app with TypeScript, Tailwind CSS v4 and shadcn/ui pre-wired.
|
|
4
|
-
|
|
5
|
-
## ๐ Templates
|
|
6
|
-
|
|
7
|
-
When you run the CLI you pick one of three templates:
|
|
8
|
-
|
|
9
|
-
| Template | Stack |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| **React + Vite** | React 19, Vite 8 (Rolldown), Tailwind v4, shadcn/ui, React Router
|
|
12
|
-
| **Next.js 16** | Next.js 16 (App Router), React 19, Tailwind v4, shadcn/ui, i18n, TanStack Query, axios + orval, Zustand, react-hook-form + zod, husky, Vitest + MSW |
|
|
13
|
-
| **Rspack** | React 19 + TypeScript, Rspack bundler (SWC)
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
$ npx create-reactivite my-app
|
|
17
|
-
|
|
18
|
-
? Project name: my-app
|
|
19
|
-
? Pick a template: โบ
|
|
20
|
-
โฏ React + Vite (Tailwind v4, shadcn/ui, React Router)
|
|
21
|
-
Next.js 16 (App Router, i18n, TanStack Query, orval, Zustand, husky)
|
|
22
|
-
Rspack (
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## ๐ฆ Installation
|
|
26
|
-
|
|
27
|
-
### Using npx (Recommended)
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npx create-reactivite my-app
|
|
31
|
-
cd my-app
|
|
32
|
-
pnpm dev
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Using npm
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npm create reactivite my-app
|
|
39
|
-
cd my-app
|
|
40
|
-
npm run dev
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Install in current directory
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npx create-reactivite .
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Dependencies install automatically (`pnpm`, falling back to `npm`).
|
|
50
|
-
|
|
51
|
-
## ๐ ๏ธ CLI usage
|
|
52
|
-
|
|
53
|
-
The CLI runs interactively (prompts) or non-interactively (flags) โ flags skip the matching prompt, so it works in scripts and CI.
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
npx create-reactivite [name] [options]
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
| Argument / Flag | Alias | Description |
|
|
60
|
-
| --- | --- | --- |
|
|
61
|
-
| `name` | | Project folder. Use `.` to scaffold into the current directory. Omit to be prompted. Must be lowercase letters, digits, `-` `.` `_` `~`. |
|
|
62
|
-
| `--template <name>` | `-t` | `template` ยท `template2` ยท `template3`. Omit to be prompted. |
|
|
63
|
-
| `--help` | `-h` | Print usage and exit. |
|
|
64
|
-
| `--version` | `-v` | Print version and exit. |
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
# fully non-interactive (no prompts)
|
|
68
|
-
npx create-reactivite my-app --template template2
|
|
69
|
-
npx create-reactivite my-app -t template3
|
|
70
|
-
|
|
71
|
-
npx create-reactivite --help
|
|
72
|
-
npx create-reactivite --version
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
After copying the template the CLI sets `name` in the new `package.json`, removes any bundled lockfile (fresh resolve), runs `git init`, then installs dependencies.
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## โ๏ธ Template 1 โ React + Vite
|
|
80
|
-
|
|
81
|
-
### Features
|
|
82
|
-
|
|
83
|
-
- **โก Vite 8** โ Lightning-fast build tool and dev server (Rolldown bundler)
|
|
84
|
-
- **โ๏ธ React 19** โ Latest React with modern features
|
|
85
|
-
- **๐ TypeScript 6** โ Full TypeScript with strict configuration
|
|
86
|
-
- **๐จ Tailwind CSS v4** โ Config-less, CSS-variable driven theme
|
|
87
|
-
- **๐งฉ shadcn/ui** โ Beautiful, accessible UI components (new-york)
|
|
88
|
-
- **๐งญ React Router
|
|
89
|
-
- **๐ Recharts** โ Composable charts for the admin dashboard
|
|
90
|
-
- **๐ Dark Mode** โ Built-in theme switching
|
|
91
|
-
- **๐ Toasts** โ Sonner notifications
|
|
92
|
-
- **๐ฏ ESLint** โ Modern flat config
|
|
93
|
-
|
|
94
|
-
### Scripts
|
|
95
|
-
|
|
96
|
-
- `pnpm dev` โ dev server (port 5173)
|
|
97
|
-
- `pnpm build` โ `tsc -b && vite build`
|
|
98
|
-
- `pnpm preview` โ serve the production build
|
|
99
|
-
- `pnpm lint` โ ESLint
|
|
100
|
-
|
|
101
|
-
### Structure
|
|
102
|
-
|
|
103
|
-
```
|
|
104
|
-
my-app/
|
|
105
|
-
โโโ public/
|
|
106
|
-
โโโ src/
|
|
107
|
-
โ โโโ components/
|
|
108
|
-
โ โ โโโ ui/ # shadcn/ui components
|
|
109
|
-
โ โ โโโ home-page-components/
|
|
110
|
-
โ โ โโโ admin-page-components/
|
|
111
|
-
โ โโโ lib/utils.ts
|
|
112
|
-
โ โโโ pages/
|
|
113
|
-
โ โ โโโ Homepage/
|
|
114
|
-
โ โ โโโ Dashboard/
|
|
115
|
-
โ โโโ App.tsx # createBrowserRouter route shell
|
|
116
|
-
โ โโโ main.tsx
|
|
117
|
-
โ โโโ global.css
|
|
118
|
-
โโโ components.json
|
|
119
|
-
โโโ vite.config.ts
|
|
120
|
-
โโโ eslint.config.js
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### Routing
|
|
124
|
-
|
|
125
|
-
Routes live in `App.tsx` via `createBrowserRouter` from **react-router**
|
|
126
|
-
|
|
127
|
-
```typescript
|
|
128
|
-
import { createBrowserRouter } from "react-router"
|
|
129
|
-
|
|
130
|
-
const router = createBrowserRouter([
|
|
131
|
-
{ path: "/", element: <Homepage /> },
|
|
132
|
-
{ path: "/dashboard", element: <Dashboard /> },
|
|
133
|
-
])
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## โฒ Template 2 โ Next.js 16
|
|
139
|
-
|
|
140
|
-
A locale-scoped App Router boilerplate with a full data layer and tooling.
|
|
141
|
-
|
|
142
|
-
### Features
|
|
143
|
-
|
|
144
|
-
- **โฒ Next.js 16** โ App Router, `output: "standalone"`
|
|
145
|
-
- **๐ i18n** โ `app/[locale]` routing, lightweight `TranslationProvider` + `locales/*.json`
|
|
146
|
-
- **๐ TanStack Query** โ `QueryClientProvider` + Devtools
|
|
147
|
-
- **๐ axios + orval** โ typed API hooks generated from your OpenAPI schema
|
|
148
|
-
- **๐ป Zustand** โ state stores (persisted `user-store`)
|
|
149
|
-
- **๐ react-hook-form + zod** โ typed forms
|
|
150
|
-
- **๐งช Vitest + MSW** โ unit tests with mocked network
|
|
151
|
-
- **๐ถ husky** โ pre-commit: lint + format + tests
|
|
152
|
-
- **๐จ Tailwind v4 + shadcn/ui**
|
|
153
|
-
|
|
154
|
-
### Scripts
|
|
155
|
-
|
|
156
|
-
- `pnpm dev` โ dev server (port 3000, redirects `/` โ `/az`)
|
|
157
|
-
- `pnpm build` โ `next build`
|
|
158
|
-
- `pnpm test` / `pnpm test:run` โ Vitest
|
|
159
|
-
- `pnpm generate:api` โ orval codegen into `services/generated/`
|
|
160
|
-
- `pnpm lint` / `pnpm format`
|
|
161
|
-
|
|
162
|
-
### Structure
|
|
163
|
-
|
|
164
|
-
```
|
|
165
|
-
my-app/
|
|
166
|
-
โโโ app/
|
|
167
|
-
โ โโโ layout.tsx # root passthrough
|
|
168
|
-
โ โโโ page.tsx # redirects to /{DEFAULT_LOCALE}
|
|
169
|
-
โ โโโ globals.css
|
|
170
|
-
โ โโโ api/clear-session/
|
|
171
|
-
โ โโโ [locale]/
|
|
172
|
-
โ โโโ layout.tsx # html/body shell + providers
|
|
173
|
-
โ โโโ locales.ts # server-only dictionary loader
|
|
174
|
-
โ โโโ page.tsx # Home
|
|
175
|
-
โ โโโ (public)/login/
|
|
176
|
-
โ โโโ (private)/dashboard/
|
|
177
|
-
โโโ components/ui/ # shadcn/ui
|
|
178
|
-
โโโ config/ # env + constants (LOCALES)
|
|
179
|
-
โโโ contexts/ # translation-context
|
|
180
|
-
โโโ hoc/ # QueryProvider
|
|
181
|
-
โโโ lib/ # utils, paramsSerializer
|
|
182
|
-
โโโ services/
|
|
183
|
-
โ โโโ httpClient/ # axios + orval mutator
|
|
184
|
-
โ โโโ generated/ # orval output
|
|
185
|
-
โโโ store/ # zustand
|
|
186
|
-
โโโ locales/ # az.json, en.json
|
|
187
|
-
โโโ testing/msw/
|
|
188
|
-
โโโ orval.config.ts
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
### API codegen (orval)
|
|
192
|
-
|
|
193
|
-
1. Point `orval.config.ts` `input.target` at your OpenAPI schema (or set `OPENAPI_TARGET`).
|
|
194
|
-
2. `pnpm generate:api` โ writes react-query hooks + models to `services/generated/`.
|
|
195
|
-
|
|
196
|
-
> The `@/` path alias maps to the **project root** in this template (not `src/`).
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
## ๐ฆ Template 3 โ Rspack
|
|
201
|
-
|
|
202
|
-
A
|
|
203
|
-
|
|
204
|
-
###
|
|
205
|
-
|
|
206
|
-
-
|
|
207
|
-
-
|
|
208
|
-
- `
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
1
|
+
# create-reactivite
|
|
2
|
+
|
|
3
|
+
A modern frontend boilerplate generator. On run it asks which template you want, then scaffolds a production-ready app with TypeScript, Tailwind CSS v4 and shadcn/ui pre-wired.
|
|
4
|
+
|
|
5
|
+
## ๐ Templates
|
|
6
|
+
|
|
7
|
+
When you run the CLI you pick one of three templates:
|
|
8
|
+
|
|
9
|
+
| Template | Stack |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| **React + Vite** | React 19, Vite 8 (Rolldown), Tailwind v4, shadcn/ui, React Router v8, Recharts |
|
|
12
|
+
| **Next.js 16** | Next.js 16 (App Router), React 19, Tailwind v4, shadcn/ui, i18n, TanStack Query, axios + orval, Zustand, react-hook-form + zod, husky, Vitest + MSW |
|
|
13
|
+
| **Rspack** | React 19 + TypeScript, Rspack bundler (SWC), Tailwind v4, shadcn/ui, React Router v7, Matrix/terminal theme |
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
$ npx create-reactivite my-app
|
|
17
|
+
|
|
18
|
+
? Project name: my-app
|
|
19
|
+
? Pick a template: โบ
|
|
20
|
+
โฏ React + Vite (Tailwind v4, shadcn/ui, React Router)
|
|
21
|
+
Next.js 16 (App Router, i18n, TanStack Query, orval, Zustand, husky)
|
|
22
|
+
Rspack (Tailwind v4, shadcn/ui, React Router, Matrix theme)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## ๐ฆ Installation
|
|
26
|
+
|
|
27
|
+
### Using npx (Recommended)
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx create-reactivite my-app
|
|
31
|
+
cd my-app
|
|
32
|
+
pnpm dev
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Using npm
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm create reactivite my-app
|
|
39
|
+
cd my-app
|
|
40
|
+
npm run dev
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Install in current directory
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx create-reactivite .
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Dependencies install automatically (`pnpm`, falling back to `npm`).
|
|
50
|
+
|
|
51
|
+
## ๐ ๏ธ CLI usage
|
|
52
|
+
|
|
53
|
+
The CLI runs interactively (prompts) or non-interactively (flags) โ flags skip the matching prompt, so it works in scripts and CI.
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
npx create-reactivite [name] [options]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
| Argument / Flag | Alias | Description |
|
|
60
|
+
| --- | --- | --- |
|
|
61
|
+
| `name` | | Project folder. Use `.` to scaffold into the current directory. Omit to be prompted. Must be lowercase letters, digits, `-` `.` `_` `~`. |
|
|
62
|
+
| `--template <name>` | `-t` | `template` ยท `template2` ยท `template3`. Omit to be prompted. |
|
|
63
|
+
| `--help` | `-h` | Print usage and exit. |
|
|
64
|
+
| `--version` | `-v` | Print version and exit. |
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# fully non-interactive (no prompts)
|
|
68
|
+
npx create-reactivite my-app --template template2
|
|
69
|
+
npx create-reactivite my-app -t template3
|
|
70
|
+
|
|
71
|
+
npx create-reactivite --help
|
|
72
|
+
npx create-reactivite --version
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
After copying the template the CLI sets `name` in the new `package.json`, removes any bundled lockfile (fresh resolve), runs `git init`, then installs dependencies.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## โ๏ธ Template 1 โ React + Vite
|
|
80
|
+
|
|
81
|
+
### Features
|
|
82
|
+
|
|
83
|
+
- **โก Vite 8** โ Lightning-fast build tool and dev server (Rolldown bundler)
|
|
84
|
+
- **โ๏ธ React 19** โ Latest React with modern features
|
|
85
|
+
- **๐ TypeScript 6** โ Full TypeScript with strict configuration
|
|
86
|
+
- **๐จ Tailwind CSS v4** โ Config-less, CSS-variable driven theme
|
|
87
|
+
- **๐งฉ shadcn/ui** โ Beautiful, accessible UI components (new-york)
|
|
88
|
+
- **๐งญ React Router v8** โ Client-side routing with `createBrowserRouter`
|
|
89
|
+
- **๐ Recharts** โ Composable charts for the admin dashboard
|
|
90
|
+
- **๐ Dark Mode** โ Built-in theme switching
|
|
91
|
+
- **๐ Toasts** โ Sonner notifications
|
|
92
|
+
- **๐ฏ ESLint** โ Modern flat config
|
|
93
|
+
|
|
94
|
+
### Scripts
|
|
95
|
+
|
|
96
|
+
- `pnpm dev` โ dev server (port 5173)
|
|
97
|
+
- `pnpm build` โ `tsc -b && vite build`
|
|
98
|
+
- `pnpm preview` โ serve the production build
|
|
99
|
+
- `pnpm lint` โ ESLint
|
|
100
|
+
|
|
101
|
+
### Structure
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
my-app/
|
|
105
|
+
โโโ public/
|
|
106
|
+
โโโ src/
|
|
107
|
+
โ โโโ components/
|
|
108
|
+
โ โ โโโ ui/ # shadcn/ui components
|
|
109
|
+
โ โ โโโ home-page-components/
|
|
110
|
+
โ โ โโโ admin-page-components/
|
|
111
|
+
โ โโโ lib/utils.ts
|
|
112
|
+
โ โโโ pages/
|
|
113
|
+
โ โ โโโ Homepage/
|
|
114
|
+
โ โ โโโ Dashboard/
|
|
115
|
+
โ โโโ App.tsx # createBrowserRouter route shell
|
|
116
|
+
โ โโโ main.tsx
|
|
117
|
+
โ โโโ global.css
|
|
118
|
+
โโโ components.json
|
|
119
|
+
โโโ vite.config.ts
|
|
120
|
+
โโโ eslint.config.js
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Routing
|
|
124
|
+
|
|
125
|
+
Routes live in `App.tsx` via `createBrowserRouter` from **react-router** v8 (not `react-router-dom`):
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
import { createBrowserRouter } from "react-router"
|
|
129
|
+
|
|
130
|
+
const router = createBrowserRouter([
|
|
131
|
+
{ path: "/", element: <Homepage /> },
|
|
132
|
+
{ path: "/dashboard", element: <Dashboard /> },
|
|
133
|
+
])
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## โฒ Template 2 โ Next.js 16
|
|
139
|
+
|
|
140
|
+
A locale-scoped App Router boilerplate with a full data layer and tooling.
|
|
141
|
+
|
|
142
|
+
### Features
|
|
143
|
+
|
|
144
|
+
- **โฒ Next.js 16** โ App Router, `output: "standalone"`
|
|
145
|
+
- **๐ i18n** โ `app/[locale]` routing, lightweight `TranslationProvider` + `locales/*.json`
|
|
146
|
+
- **๐ TanStack Query** โ `QueryClientProvider` + Devtools
|
|
147
|
+
- **๐ axios + orval** โ typed API hooks generated from your OpenAPI schema
|
|
148
|
+
- **๐ป Zustand** โ state stores (persisted `user-store`)
|
|
149
|
+
- **๐ react-hook-form + zod** โ typed forms
|
|
150
|
+
- **๐งช Vitest + MSW** โ unit tests with mocked network
|
|
151
|
+
- **๐ถ husky** โ pre-commit: lint + format + tests
|
|
152
|
+
- **๐จ Tailwind v4 + shadcn/ui**
|
|
153
|
+
|
|
154
|
+
### Scripts
|
|
155
|
+
|
|
156
|
+
- `pnpm dev` โ dev server (port 3000, redirects `/` โ `/az`)
|
|
157
|
+
- `pnpm build` โ `next build`
|
|
158
|
+
- `pnpm test` / `pnpm test:run` โ Vitest
|
|
159
|
+
- `pnpm generate:api` โ orval codegen into `services/generated/`
|
|
160
|
+
- `pnpm lint` / `pnpm format`
|
|
161
|
+
|
|
162
|
+
### Structure
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
my-app/
|
|
166
|
+
โโโ app/
|
|
167
|
+
โ โโโ layout.tsx # root passthrough
|
|
168
|
+
โ โโโ page.tsx # redirects to /{DEFAULT_LOCALE}
|
|
169
|
+
โ โโโ globals.css
|
|
170
|
+
โ โโโ api/clear-session/
|
|
171
|
+
โ โโโ [locale]/
|
|
172
|
+
โ โโโ layout.tsx # html/body shell + providers
|
|
173
|
+
โ โโโ locales.ts # server-only dictionary loader
|
|
174
|
+
โ โโโ page.tsx # Home
|
|
175
|
+
โ โโโ (public)/login/
|
|
176
|
+
โ โโโ (private)/dashboard/
|
|
177
|
+
โโโ components/ui/ # shadcn/ui
|
|
178
|
+
โโโ config/ # env + constants (LOCALES)
|
|
179
|
+
โโโ contexts/ # translation-context
|
|
180
|
+
โโโ hoc/ # QueryProvider
|
|
181
|
+
โโโ lib/ # utils, paramsSerializer
|
|
182
|
+
โโโ services/
|
|
183
|
+
โ โโโ httpClient/ # axios + orval mutator
|
|
184
|
+
โ โโโ generated/ # orval output
|
|
185
|
+
โโโ store/ # zustand
|
|
186
|
+
โโโ locales/ # az.json, en.json
|
|
187
|
+
โโโ testing/msw/
|
|
188
|
+
โโโ orval.config.ts
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### API codegen (orval)
|
|
192
|
+
|
|
193
|
+
1. Point `orval.config.ts` `input.target` at your OpenAPI schema (or set `OPENAPI_TARGET`).
|
|
194
|
+
2. `pnpm generate:api` โ writes react-query hooks + models to `services/generated/`.
|
|
195
|
+
|
|
196
|
+
> The `@/` path alias maps to the **project root** in this template (not `src/`).
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## ๐ฆ Template 3 โ Rspack
|
|
201
|
+
|
|
202
|
+
A **React 19 + TypeScript** app on [Rspack](https://rspack.dev/) (Rust-based bundler, built-in SWC), themed as a Matrix/terminal hacker UI (canvas glyph rain, scanlines, neon glow, Orbitron / Share Tech Mono fonts).
|
|
203
|
+
|
|
204
|
+
### Features
|
|
205
|
+
|
|
206
|
+
- **๐ฆ Rspack** โ fast Rust bundler with built-in SWC
|
|
207
|
+
- **โ๏ธ React 19 + TypeScript 6**
|
|
208
|
+
- **๐จ Tailwind v4** โ via PostCSS (`@tailwindcss/postcss` + `postcss-loader`), not the Vite plugin
|
|
209
|
+
- **๐งฉ shadcn/ui** โ full new-york component set vendored in `src/components/ui/`
|
|
210
|
+
- **๐งญ React Router v7** โ `react-router-dom` component API (`BrowserRouter`/`Routes`/`Route`)
|
|
211
|
+
- **๐ง๏ธ Matrix theme** โ `MatrixRain` canvas, scanlines, `text-glow`; forced dark mode
|
|
212
|
+
|
|
213
|
+
### Scripts
|
|
214
|
+
|
|
215
|
+
- `pnpm dev` โ dev server (port 5174)
|
|
216
|
+
- `pnpm build` โ production build โ `dist/`
|
|
217
|
+
- `pnpm preview` โ serve the production build
|
|
218
|
+
|
|
219
|
+
### Structure
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
my-app/
|
|
223
|
+
โโโ index.html # <html class="dark">, Google Fonts
|
|
224
|
+
โโโ rspack.config.mjs # entry, swc loader, postcss-loader, @/ alias
|
|
225
|
+
โโโ postcss.config.mjs # @tailwindcss/postcss
|
|
226
|
+
โโโ components.json # shadcn config (css โ src/index.css)
|
|
227
|
+
โโโ tsconfig.json # @/ โ src/
|
|
228
|
+
โโโ src/
|
|
229
|
+
โโโ main.tsx
|
|
230
|
+
โโโ App.tsx # <Routes> route shell
|
|
231
|
+
โโโ index.css # tailwind + oklch theme + effects
|
|
232
|
+
โโโ lib/utils.ts
|
|
233
|
+
โโโ hooks/use-mobile.ts
|
|
234
|
+
โโโ pages/ # home.tsx, about.tsx, contact.tsx
|
|
235
|
+
โโโ components/
|
|
236
|
+
โโโ ui/ # shadcn/ui
|
|
237
|
+
โโโ layout.tsx # nav + Outlet + MatrixRain + AuthorCredit
|
|
238
|
+
โโโ matrix-rain.tsx
|
|
239
|
+
โโโ author-credit.tsx
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Routing
|
|
243
|
+
|
|
244
|
+
Routes live in `App.tsx` via the **`react-router-dom`** v7 component API (not the `createBrowserRouter` data router used by Template 1):
|
|
245
|
+
|
|
246
|
+
```tsx
|
|
247
|
+
import { BrowserRouter, Route, Routes } from "react-router-dom"
|
|
248
|
+
|
|
249
|
+
<BrowserRouter>
|
|
250
|
+
<Routes>
|
|
251
|
+
<Route element={<Layout />}>
|
|
252
|
+
<Route index element={<Home />} />
|
|
253
|
+
<Route path="about" element={<About />} />
|
|
254
|
+
<Route path="contact" element={<Contact />} />
|
|
255
|
+
</Route>
|
|
256
|
+
</Routes>
|
|
257
|
+
</BrowserRouter>
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## ๐ค Author
|
|
263
|
+
|
|
264
|
+
Every template renders a small credit linking to the author. Built by **Javid Salimov** โ
|
|
265
|
+
[GitHub](https://github.com/javidselimov) ยท
|
|
266
|
+
[LinkedIn](https://www.linkedin.com/in/javidsalim/) ยท
|
|
267
|
+
[npm](https://www.npmjs.com/~ubuligan).
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## ๐จ Adding shadcn/ui Components
|
|
272
|
+
|
|
273
|
+
All three templates use shadcn/ui (new-york, lucide icons):
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
npx shadcn@latest add button
|
|
277
|
+
npx shadcn@latest add form
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## ๐ Maintaining template versions
|
|
281
|
+
|
|
282
|
+
This repo ships a Claude Code skill that bumps every template's dependencies to their latest published versions in one shot โ useful when keeping the scaffolds current.
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
/update-template-deps
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
It runs `npm-check-updates` inside `template/`, `template2/` and `template3/`, rewrites each `package.json` to the latest, and reports what changed โ flagging **major** bumps that need a build check. The generator's own root `package.json` is left untouched.
|
|
289
|
+
|
|
290
|
+
You can also run the helper directly:
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
# all templates, latest (includes majors)
|
|
294
|
+
node .claude/skills/update-template-deps/update-deps.mjs
|
|
295
|
+
|
|
296
|
+
# safe โ no major bumps
|
|
297
|
+
node .claude/skills/update-template-deps/update-deps.mjs --target minor
|
|
298
|
+
|
|
299
|
+
# a single template
|
|
300
|
+
node .claude/skills/update-template-deps/update-deps.mjs --template template2
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
After a major bump, verify the affected template still builds before publishing:
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
cd template2 && pnpm install && pnpm build
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## ๐ค Contributing
|
|
310
|
+
|
|
311
|
+
Contributions welcome โ open a PR.
|
|
312
|
+
|
|
313
|
+
## ๐ License
|
|
314
|
+
|
|
315
|
+
MIT
|
|
316
|
+
|
|
317
|
+
## ๐ Links
|
|
318
|
+
|
|
319
|
+
- [React](https://react.dev/) ยท [Next.js](https://nextjs.org/) ยท [Vite](https://vite.dev/) ยท [Rspack](https://rspack.dev/)
|
|
320
|
+
- [Tailwind CSS](https://tailwindcss.com/) ยท [shadcn/ui](https://ui.shadcn.com/)
|
|
321
|
+
- [React Router](https://reactrouter.com/) ยท [TanStack Query](https://tanstack.com/query) ยท [orval](https://orval.dev/)
|
|
322
|
+
- [Zustand](https://zustand.docs.pmnd.rs/) ยท [Recharts](https://recharts.org/) ยท [TypeScript](https://www.typescriptlang.org/)
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
**Happy coding! ๐**
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-reactivite",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "โก Scaffold modern frontend projects in seconds โ pick a template: React + Vite
|
|
3
|
+
"version": "1.6.0",
|
|
4
|
+
"description": "โก Scaffold modern frontend projects in seconds โ pick a template: React + Vite, Next.js 16 (App Router), or Rspack. All ship Tailwind v4, shadcn/ui, TypeScript and a clean, production-ready structure. The Next.js template adds i18n, TanStack Query, axios/orval, Zustand, husky and Vitest. Zero setup hassle.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-reactivite": "./index.js"
|
|
7
7
|
},
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
"keywords": [
|
|
30
30
|
"react",
|
|
31
31
|
"vite",
|
|
32
|
+
"nextjs",
|
|
33
|
+
"rspack",
|
|
32
34
|
"tailwind",
|
|
33
35
|
"tailwindcss",
|
|
34
36
|
"shadcn",
|