zero-config-cli 1.0.1 → 1.0.4

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 +358 -0
  2. package/package.json +4 -2
package/README.md ADDED
@@ -0,0 +1,358 @@
1
+ <div align="center">
2
+
3
+ # zero-config-cli ⚡
4
+
5
+ ### **Generate production-ready full-stack projects from your terminal — zero config required.**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/zero-config-cli?style=for-the-badge&logo=npm&color=cb3837)](https://www.npmjs.com/package/zero-config-cli)
8
+ [![npm downloads](https://img.shields.io/npm/dt/zero-config-cli?style=for-the-badge&logo=npm&color=37b24d)](https://www.npmjs.com/package/zero-config-cli)
9
+ [![license](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge)](LICENSE)
10
+ [![node](https://img.shields.io/badge/node-%3E%3D18-339933?style=for-the-badge&logo=node.js)](package.json)
11
+ [![website](https://img.shields.io/badge/website-zero--config.vercel.app-2ec4b6?style=for-the-badge&logo=vercel)](https://zero-config.vercel.app)
12
+
13
+ ```
14
+ npx zero-config-cli my-project
15
+ ```
16
+
17
+ 🌐 **Live site:** [zero-config.vercel.app](https://zero-config.vercel.app)
18
+
19
+ </div>
20
+
21
+ ---
22
+
23
+ ## 🎯 The Problem
24
+
25
+ Every time you start a new project, you spend **45–90 minutes** doing the same thing:
26
+
27
+ - Scaffolding folders and config files
28
+ - Setting up TypeScript, ESLint, Prettier
29
+ - Wiring up authentication (JWT, bcrypt, token refresh)
30
+ - Configuring Prisma ORM with database connection
31
+ - Writing CRUD endpoints with owner verification
32
+ - Setting up test runners and writing initial tests
33
+ - Debugging import paths, CORS, and environment variables
34
+
35
+ **That's hours of your life you'll never get back.** And you do it every single time.
36
+
37
+ ---
38
+
39
+ ## 💡 The Solution
40
+
41
+ **Zero-Config CLI** generates a fully configured, production-ready full-stack project in **under 30 seconds**. Pick your stack, and start coding real features on day one — not configuring tools.
42
+
43
+ | Step | What happens |
44
+ | ---- | --------------------------------------------------------------- |
45
+ | 1 | Pick a frontend (React · Angular · Vue.js · Next.js) |
46
+ | 2 | Name your frontend folder (or use the default) |
47
+ | 3 | Pick a backend (Express · NestJS · Fastify) |
48
+ | 4 | Name your backend folder (or use the default) |
49
+ | 5 | Pick a database (PostgreSQL · MySQL · SQLite · etc.) |
50
+ | 6 | Done. You have a full-stack project with auth, CRUD, and tests. |
51
+
52
+ ### What you get **instantly**:
53
+
54
+ ✅ JWT authentication (access + refresh tokens with rotation)
55
+ ✅ Full CRUD operations with ownership verification
56
+ ✅ Prisma ORM with your chosen database provider pre-configured
57
+ ✅ bcrypt password hashing (10 rounds) with strong validation
58
+ ✅ Pre-written tests (auth flow, CRUD, edge cases, auth guards)
59
+ ✅ TypeScript, ESLint, environment variables, CORS — all wired up
60
+ ✅ Zero configuration files to touch before you start coding
61
+
62
+ ---
63
+
64
+ ## 🚀 Quick Start
65
+
66
+ ```bash
67
+ # Interactive mode — guided prompts
68
+ npx zero-config-cli my-project
69
+
70
+ # Non-interactive mode — for scripts and CI
71
+ npx zero-config-cli my-project -f react -b express -d postgresql
72
+ ```
73
+
74
+ After generation, the CLI can optionally run `npm install` for you — choose **both**, **backend only**, **frontend only**, or **skip**.
75
+
76
+ ---
77
+
78
+ ## 📋 Interactive Flow
79
+
80
+ ```
81
+ $ npx zero-config-cli my-project
82
+
83
+ ╭──────────────────────────────────────╮
84
+ │ Zero-Config Starter Generator │
85
+ ╰──────────────────────────────────────╯
86
+
87
+ ? Select a frontend framework:
88
+ ⚛️ React v19 Port 5173 · Auth context, Protected routes
89
+ 🅰️ Angular v21 Port 4200 · Auth guards, Signals
90
+ 💚 Vue.js v3 Port 5173 · Pinia store, Composition API
91
+ ▲ Next.js v16 Port 3000 · SQLite auth, Server Actions
92
+
93
+ ? Enter folder name for frontend: (react)
94
+ ❯ react
95
+
96
+ ? Select a backend framework:
97
+ 🚀 Express v4.18 Port 5000 · Minimalist, unopinionated
98
+ 🐱 NestJS v11 Port 5000 · Modular architecture, Passport.js
99
+ ⚡ Fastify v5 Port 5000 · High-performance, low overhead
100
+
101
+ ? Enter folder name for backend: (express)
102
+ ❯ express
103
+
104
+ ? Select a database:
105
+ 🐘 PostgreSQL Relational SQL database
106
+ 🐬 MySQL Popular open-source RDBMS
107
+ 📁 SQLite Embedded file-based database
108
+ ...
109
+
110
+ [⠋] Generating your project...
111
+ [✔] Project generated successfully!
112
+
113
+ ┌─────────────────────────────────────────────┐
114
+ │ 📁 my-project/ │
115
+ │ react/ │
116
+ │ express/ │
117
+ │ 🗄️ Database: PostgreSQL │
118
+ └─────────────────────────────────────────────┘
119
+
120
+ ? Install dependencies:
121
+ ❯ Yes (both frontend & backend)
122
+ Backend only
123
+ Frontend only
124
+ Skip
125
+
126
+ [⠋] Installing dependencies...
127
+ [✔] Dependencies installed in Frontend & Backend
128
+
129
+ ✨ Your stack is ready!
130
+
131
+ ⚛️ Frontend: cd my-project/react && npm run dev → http://localhost:5173
132
+ 🚀 Backend: cd my-project/express && npm run dev → http://localhost:5000
133
+ 🐘 Database: PostgreSQL
134
+
135
+ Happy coding! 🚀
136
+ ```
137
+
138
+ ---
139
+
140
+ ## 🧩 Available Templates
141
+
142
+ ### Frontend
143
+
144
+ | Icon | Template | Stack | Start command | Port |
145
+ | ---- | ----------- | ------------------------------------------------------ | --------------- | ---- |
146
+ | ⚛️ | **React** | React 19 + Vite 7.2 + TypeScript 5.9 + Tailwind CSS | `npm run dev` | 5173 |
147
+ | 🅰️ | **Angular** | Angular 21 + SSR + Signals + Tailwind CSS 4.x | `npm run start` | 4200 |
148
+ | 💚 | **Vue.js** | Vue 3.5 + Pinia 3.0 + Vite 7.3 + Oxlint + Tailwind CSS | `npm run dev` | 5173 |
149
+ | ▲ | **Next.js** | Next.js 16 + App Router + SQLite + Tailwind CSS 4 | `npm run dev` | 3000 |
150
+
151
+ ### Backend
152
+
153
+ | Icon | Template | Stack | Start command | Port |
154
+ | ---- | ----------- | ----------------------------------------------------------- | ------------------- | ---- |
155
+ | 🚀 | **Express** | Express 4.18 + Prisma 6 + JWT + bcrypt + Jest | `npm run dev` | 5000 |
156
+ | 🐱 | **NestJS** | NestJS 11 + Passport.js + Prisma 6 + class-validator + Jest | `npm run start:dev` | 5000 |
157
+ | ⚡ | **Fastify** | Fastify 5 + @fastify/jwt + Prisma 6 + Swagger + Vitest | `npm run dev` | 5000 |
158
+
159
+ ### Databases
160
+
161
+ | Icon | Database | Prisma Provider |
162
+ | ---- | ----------- | --------------- |
163
+ | 🐘 | PostgreSQL | `postgresql` |
164
+ | 🐬 | MySQL | `mysql` |
165
+ | 🪶 | MariaDB | `mysql` |
166
+ | 🟦 | SQL Server | `sqlserver` |
167
+ | 📁 | SQLite | `sqlite` |
168
+ | 🪳 | CockroachDB | `cockroachdb` |
169
+ | 🍃 | MongoDB | `mongodb` |
170
+
171
+ ---
172
+
173
+ ## ⚙️ CLI Options
174
+
175
+ ### Command
176
+
177
+ ```
178
+ npx zero-config-cli init [outputDir] [options]
179
+ ```
180
+
181
+ `init` is the default command, so you can omit it:
182
+
183
+ ```
184
+ npx zero-config-cli [outputDir] [options]
185
+ ```
186
+
187
+ ### Flags
188
+
189
+ | Flag | Description |
190
+ | ----------------------------- | ------------------------------------------------------------------------------ |
191
+ | `-f, --frontend <name>` | Frontend template (react, angular, vuejs, nextjs) |
192
+ | `-b, --backend <name>` | Backend template (express, nestjs, fastify) |
193
+ | `-d, --database <name>` | Database (postgresql, mysql, mariadb, sqlserver, sqlite, cockroachdb, mongodb) |
194
+ | `--frontend-folder <name>` | Custom folder name for frontend |
195
+ | `--backend-folder <name>` | Custom folder name for backend |
196
+ | `-t, --templates-path <path>` | Local path or GitHub zip URL for templates |
197
+ | `--no-install` | Skip npm install step |
198
+ | `-h, --help` | Display help |
199
+ | `-V, --version` | Show version |
200
+
201
+ ### Examples
202
+
203
+ ```bash
204
+ # Interactive
205
+ npx zero-config-cli my-project
206
+
207
+ # Name your folders
208
+ npx zero-config-cli my-app --frontend-folder client --backend-folder server
209
+
210
+ # Non-interactive (CI-friendly)
211
+ npx zero-config-cli . -f nextjs -b fastify -d mongodb --no-install
212
+
213
+ # Use a local templates folder
214
+ npx zero-config-cli my-project -t ../zero-config-templates
215
+
216
+ # Use a GitHub zip directly
217
+ npx zero-config-cli my-project -t https://github.com/dhuruvandb/zero-config-templates/archive/main.zip
218
+ ```
219
+
220
+ ---
221
+
222
+ ## 🧠 Architecture
223
+
224
+ ```
225
+ ┌─────────────────────────────────────────────────────────┐
226
+ │ zero-config-cli │
227
+ ├─────────────────────────────────────────────────────────┤
228
+ │ │
229
+ │ src/index.ts ← Entry point (#!/usr/bin/env node) │
230
+ │ src/cli.ts ← Commander + @clack/prompts UI │
231
+ │ src/registry.ts ← Template metadata & DB mapping │
232
+ │ src/resolver.ts ← Auto-detect templates source │
233
+ │ src/copier.ts ← Recursive file copy engine │
234
+ │ src/downloader.ts ← GitHub zip fetch + unzipper │
235
+ │ src/prisma-swap.ts← Regex-based Prisma provider swap │
236
+ │ src/generator.ts ← Orchestrator (copy → swap → write) │
237
+ │ src/installer.ts ← npm install runner │
238
+ │ │
239
+ └─────────────────────────────────────────────────────────┘
240
+
241
+ ┌───────────────────┼───────────────────┐
242
+ ▼ ▼ ▼
243
+ ┌──────────────┐ ┌──────────────────┐ ┌──────────────┐
244
+ │ Templates │ │ Your Project │ │ npm Registry│
245
+ │ (local or │──▶ ./my-project/ │ │ (published) │
246
+ │ GitHub) │ │ ├─ frontend/ │ └──────────────┘
247
+ └──────────────┘ │ └─ backend/ │
248
+ └──────────────────┘
249
+ ```
250
+
251
+ ### Template Source Resolution
252
+
253
+ The CLI resolves templates in this priority order:
254
+
255
+ 1. **`--templates-path` flag** or `ZERO_CONFIG_TEMPLATES_PATH` env var
256
+ 2. **Auto-detected sibling** `zero-config-templates/` folder
257
+ 3. **GitHub fallback** — downloads from `github.com/dhuruvandb/zero-config-templates`
258
+
259
+ This means it works **offline** if you have the templates locally, or **online** via GitHub download.
260
+
261
+ ---
262
+
263
+ ## 📈 Impact & Time Saved
264
+
265
+ | Activity | Manual setup | With Zero-Config CLI | Time saved |
266
+ | ------------------------------------------- | ------------ | -------------------- | ------------------ |
267
+ | Scaffolding folders + configs | 10 min | 0 | **10 min** |
268
+ | TypeScript + ESLint setup | 15 min | 0 | **15 min** |
269
+ | JWT auth (register, login, refresh, logout) | 30 min | 0 | **30 min** |
270
+ | Prisma ORM + database connection | 10 min | 0 | **10 min** |
271
+ | CRUD endpoints with owner verification | 20 min | 0 | **20 min** |
272
+ | Test setup + writing initial tests | 15 min | 0 | **15 min** |
273
+ | CORS, env vars, security headers | 10 min | 0 | **10 min** |
274
+ | **Total per project** | **~110 min** | **~30 sec** | **~109 min saved** |
275
+
276
+ **That's nearly 2 hours saved per project.** If you start 10 projects a year, that's **18 hours** — almost a full working week — returned to building actual features.
277
+
278
+ ---
279
+
280
+ ## 💪 What Makes This Different
281
+
282
+ There are plenty of project generators out there. Here's why `zero-config-cli` stands out:
283
+
284
+ | Feature | Zero-Config CLI | `create-react-app` | `create-next-app` | `create-nx-workspace` |
285
+ | ----------------------------------------------------- | :-------------: | :----------------: | :---------------: | :-------------------: |
286
+ | **Full-stack** (frontend + backend) | ✅ | ❌ | ❌ | ❌ |
287
+ | **Database selection** (7 options) | ✅ | ❌ | ❌ | ❌ |
288
+ | **Multiple frontends** (React, Angular, Vue, Next.js) | ✅ | ❌ | ❌ | ❌ |
289
+ | **Multiple backends** (Express, NestJS, Fastify) | ✅ | ❌ | ❌ | ❌ |
290
+ | **JWT auth out of the box** | ✅ | ❌ | ❌ | ❌ |
291
+ | **Prisma ORM pre-configured** | ✅ | ❌ | ❌ | ❌ |
292
+ | **Pre-written tests** | ✅ | ❌ | ❌ | ❌ |
293
+ | **Custom folder names** | ✅ | ❌ | ❌ | ❌ |
294
+ | **Interactive prompts** | ✅ | ✅ | ✅ | ✅ |
295
+ | **Offline support** | ✅ | ❌ | ❌ | ❌ |
296
+ | **No cloud costs** | ✅ | ✅ | ✅ | ✅ |
297
+ | **Zero config to start coding** | ✅ | ❌ | ❌ | ❌ |
298
+
299
+ Most generators give you **one framework**. Zero-Config CLI gives you **any combination** of 4 frontends, 3 backends, and 7 databases — **28 distinct stack combinations** — all with auth, CRUD, and tests built in.
300
+
301
+ ---
302
+
303
+ ## 🗺️ The Zero-Config Ecosystem
304
+
305
+ This CLI is part of a larger ecosystem:
306
+
307
+ | Project | Description |
308
+ | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
309
+ | [zero-config](https://github.com/dhuruvandb/zero-config) | 🌐 **Web app** — Visual generator at [zero-config.vercel.app](https://zero-config.vercel.app/) |
310
+ | [zero-config-cli](https://github.com/dhuruvandb/zero-config-cli) | 💻 **You are here** — Terminal-based generator |
311
+ | [zero-config-templates](https://github.com/dhuruvandb/zero-config-templates) | 📦 **Boilerplate source** — All 7 templates with auth, CRUD, and tests |
312
+
313
+ ---
314
+
315
+ ## 🛠️ Development
316
+
317
+ ```bash
318
+ # Clone the repo
319
+ git clone https://github.com/dhuruvandb/zero-config-cli.git
320
+ cd zero-config-cli
321
+
322
+ # Install dependencies
323
+ npm install
324
+
325
+ # Run in development mode
326
+ npm run dev init ./test-project
327
+
328
+ # Run tests
329
+ npm test
330
+
331
+ # Build for production
332
+ npm run build
333
+ ```
334
+
335
+ ### Test Coverage
336
+
337
+ ```
338
+ ✓ __tests__/registry.test.ts (14 tests) — Template metadata validation
339
+ ✓ __tests__/prisma-swap.test.ts (11 tests) — Prisma provider regex swap
340
+
341
+ Test Files 2 passed (2)
342
+ Tests 25 passed (25)
343
+ ```
344
+
345
+ ---
346
+
347
+ ## 📄 License
348
+
349
+ MIT © [@dhuruvandb](https://github.com/dhuruvandb)
350
+
351
+ ---
352
+
353
+ <div align="center">
354
+
355
+ **Built with ❤️ to save you hours of boilerplate.**
356
+ ⭐ Star the repo if you find it useful!
357
+
358
+ </div>
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "zero-config-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "description": "Generate production-ready full-stack projects from the terminal — zero config required.",
5
5
  "type": "module",
6
- "bin": "dist/index.js",
6
+ "bin": {
7
+ "zero-config-cli": "dist/index.js"
8
+ },
7
9
  "exports": {
8
10
  ".": "./dist/index.js"
9
11
  },