create-stackflow 1.0.0 → 1.0.1
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 +403 -96
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,142 +1,449 @@
|
|
|
1
1
|
# create-stackflow
|
|
2
2
|
|
|
3
|
-
Professional interactive npm CLI for generating modern full-stack MERN applications.
|
|
3
|
+
Professional interactive npm CLI for generating modern full-stack MERN and modern web applications.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npx create-stackflow
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
---
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- React/Vite or Next.js frontend using the official generator.
|
|
13
|
-
- JavaScript or TypeScript project files.
|
|
14
|
-
- Tailwind CSS, shadcn-style component folders, dark mode, toast notifications, loading states.
|
|
15
|
-
- Auth screens, protected dashboard route, Axios service layer, and CRUD task UI.
|
|
16
|
-
- Express/MongoDB backend with JWT auth, bcryptjs, cookies, CORS, helmet, rate limiting, dotenv, Mongoose, and CRUD APIs.
|
|
17
|
-
- Optional Swagger, Socket.IO, Winston, Morgan, Cloudinary, and multer upload structure.
|
|
11
|
+
# Overview
|
|
18
12
|
|
|
19
|
-
|
|
13
|
+
`create-stackflow` is a modern developer-focused CLI tool that automatically generates scalable full-stack applications with production-ready architecture.
|
|
14
|
+
|
|
15
|
+
The goal of StackFlow is to reduce repetitive setup time and instantly generate:
|
|
16
|
+
|
|
17
|
+
- Frontend
|
|
18
|
+
- Backend
|
|
19
|
+
- Authentication
|
|
20
|
+
- CRUD modules
|
|
21
|
+
- Dashboard UI
|
|
22
|
+
- API setup
|
|
23
|
+
- Database connection
|
|
24
|
+
- Protected routes
|
|
25
|
+
- Upload system
|
|
26
|
+
- Validation
|
|
27
|
+
- Modern folder structure
|
|
28
|
+
|
|
29
|
+
Everything is generated automatically with interactive prompts.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
# Perfect For
|
|
34
|
+
|
|
35
|
+
`create-stackflow` is ideal for:
|
|
36
|
+
|
|
37
|
+
- MERN Stack developers
|
|
38
|
+
- Full-stack developers
|
|
39
|
+
- SaaS starters
|
|
40
|
+
- Admin dashboard projects
|
|
41
|
+
- Startup MVPs
|
|
42
|
+
- CRUD applications
|
|
43
|
+
- Authentication systems
|
|
44
|
+
- Portfolio projects
|
|
45
|
+
- Client projects
|
|
46
|
+
- Rapid prototyping
|
|
47
|
+
- Agency development workflows
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
# What StackFlow Generates
|
|
52
|
+
|
|
53
|
+
## Frontend
|
|
54
|
+
|
|
55
|
+
Supports:
|
|
56
|
+
|
|
57
|
+
- React + Vite
|
|
58
|
+
- Next.js
|
|
59
|
+
|
|
60
|
+
Features:
|
|
61
|
+
|
|
62
|
+
- JavaScript or TypeScript
|
|
63
|
+
- Tailwind CSS
|
|
64
|
+
- Shadcn UI
|
|
65
|
+
- React Router DOM
|
|
66
|
+
- Zustand / Redux Toolkit / Context API
|
|
67
|
+
- React Hook Form
|
|
68
|
+
- Zod / Yup validation
|
|
69
|
+
- Axios API layer
|
|
70
|
+
- TanStack Query
|
|
71
|
+
- Protected routes
|
|
72
|
+
- Dark mode
|
|
73
|
+
- Toast notifications
|
|
74
|
+
- Framer Motion
|
|
75
|
+
- Charts
|
|
76
|
+
- Drag & drop uploads
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Backend
|
|
81
|
+
|
|
82
|
+
Supports:
|
|
83
|
+
|
|
84
|
+
- Express.js
|
|
85
|
+
- Fastify
|
|
86
|
+
- NestJS
|
|
87
|
+
|
|
88
|
+
Features:
|
|
89
|
+
|
|
90
|
+
- MongoDB
|
|
91
|
+
- PostgreSQL
|
|
92
|
+
- MySQL
|
|
93
|
+
- SQLite
|
|
94
|
+
- Mongoose / Prisma / Sequelize / Drizzle / TypeORM
|
|
95
|
+
- JWT Authentication
|
|
96
|
+
- bcryptjs / argon2
|
|
97
|
+
- multer
|
|
98
|
+
- Cloudinary
|
|
99
|
+
- Cloudflare R2
|
|
100
|
+
- AWS S3
|
|
101
|
+
- UploadThing
|
|
102
|
+
- Swagger Docs
|
|
103
|
+
- Socket.IO
|
|
104
|
+
- Winston / Morgan / Pino logging
|
|
105
|
+
- Nodemailer
|
|
106
|
+
- AWS SES
|
|
107
|
+
- SendGrid
|
|
108
|
+
- Mailgun
|
|
109
|
+
- Postmark
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
# Generated Features
|
|
114
|
+
|
|
115
|
+
StackFlow automatically generates:
|
|
116
|
+
|
|
117
|
+
- Login page
|
|
118
|
+
- Register page
|
|
119
|
+
- Forgot password
|
|
120
|
+
- Reset password
|
|
121
|
+
- Role-based authentication
|
|
122
|
+
- Refresh token support
|
|
123
|
+
- Dashboard UI
|
|
124
|
+
- CRUD APIs
|
|
125
|
+
- CRUD frontend pages
|
|
126
|
+
- API service layer
|
|
127
|
+
- Validation structure
|
|
128
|
+
- Auth middleware
|
|
129
|
+
- Upload structure
|
|
130
|
+
- Environment variables
|
|
131
|
+
- MongoDB connection
|
|
132
|
+
- Loading states
|
|
133
|
+
- Toast notifications
|
|
134
|
+
- Reusable component architecture
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
# Generated Project Structure
|
|
20
139
|
|
|
21
140
|
```text
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
template.js # Small template writer utilities
|
|
141
|
+
my-app/
|
|
142
|
+
│
|
|
143
|
+
├── frontend/
|
|
144
|
+
│
|
|
145
|
+
├── backend/
|
|
146
|
+
│
|
|
147
|
+
├── package.json
|
|
148
|
+
│
|
|
149
|
+
├── .gitignore
|
|
150
|
+
│
|
|
151
|
+
└── README.md
|
|
34
152
|
```
|
|
35
153
|
|
|
36
|
-
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
# Backend API Architecture
|
|
157
|
+
|
|
158
|
+
StackFlow uses a scalable modular API architecture.
|
|
37
159
|
|
|
38
|
-
|
|
39
|
-
2. Ask setup questions with defaults for project, frontend folder, backend folder, framework, language, UI, state, validation, auth, and optional backend features.
|
|
40
|
-
3. Validate the project name with npm naming rules.
|
|
41
|
-
4. Create the root workspace package.
|
|
42
|
-
5. Run the official frontend generator:
|
|
43
|
-
- Vite for React.
|
|
44
|
-
- `create-next-app` for Next.js.
|
|
45
|
-
6. Persist frontend dependencies using `latest`, then install them unless `--skip-install` is passed.
|
|
46
|
-
7. Overlay frontend auth, CRUD, API services, reusable components, protected routes, dark mode, and dashboard UI.
|
|
47
|
-
8. Generate backend structure, env files, models, controllers, routes, middleware, services, and optional integrations.
|
|
48
|
-
9. Install backend and root dependencies unless skipped.
|
|
49
|
-
10. Show clean next-step instructions.
|
|
160
|
+
## Main Route File
|
|
50
161
|
|
|
51
|
-
|
|
162
|
+
Example:
|
|
52
163
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
164
|
+
```js
|
|
165
|
+
router.use("/auth", authRoutes);
|
|
166
|
+
|
|
167
|
+
router.use("/users", userRoutes);
|
|
168
|
+
|
|
169
|
+
router.use("/products", productRoutes);
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
The main route file combines all module routes.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Separate Module Routes
|
|
177
|
+
|
|
178
|
+
Each module contains its own dedicated route file.
|
|
179
|
+
|
|
180
|
+
Example:
|
|
181
|
+
|
|
182
|
+
```js
|
|
183
|
+
router.get("/");
|
|
184
|
+
router.post("/");
|
|
185
|
+
router.put("/:id");
|
|
186
|
+
router.delete("/:id");
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
This keeps the codebase:
|
|
190
|
+
- clean
|
|
191
|
+
- scalable
|
|
192
|
+
- maintainable
|
|
193
|
+
- enterprise-ready
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
# Interactive Setup Questions
|
|
198
|
+
|
|
199
|
+
StackFlow asks setup questions like:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
? Frontend framework?
|
|
203
|
+
❯ React
|
|
204
|
+
Next.js
|
|
205
|
+
|
|
206
|
+
? Language?
|
|
207
|
+
❯ TypeScript
|
|
208
|
+
JavaScript
|
|
209
|
+
|
|
210
|
+
? Database?
|
|
211
|
+
❯ MongoDB
|
|
212
|
+
PostgreSQL
|
|
213
|
+
|
|
214
|
+
? Authentication strategy?
|
|
215
|
+
❯ JWT
|
|
216
|
+
Session Auth
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Everything is configured automatically based on user selections.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
# Local Development Workflow
|
|
224
|
+
|
|
225
|
+
## Create Project
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
npx create-stackflow
|
|
229
|
+
```
|
|
61
230
|
|
|
62
|
-
|
|
231
|
+
---
|
|
63
232
|
|
|
64
|
-
|
|
233
|
+
## Start Project
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
cd my-app
|
|
237
|
+
|
|
238
|
+
npm run dev
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
# Local MongoDB
|
|
244
|
+
|
|
245
|
+
Default MongoDB connection:
|
|
246
|
+
|
|
247
|
+
```env
|
|
248
|
+
MONGO_URI=mongodb://127.0.0.1:27017/myapp
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
# Root Development Scripts
|
|
254
|
+
|
|
255
|
+
StackFlow automatically configures:
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
npm run dev
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
This starts:
|
|
262
|
+
- frontend
|
|
263
|
+
- backend
|
|
264
|
+
|
|
265
|
+
simultaneously using `concurrently`.
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
# CLI Architecture
|
|
65
270
|
|
|
66
271
|
```text
|
|
67
|
-
src/
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
272
|
+
src/
|
|
273
|
+
│
|
|
274
|
+
├── cli.js
|
|
275
|
+
│
|
|
276
|
+
├── commands/
|
|
277
|
+
│
|
|
278
|
+
├── generators/
|
|
279
|
+
│
|
|
280
|
+
├── templates/
|
|
281
|
+
│
|
|
282
|
+
├── prompts/
|
|
283
|
+
│
|
|
284
|
+
├── utils/
|
|
285
|
+
│
|
|
286
|
+
└── constants/
|
|
74
287
|
```
|
|
75
288
|
|
|
76
|
-
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
# StackFlow Workflow
|
|
292
|
+
|
|
293
|
+
1. Ask setup questions
|
|
294
|
+
2. Validate project name
|
|
295
|
+
3. Create frontend
|
|
296
|
+
4. Create backend
|
|
297
|
+
5. Install dependencies
|
|
298
|
+
6. Configure Tailwind
|
|
299
|
+
7. Configure Shadcn
|
|
300
|
+
8. Configure backend
|
|
301
|
+
9. Configure database
|
|
302
|
+
10. Generate auth
|
|
303
|
+
11. Generate CRUD
|
|
304
|
+
12. Configure routes
|
|
305
|
+
13. Generate dashboard
|
|
306
|
+
14. Create env files
|
|
307
|
+
15. Start project automatically
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
# Dependency Strategy
|
|
312
|
+
|
|
313
|
+
StackFlow uses latest stable versions automatically.
|
|
314
|
+
|
|
315
|
+
Examples:
|
|
316
|
+
|
|
317
|
+
- `vite@latest`
|
|
318
|
+
- `create-next-app@latest`
|
|
319
|
+
|
|
320
|
+
Dependencies are dynamically installed based on selected features.
|
|
77
321
|
|
|
78
|
-
|
|
322
|
+
---
|
|
79
323
|
|
|
80
|
-
|
|
81
|
-
- Official generators are invoked with `vite@latest` and `create-next-app@latest`.
|
|
82
|
-
- `--skip-install` still writes dependency declarations, so users can run `npm install` later.
|
|
83
|
-
- Root `npm run dev` uses npm workspaces and `concurrently`.
|
|
324
|
+
# Auth Strategy
|
|
84
325
|
|
|
85
|
-
|
|
326
|
+
Generated authentication system includes:
|
|
86
327
|
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
- Protected
|
|
90
|
-
-
|
|
328
|
+
- JWT authentication
|
|
329
|
+
- Password hashing
|
|
330
|
+
- Protected APIs
|
|
331
|
+
- Protected frontend routes
|
|
332
|
+
- HTTP-only cookies
|
|
333
|
+
- Refresh tokens
|
|
334
|
+
- Role-based access
|
|
91
335
|
|
|
92
|
-
|
|
336
|
+
---
|
|
93
337
|
|
|
94
|
-
|
|
95
|
-
- API exposes list, create, update, and delete routes.
|
|
96
|
-
- Frontend dashboard consumes the API through a service layer and shows loading, empty, create, and delete states.
|
|
338
|
+
# CRUD Strategy
|
|
97
339
|
|
|
98
|
-
|
|
340
|
+
StackFlow automatically generates:
|
|
341
|
+
|
|
342
|
+
## Backend
|
|
343
|
+
|
|
344
|
+
- Models
|
|
345
|
+
- Controllers
|
|
346
|
+
- Routes
|
|
347
|
+
- Middleware
|
|
348
|
+
- Validation
|
|
349
|
+
|
|
350
|
+
## Frontend
|
|
351
|
+
|
|
352
|
+
- Forms
|
|
353
|
+
- Tables
|
|
354
|
+
- Dashboard pages
|
|
355
|
+
- API services
|
|
356
|
+
- Loading states
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
# Why StackFlow?
|
|
361
|
+
|
|
362
|
+
StackFlow helps developers:
|
|
363
|
+
|
|
364
|
+
- save setup time
|
|
365
|
+
- avoid repetitive boilerplate
|
|
366
|
+
- follow scalable architecture
|
|
367
|
+
- build production-ready projects faster
|
|
368
|
+
- maintain consistent code structure
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
# Recommended Stack
|
|
373
|
+
|
|
374
|
+
## Frontend
|
|
375
|
+
|
|
376
|
+
- React / Next.js
|
|
377
|
+
- Tailwind CSS
|
|
378
|
+
- Shadcn UI
|
|
379
|
+
- Zustand
|
|
380
|
+
- Axios
|
|
381
|
+
- React Hook Form
|
|
382
|
+
- Zod
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## Backend
|
|
387
|
+
|
|
388
|
+
- Express.js
|
|
389
|
+
- MongoDB
|
|
390
|
+
- Mongoose
|
|
391
|
+
- JWT
|
|
392
|
+
- bcryptjs
|
|
393
|
+
- multer
|
|
394
|
+
- Cloudinary
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
# Future Roadmap
|
|
399
|
+
|
|
400
|
+
Planned future support:
|
|
401
|
+
|
|
402
|
+
- SaaS starters
|
|
403
|
+
- AI application starters
|
|
404
|
+
- React Native
|
|
405
|
+
- Prisma
|
|
406
|
+
- PostgreSQL
|
|
407
|
+
- Redis
|
|
408
|
+
- BullMQ
|
|
409
|
+
- Docker
|
|
410
|
+
- Admin generators
|
|
411
|
+
- Visual generators
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
# Local Testing
|
|
99
416
|
|
|
100
417
|
```bash
|
|
101
418
|
npm run smoke
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
npm install
|
|
105
|
-
npm run build --workspace frontend
|
|
106
|
-
npm run build --workspace backend
|
|
419
|
+
|
|
420
|
+
node ./src/cli.js
|
|
107
421
|
```
|
|
108
422
|
|
|
109
|
-
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
# Publishing
|
|
110
426
|
|
|
111
427
|
```bash
|
|
112
|
-
|
|
428
|
+
npm publish --access public
|
|
113
429
|
```
|
|
114
430
|
|
|
115
|
-
|
|
431
|
+
---
|
|
116
432
|
|
|
117
|
-
|
|
118
|
-
2. Run `npm pack --dry-run`.
|
|
119
|
-
3. Log in with `npm login`.
|
|
120
|
-
4. Publish with `npm publish --access public`.
|
|
121
|
-
5. Test from a separate folder:
|
|
433
|
+
# Install Globally
|
|
122
434
|
|
|
123
435
|
```bash
|
|
124
|
-
npx create-stackflow
|
|
436
|
+
npx create-stackflow
|
|
125
437
|
```
|
|
126
438
|
|
|
127
|
-
|
|
439
|
+
---
|
|
440
|
+
|
|
441
|
+
# License
|
|
442
|
+
|
|
443
|
+
MIT
|
|
128
444
|
|
|
129
|
-
|
|
130
|
-
- Generated root package: kebab-case project name.
|
|
131
|
-
- Folders: default `frontend` and `backend`, user configurable.
|
|
132
|
-
- Backend files: `*.controller`, `*.routes`, `*.middleware`, `*.service`, `*.model`.
|
|
133
|
-
- Frontend files: feature-first folders under `features`, shared primitives under `components/ui`, API utilities under `lib`.
|
|
445
|
+
---
|
|
134
446
|
|
|
135
|
-
|
|
447
|
+
# Author
|
|
136
448
|
|
|
137
|
-
|
|
138
|
-
- Keep generated code understandable for beginners.
|
|
139
|
-
- Keep feature generation modular and composable.
|
|
140
|
-
- Store env defaults locally but never commit real secrets in generated apps.
|
|
141
|
-
- Use npm workspaces for simple root-level development.
|
|
142
|
-
- Keep optional integrations isolated so they can be removed or expanded cleanly.
|
|
449
|
+
StackFlow CLI
|