@msishamim/create-next-monorepo 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +297 -0
- package/bin/cli.js +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +5575 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +221 -0
- package/dist/index.js +5557 -0
- package/dist/index.js.map +1 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MSI Shamim
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
# @msishamim/create-next-monorepo
|
|
2
|
+
|
|
3
|
+
Generate **production-ready Next.js + NestJS/Express monorepos** with Turborepo in one command.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@msishamim/create-next-monorepo)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://nodejs.org)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Next.js 15** with App Router — pages, layouts, loading/error states
|
|
14
|
+
- **Backend choice** — NestJS (modules, controllers, services) or Express (routes, services)
|
|
15
|
+
- **Styling choice** — Tailwind CSS, CSS Modules, or Styled Components
|
|
16
|
+
- **Database ORM** — Prisma or Drizzle with schema, client, seed, and migrations
|
|
17
|
+
- **Authentication** — NextAuth.js v5 or custom JWT with middleware
|
|
18
|
+
- **State management** — Zustand, Jotai, Redux Toolkit, or TanStack Query
|
|
19
|
+
- **Turborepo + pnpm** — optimized build pipelines with workspace caching
|
|
20
|
+
- **Shared packages** — UI components, TypeScript types, Zod validators, utility functions
|
|
21
|
+
- **Auto version resolution** — fetches latest versions from npm registry at generation time
|
|
22
|
+
- **Doctor command** — validate structure integrity with 100+ checks and auto-fix
|
|
23
|
+
- **Workflow guides** — step-by-step dev guides for components, pages, and API features
|
|
24
|
+
- **AI agent skills** — Claude Code skills + pre-approved settings for every project
|
|
25
|
+
- **GitHub files** — CI workflow, issue/PR templates, code of conduct (optional)
|
|
26
|
+
- **11 license types** — MIT, Apache-2.0, GPL, BSD, ISC, Unlicense, proprietary, and more
|
|
27
|
+
- **Production linting** — strict TypeScript, ESLint flat config, Prettier
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx @msishamim/create-next-monorepo my-app
|
|
33
|
+
cd my-app
|
|
34
|
+
pnpm dev
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Frontend runs on `http://localhost:3000`, backend on `http://localhost:3001/api`.
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Run directly with npx (recommended)
|
|
43
|
+
npx @msishamim/create-next-monorepo my-app
|
|
44
|
+
|
|
45
|
+
# Or install globally
|
|
46
|
+
npm install -g @msishamim/create-next-monorepo
|
|
47
|
+
create-next-monorepo my-app
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
### Basic (all defaults)
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx @msishamim/create-next-monorepo my-app
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Creates a monorepo with NestJS, Tailwind, Prisma + Postgres, NextAuth, Zustand, and Vitest.
|
|
59
|
+
|
|
60
|
+
### Custom options
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx @msishamim/create-next-monorepo my-app \
|
|
64
|
+
--backend express \
|
|
65
|
+
--styling css-modules \
|
|
66
|
+
--orm drizzle \
|
|
67
|
+
--db mysql \
|
|
68
|
+
--auth custom \
|
|
69
|
+
--state redux \
|
|
70
|
+
--testing jest \
|
|
71
|
+
--license Apache-2.0 \
|
|
72
|
+
--github
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Minimal (no database, no auth, no state)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npx @msishamim/create-next-monorepo my-app --orm none --auth none --state none
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Options
|
|
82
|
+
|
|
83
|
+
| Flag | Values | Default | Description |
|
|
84
|
+
|------|--------|---------|-------------|
|
|
85
|
+
| `--backend, -b` | `nestjs`, `express` | `nestjs` | Backend framework |
|
|
86
|
+
| `--styling, -s` | `tailwind`, `css-modules`, `styled-components` | `tailwind` | Styling approach |
|
|
87
|
+
| `--orm` | `prisma`, `drizzle`, `none` | `prisma` | Database ORM |
|
|
88
|
+
| `--db` | `postgres`, `mysql`, `sqlite`, `mongodb` | `postgres` | Database type (when ORM is set) |
|
|
89
|
+
| `--auth` | `next-auth`, `custom`, `none` | `next-auth` | Authentication strategy |
|
|
90
|
+
| `--state` | `zustand`, `jotai`, `redux`, `tanstack-query`, `none` | `zustand` | State management |
|
|
91
|
+
| `--testing` | `vitest`, `jest` | `vitest` | Testing framework |
|
|
92
|
+
| `--license` | `MIT`, `Apache-2.0`, `GPL-3.0`, `BSD-3-Clause`, ... | `MIT` | License type (11 options) |
|
|
93
|
+
| `--git / --no-git` | boolean | `true` | Initialize git with first commit |
|
|
94
|
+
| `--github` | boolean | `false` | Generate GitHub community files |
|
|
95
|
+
| `--package-manager` | `pnpm`, `npm`, `yarn`, `bun` | `pnpm` | Package manager |
|
|
96
|
+
|
|
97
|
+
## Commands
|
|
98
|
+
|
|
99
|
+
### Create (default)
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
create-next-monorepo <name> [options]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Doctor
|
|
106
|
+
|
|
107
|
+
Validate monorepo structure integrity (100+ checks):
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
create-next-monorepo doctor # Report only
|
|
111
|
+
create-next-monorepo doctor --fix # Auto-restore missing files
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Workflow
|
|
115
|
+
|
|
116
|
+
Step-by-step development guides:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
create-next-monorepo workflow # Overview
|
|
120
|
+
create-next-monorepo workflow a # Component Design
|
|
121
|
+
create-next-monorepo workflow b # Page/Route Design
|
|
122
|
+
create-next-monorepo workflow c # API Feature Design
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Generated Structure
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
my-app/
|
|
129
|
+
├── apps/
|
|
130
|
+
│ ├── web/ # Next.js 15 (App Router)
|
|
131
|
+
│ │ ├── app/
|
|
132
|
+
│ │ │ ├── layout.tsx # Root layout
|
|
133
|
+
│ │ │ ├── page.tsx # Home page
|
|
134
|
+
│ │ │ ├── globals.css # Global styles
|
|
135
|
+
│ │ │ ├── not-found.tsx # 404 page
|
|
136
|
+
│ │ │ ├── error.tsx # Error boundary
|
|
137
|
+
│ │ │ └── loading.tsx # Loading state
|
|
138
|
+
│ │ ├── lib/ # Auth config, state stores
|
|
139
|
+
│ │ ├── components/ # App-specific components
|
|
140
|
+
│ │ ├── hooks/ # App-specific hooks
|
|
141
|
+
│ │ ├── public/ # Static assets
|
|
142
|
+
│ │ ├── next.config.ts
|
|
143
|
+
│ │ ├── tsconfig.json
|
|
144
|
+
│ │ └── package.json
|
|
145
|
+
│ │
|
|
146
|
+
│ └── api/ # NestJS or Express
|
|
147
|
+
│ ├── src/
|
|
148
|
+
│ │ ├── main.ts # Server entry
|
|
149
|
+
│ │ ├── app.module.ts # NestJS module (or app.ts for Express)
|
|
150
|
+
│ │ ├── app.controller.ts # Health + info endpoints
|
|
151
|
+
│ │ ├── app.service.ts # App service
|
|
152
|
+
│ │ └── common/
|
|
153
|
+
│ │ ├── filters/ # Exception/error handlers
|
|
154
|
+
│ │ ├── guards/ # Auth guards
|
|
155
|
+
│ │ ├── interceptors/ # Logging interceptors
|
|
156
|
+
│ │ └── pipes/ # Zod validation pipes
|
|
157
|
+
│ ├── test/
|
|
158
|
+
│ ├── tsconfig.json
|
|
159
|
+
│ └── package.json
|
|
160
|
+
│
|
|
161
|
+
├── packages/
|
|
162
|
+
│ ├── ui/ # Shared React components
|
|
163
|
+
│ │ └── src/
|
|
164
|
+
│ │ ├── components/ # Button, Card, Input
|
|
165
|
+
│ │ └── hooks/ # useMediaQuery, useDebounce
|
|
166
|
+
│ │
|
|
167
|
+
│ ├── lib/ # Shared utilities & types
|
|
168
|
+
│ │ └── src/
|
|
169
|
+
│ │ ├── types/ # TypeScript interfaces
|
|
170
|
+
│ │ ├── utils/ # Utility functions
|
|
171
|
+
│ │ ├── constants/ # HTTP status codes, patterns
|
|
172
|
+
│ │ └── validators/ # Zod schemas
|
|
173
|
+
│ │
|
|
174
|
+
│ ├── config/ # Shared configurations
|
|
175
|
+
│ │ ├── eslint/ # ESLint flat config
|
|
176
|
+
│ │ ├── typescript/ # Base, Next.js, Node tsconfigs
|
|
177
|
+
│ │ └── tailwind/ # Tailwind base config
|
|
178
|
+
│ │
|
|
179
|
+
│ └── database/ # Prisma or Drizzle (optional)
|
|
180
|
+
│ ├── src/
|
|
181
|
+
│ │ ├── schema/ # Database schema
|
|
182
|
+
│ │ ├── client.ts # DB client singleton
|
|
183
|
+
│ │ └── seed.ts # Seed script
|
|
184
|
+
│ └── prisma/ # Prisma schema (if Prisma)
|
|
185
|
+
│
|
|
186
|
+
├── .claude/ # AI agent configuration
|
|
187
|
+
│ ├── settings.json # Pre-approved Claude Code tools
|
|
188
|
+
│ └── skills/ # 4 development skills
|
|
189
|
+
│
|
|
190
|
+
├── turbo.json # Turborepo pipeline
|
|
191
|
+
├── package.json # Workspace root
|
|
192
|
+
├── pnpm-workspace.yaml # pnpm workspaces
|
|
193
|
+
├── .env.example # Environment variables template
|
|
194
|
+
├── docker-compose.yml # Database service (optional)
|
|
195
|
+
├── README.md # Project documentation
|
|
196
|
+
├── LICENSE # License file
|
|
197
|
+
└── CONTRIBUTING.md # Contribution guidelines
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Tech Stack Options
|
|
201
|
+
|
|
202
|
+
### Backend
|
|
203
|
+
|
|
204
|
+
| Feature | NestJS | Express |
|
|
205
|
+
|---------|--------|---------|
|
|
206
|
+
| Architecture | Modules + Controllers + Services | Routes + Services |
|
|
207
|
+
| DI | Built-in (decorators) | Manual |
|
|
208
|
+
| Validation | Pipes (Zod integration) | Middleware (Zod integration) |
|
|
209
|
+
| Best for | Large apps, enterprise | Lightweight APIs, microservices |
|
|
210
|
+
|
|
211
|
+
### Styling
|
|
212
|
+
|
|
213
|
+
| Feature | Tailwind CSS | CSS Modules | Styled Components |
|
|
214
|
+
|---------|-------------|-------------|-------------------|
|
|
215
|
+
| Approach | Utility-first | Scoped CSS files | CSS-in-JS |
|
|
216
|
+
| Bundle | Purged at build | Scoped at build | Runtime |
|
|
217
|
+
| DX | Fast prototyping | Traditional CSS | Component-scoped |
|
|
218
|
+
|
|
219
|
+
### State Management
|
|
220
|
+
|
|
221
|
+
| Feature | Zustand | Jotai | Redux Toolkit | TanStack Query |
|
|
222
|
+
|---------|---------|-------|---------------|----------------|
|
|
223
|
+
| Pattern | Stores | Atoms | Slices | Query hooks |
|
|
224
|
+
| Provider | None needed | None needed | Required | Required |
|
|
225
|
+
| Best for | General state | Fine-grained | Complex state | Server state |
|
|
226
|
+
|
|
227
|
+
### ORM
|
|
228
|
+
|
|
229
|
+
| Feature | Prisma | Drizzle |
|
|
230
|
+
|---------|--------|---------|
|
|
231
|
+
| Schema | `.prisma` DSL | TypeScript |
|
|
232
|
+
| Migrations | Built-in CLI | drizzle-kit |
|
|
233
|
+
| Type safety | Generated types | Inferred types |
|
|
234
|
+
| Best for | Rapid development | SQL control |
|
|
235
|
+
|
|
236
|
+
## AI Agent Skills
|
|
237
|
+
|
|
238
|
+
Every generated project includes Claude Code skills in `.claude/skills/`:
|
|
239
|
+
|
|
240
|
+
| Skill | Trigger | Description |
|
|
241
|
+
|-------|---------|-------------|
|
|
242
|
+
| Component Design | "Build a component" | Create shared UI components in packages/ui/ |
|
|
243
|
+
| Page Design | "Build a page" | Create Next.js pages with state + API integration |
|
|
244
|
+
| API Feature | "Add an API endpoint" | Create backend endpoints with validation + DB |
|
|
245
|
+
| Monorepo Doctor | "Check structure" | Validate and fix monorepo integrity |
|
|
246
|
+
|
|
247
|
+
## Programmatic Usage
|
|
248
|
+
|
|
249
|
+
```typescript
|
|
250
|
+
import { ProjectConfig, Generator } from '@msishamim/create-next-monorepo';
|
|
251
|
+
|
|
252
|
+
const config = new ProjectConfig({
|
|
253
|
+
name: 'my-app',
|
|
254
|
+
backend: 'nestjs',
|
|
255
|
+
styling: 'tailwind',
|
|
256
|
+
orm: 'prisma',
|
|
257
|
+
db: 'postgres',
|
|
258
|
+
auth: 'next-auth',
|
|
259
|
+
state: 'zustand',
|
|
260
|
+
testing: 'vitest',
|
|
261
|
+
license: 'MIT',
|
|
262
|
+
packageManager: 'pnpm',
|
|
263
|
+
gitInit: true,
|
|
264
|
+
githubFiles: false,
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
const generator = new Generator(config, '/path/to/output/my-app');
|
|
268
|
+
await generator.run();
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
See [USAGE.md](USAGE.md) for advanced examples and option combinations.
|
|
272
|
+
|
|
273
|
+
## Requirements
|
|
274
|
+
|
|
275
|
+
- **Node.js** >= 18
|
|
276
|
+
- **pnpm** >= 9 (or npm/yarn/bun)
|
|
277
|
+
- **Git** (optional, for `--git` flag)
|
|
278
|
+
|
|
279
|
+
## Contributing
|
|
280
|
+
|
|
281
|
+
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
282
|
+
|
|
283
|
+
1. Fork the repository
|
|
284
|
+
2. Create a feature branch
|
|
285
|
+
3. Run tests: `npm test`
|
|
286
|
+
4. Submit a pull request
|
|
287
|
+
|
|
288
|
+
## License
|
|
289
|
+
|
|
290
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
291
|
+
|
|
292
|
+
## Author
|
|
293
|
+
|
|
294
|
+
**MSI Shamim**
|
|
295
|
+
|
|
296
|
+
- GitHub: [@msi-shamim](https://github.com/msi-shamim)
|
|
297
|
+
- Email: im.msishamim@gmail.com
|
package/bin/cli.js
ADDED
package/dist/cli.d.ts
ADDED