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.
Files changed (2) hide show
  1. package/README.md +403 -96
  2. 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
- ## What It Generates
9
+ ---
10
10
 
11
- - Root npm workspace with `frontend` and `backend` packages.
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
- ## CLI Architecture
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
- src/
23
- cli.js # Commander entrypoint and bin target
24
- commands/
25
- create.js # Main orchestration and success/error handling
26
- generators/
27
- root.js # Root workspace, README, .gitignore
28
- frontend.js # Official frontend scaffolding + StackFlow overlay
29
- backend.js # Express/MongoDB API templates
30
- utils/
31
- prompts.js # Inquirer setup questions
32
- names.js # Project naming helpers
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
- ## Workflow
154
+ ---
155
+
156
+ # Backend API Architecture
157
+
158
+ StackFlow uses a scalable modular API architecture.
37
159
 
38
- 1. Print a branded CLI banner.
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
- ## Implementation Order
162
+ Example:
52
163
 
53
- 1. CLI entrypoint and prompts.
54
- 2. Root workspace generator.
55
- 3. Official frontend generator integration.
56
- 4. Backend API generator.
57
- 5. Frontend auth/dashboard overlay.
58
- 6. Dependency persistence and install strategy.
59
- 7. Smoke tests and generated-app build tests.
60
- 8. npm packaging metadata.
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
- ## Template Strategy
231
+ ---
63
232
 
64
- The current implementation keeps templates close to their generators so the package stays compact. As the project grows, move each template into a dedicated folder:
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/templates/
68
- frontend/
69
- react/
70
- next/
71
- backend/
72
- base/
73
- optional/
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
- Use placeholder replacement for stable values such as project name, database name, and enabled features. Keep feature generators modular so future stacks like Docker, Prisma, PostgreSQL, Redis, BullMQ, SaaS starters, AI starters, and React Native can be added without rewriting the base flow.
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
- ## Dependency Strategy
322
+ ---
79
323
 
80
- - Generated `package.json` files use `latest` for app dependencies so npm resolves current stable versions at generation time.
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
- ## Auth Strategy
326
+ Generated authentication system includes:
86
327
 
87
- - Backend creates users with hashed passwords via bcryptjs.
88
- - Login/register return JWT and set an HTTP-only cookie.
89
- - Protected API routes use cookie or bearer token auth.
90
- - Frontend stores the token for Authorization headers and redirects unauthenticated users away from protected pages.
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
- ## CRUD Strategy
336
+ ---
93
337
 
94
- - Backend includes a `Task` model scoped to the authenticated user.
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
- ## Local Testing
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
- node ./src/cli.js demo-stackflow --yes --skip-install
103
- cd demo-stackflow
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
- For a full interactive test:
423
+ ---
424
+
425
+ # Publishing
110
426
 
111
427
  ```bash
112
- node ./src/cli.js
428
+ npm publish --access public
113
429
  ```
114
430
 
115
- ## Publishing
431
+ ---
116
432
 
117
- 1. Confirm `package.json` name is available on npm.
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@latest
436
+ npx create-stackflow
125
437
  ```
126
438
 
127
- ## Naming Conventions
439
+ ---
440
+
441
+ # License
442
+
443
+ MIT
128
444
 
129
- - CLI package: `create-stackflow`.
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
- ## Best Practices
447
+ # Author
136
448
 
137
- - Prefer official framework generators for baseline correctness.
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-stackflow",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Interactive CLI for generating modern full-stack MERN applications.",
5
5
  "type": "module",
6
6
  "bin": {