create-reactivite 1.4.0 → 1.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.
Files changed (150) hide show
  1. package/README.md +326 -290
  2. package/index.js +77 -2
  3. package/package.json +4 -2
  4. package/template/.storybook/main.ts +20 -0
  5. package/template/.storybook/preview.tsx +55 -0
  6. package/template/_gitignore +3 -0
  7. package/template/index.html +1 -1
  8. package/template/package.json +29 -23
  9. package/template/src/components/author-credit.tsx +25 -25
  10. package/template/src/components/ui-lib/auth-form.stories.tsx +26 -0
  11. package/template/src/components/ui-lib/auth-form.tsx +116 -0
  12. package/template/src/components/ui-lib/empty-state.stories.tsx +32 -0
  13. package/template/src/components/ui-lib/empty-state.tsx +54 -0
  14. package/template/src/components/ui-lib/feature-card.stories.tsx +45 -0
  15. package/template/src/components/ui-lib/feature-card.tsx +52 -0
  16. package/template/src/components/ui-lib/index.ts +13 -0
  17. package/template/src/components/ui-lib/page-header.stories.tsx +49 -0
  18. package/template/src/components/ui-lib/page-header.tsx +46 -0
  19. package/template/src/components/ui-lib/pricing-card.stories.tsx +58 -0
  20. package/template/src/components/ui-lib/pricing-card.tsx +86 -0
  21. package/template/src/components/ui-lib/stat-card.stories.tsx +55 -0
  22. package/template/src/components/ui-lib/stat-card.tsx +73 -0
  23. package/template/src/components/ui-lib/themes.stories.tsx +68 -0
  24. package/template/src/global.css +122 -0
  25. package/template2/.env.example +8 -8
  26. package/template2/.husky/pre-commit +4 -4
  27. package/template2/.prettierrc +5 -5
  28. package/template2/README.md +73 -73
  29. package/template2/__tests__/example.test.ts +20 -20
  30. package/template2/_gitignore +37 -37
  31. package/template2/app/[locale]/(private)/dashboard/page.tsx +52 -52
  32. package/template2/app/[locale]/(public)/login/page.tsx +83 -83
  33. package/template2/app/[locale]/layout.tsx +58 -58
  34. package/template2/app/[locale]/locales.ts +10 -10
  35. package/template2/app/[locale]/page.tsx +38 -38
  36. package/template2/app/api/clear-session/route.ts +10 -10
  37. package/template2/app/globals.css +127 -127
  38. package/template2/app/layout.tsx +7 -7
  39. package/template2/app/page.tsx +6 -6
  40. package/template2/components/AuthEventListener.tsx +22 -22
  41. package/template2/components/author-credit.tsx +25 -25
  42. package/template2/components/theme-provider.tsx +78 -78
  43. package/template2/components/ui/button.tsx +60 -60
  44. package/template2/components/ui/card.tsx +92 -92
  45. package/template2/components/ui/input.tsx +21 -21
  46. package/template2/components/ui/label.tsx +24 -24
  47. package/template2/components/ui/sonner.tsx +40 -40
  48. package/template2/components.json +22 -22
  49. package/template2/config/constants.ts +7 -7
  50. package/template2/config/env.ts +5 -5
  51. package/template2/contexts/translation-context.tsx +70 -70
  52. package/template2/eslint.config.mjs +18 -18
  53. package/template2/hoc/provider.tsx +27 -27
  54. package/template2/lib/paramsSerializer.ts +40 -40
  55. package/template2/lib/utils.ts +6 -6
  56. package/template2/locales/az.json +20 -20
  57. package/template2/locales/en.json +20 -20
  58. package/template2/next-env.d.ts +1 -1
  59. package/template2/next.config.ts +17 -17
  60. package/template2/orval.config.ts +66 -66
  61. package/template2/package.json +62 -62
  62. package/template2/postcss.config.mjs +7 -7
  63. package/template2/scripts/fix-generated-types.mjs +13 -13
  64. package/template2/services/generated/.gitkeep +2 -2
  65. package/template2/services/httpClient/httpClient.ts +70 -70
  66. package/template2/services/httpClient/orvalMutator.ts +10 -10
  67. package/template2/store/example-store.tsx +16 -16
  68. package/template2/store/user-store.tsx +29 -29
  69. package/template2/testing/msw/handlers/index.ts +6 -6
  70. package/template2/testing/msw/server.ts +4 -4
  71. package/template2/tsconfig.json +34 -34
  72. package/template2/vitest.config.ts +17 -17
  73. package/template2/vitest.setup.ts +7 -7
  74. package/template3/README.md +34 -34
  75. package/template3/_gitignore +16 -16
  76. package/template3/components.json +21 -0
  77. package/template3/index.html +8 -2
  78. package/template3/package.json +48 -22
  79. package/template3/postcss.config.mjs +5 -0
  80. package/template3/rspack.config.mjs +59 -51
  81. package/template3/src/App.tsx +16 -11
  82. package/template3/src/components/author-credit.tsx +42 -42
  83. package/template3/src/components/layout.tsx +59 -0
  84. package/template3/src/components/matrix-rain.tsx +71 -0
  85. package/template3/src/components/ui/accordion.tsx +64 -0
  86. package/template3/src/components/ui/alert-dialog.tsx +196 -0
  87. package/template3/src/components/ui/alert.tsx +66 -0
  88. package/template3/src/components/ui/aspect-ratio.tsx +11 -0
  89. package/template3/src/components/ui/avatar.tsx +107 -0
  90. package/template3/src/components/ui/badge.tsx +48 -0
  91. package/template3/src/components/ui/breadcrumb.tsx +109 -0
  92. package/template3/src/components/ui/button-group.tsx +83 -0
  93. package/template3/src/components/ui/button.tsx +64 -0
  94. package/template3/src/components/ui/calendar.tsx +218 -0
  95. package/template3/src/components/ui/card.tsx +92 -0
  96. package/template3/src/components/ui/carousel.tsx +241 -0
  97. package/template3/src/components/ui/chart.tsx +372 -0
  98. package/template3/src/components/ui/checkbox.tsx +32 -0
  99. package/template3/src/components/ui/collapsible.tsx +31 -0
  100. package/template3/src/components/ui/combobox.tsx +310 -0
  101. package/template3/src/components/ui/command.tsx +184 -0
  102. package/template3/src/components/ui/context-menu.tsx +252 -0
  103. package/template3/src/components/ui/dialog.tsx +156 -0
  104. package/template3/src/components/ui/direction.tsx +22 -0
  105. package/template3/src/components/ui/drawer.tsx +133 -0
  106. package/template3/src/components/ui/dropdown-menu.tsx +257 -0
  107. package/template3/src/components/ui/empty.tsx +104 -0
  108. package/template3/src/components/ui/field.tsx +248 -0
  109. package/template3/src/components/ui/form.tsx +165 -0
  110. package/template3/src/components/ui/hover-card.tsx +42 -0
  111. package/template3/src/components/ui/input-group.tsx +168 -0
  112. package/template3/src/components/ui/input-otp.tsx +77 -0
  113. package/template3/src/components/ui/input.tsx +21 -0
  114. package/template3/src/components/ui/item.tsx +193 -0
  115. package/template3/src/components/ui/kbd.tsx +28 -0
  116. package/template3/src/components/ui/label.tsx +22 -0
  117. package/template3/src/components/ui/menubar.tsx +276 -0
  118. package/template3/src/components/ui/native-select.tsx +62 -0
  119. package/template3/src/components/ui/navigation-menu.tsx +168 -0
  120. package/template3/src/components/ui/pagination.tsx +127 -0
  121. package/template3/src/components/ui/popover.tsx +87 -0
  122. package/template3/src/components/ui/progress.tsx +31 -0
  123. package/template3/src/components/ui/radio-group.tsx +43 -0
  124. package/template3/src/components/ui/resizable.tsx +53 -0
  125. package/template3/src/components/ui/scroll-area.tsx +56 -0
  126. package/template3/src/components/ui/select.tsx +190 -0
  127. package/template3/src/components/ui/separator.tsx +26 -0
  128. package/template3/src/components/ui/sheet.tsx +143 -0
  129. package/template3/src/components/ui/sidebar.tsx +724 -0
  130. package/template3/src/components/ui/skeleton.tsx +13 -0
  131. package/template3/src/components/ui/slider.tsx +61 -0
  132. package/template3/src/components/ui/sonner.tsx +40 -0
  133. package/template3/src/components/ui/spinner.tsx +16 -0
  134. package/template3/src/components/ui/switch.tsx +33 -0
  135. package/template3/src/components/ui/table.tsx +116 -0
  136. package/template3/src/components/ui/tabs.tsx +89 -0
  137. package/template3/src/components/ui/textarea.tsx +18 -0
  138. package/template3/src/components/ui/toggle-group.tsx +83 -0
  139. package/template3/src/components/ui/toggle.tsx +47 -0
  140. package/template3/src/components/ui/tooltip.tsx +55 -0
  141. package/template3/src/hooks/use-mobile.ts +19 -0
  142. package/template3/src/index.css +175 -32
  143. package/template3/src/lib/utils.ts +6 -0
  144. package/template3/src/main.tsx +10 -10
  145. package/template3/src/pages/about.tsx +113 -0
  146. package/template3/src/pages/contact.tsx +111 -0
  147. package/template3/src/pages/home.tsx +81 -0
  148. package/template3/tsconfig.json +24 -20
  149. package/template/pnpm-lock.yaml +0 -3274
  150. 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 v7, 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). Minimal starter grow it yourself. |
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 (minimal React + TypeScript starter)
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 v7** — 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** v7 (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 (minimal)
201
-
202
- A deliberately bare **React + TypeScript** starter on [Rspack](https://rspack.dev/) (Rust-based bundler, built-in SWC). No router, no UI kit a clean base to build on.
203
-
204
- ### Scripts
205
-
206
- - `pnpm dev`dev server (port 5174)
207
- - `pnpm build` production build → `dist/`
208
- - `pnpm preview` serve the production build
209
-
210
- ### Structure
211
-
212
- ```
213
- my-app/
214
- ├── index.html
215
- ├── rspack.config.mjs # entry, swc loader, html plugin, native CSS
216
- ├── tsconfig.json
217
- └── src/
218
- ├── main.tsx
219
- ├── App.tsx
220
- ├── index.css
221
- └── components/author-credit.tsx
222
- ```
223
-
224
- ---
225
-
226
- ## 👤 Author
227
-
228
- Every template renders a small credit linking to the author. Built by **Javid Salimov** —
229
- [GitHub](https://github.com/javidselimov) ·
230
- [LinkedIn](https://www.linkedin.com/in/javidsalim/) ·
231
- [npm](https://www.npmjs.com/~ubuligan).
232
-
233
- ---
234
-
235
- ## 🎨 Adding shadcn/ui Components
236
-
237
- The React + Vite and Next.js templates use shadcn/ui (new-york, lucide icons):
238
-
239
- ```bash
240
- npx shadcn@latest add button
241
- npx shadcn@latest add form
242
- ```
243
-
244
- ## 🔄 Maintaining template versions
245
-
246
- 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.
247
-
248
- ```
249
- /update-template-deps
250
- ```
251
-
252
- 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.
253
-
254
- You can also run the helper directly:
255
-
256
- ```bash
257
- # all templates, latest (includes majors)
258
- node .claude/skills/update-template-deps/update-deps.mjs
259
-
260
- # safe — no major bumps
261
- node .claude/skills/update-template-deps/update-deps.mjs --target minor
262
-
263
- # a single template
264
- node .claude/skills/update-template-deps/update-deps.mjs --template template2
265
- ```
266
-
267
- After a major bump, verify the affected template still builds before publishing:
268
-
269
- ```bash
270
- cd template2 && pnpm install && pnpm build
271
- ```
272
-
273
- ## 🤝 Contributing
274
-
275
- Contributions welcome — open a PR.
276
-
277
- ## 📄 License
278
-
279
- MIT
280
-
281
- ## 🔗 Links
282
-
283
- - [React](https://react.dev/) · [Next.js](https://nextjs.org/) · [Vite](https://vite.dev/) · [Rspack](https://rspack.dev/)
284
- - [Tailwind CSS](https://tailwindcss.com/) · [shadcn/ui](https://ui.shadcn.com/)
285
- - [React Router](https://reactrouter.com/) · [TanStack Query](https://tanstack.com/query) · [orval](https://orval.dev/)
286
- - [Zustand](https://zustand.docs.pmnd.rs/) · [Recharts](https://recharts.org/) · [TypeScript](https://www.typescriptlang.org/)
287
-
288
- ---
289
-
290
- **Happy coding! 🎉**
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! 🎉**