create-stackit-app 0.0.0-stage → 0.1.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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +110 -2
  3. package/dist/stackit.js +19763 -0
  4. package/package.json +40 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rahul Sain
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 CHANGED
@@ -1,3 +1,111 @@
1
- # Temporary Holding Version
1
+ # stackit ⚡
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Opinionated full-stack project scaffolder. Like `create-next-app`, but you pick the
4
+ whole stack — **MERN, PERN, React + Hono + Postgres, Go + Fiber** — and get a
5
+ best-practice monorepo (Vite + React frontend, layered API backend, Docker for the DB).
6
+
7
+ ```bash
8
+ bun run src/index.ts create my-app
9
+ # or non-interactive:
10
+ bun run src/index.ts create my-app --stack mern --language typescript --runtime bun --pm bun -y
11
+ ```
12
+
13
+ ## Requirements
14
+
15
+ - [Bun](https://bun.sh) >= 1.2 (to run the CLI itself)
16
+ - Per stack, the CLI checks your machine and fails fast with a helpful hint:
17
+ - `mern` / `pern` / `hono-pg` → Node >= 20 and/or Bun >= 1.2
18
+ - `go-fiber` → Go >= 1.24 (+ Node >= 20 for the Vite frontend)
19
+
20
+ ## Running the CLI (run / develop)
21
+
22
+ ```bash
23
+ bun install # install CLI deps (first time only)
24
+ bun run src/index.ts --help # CLI help
25
+
26
+ # interactive scaffold
27
+ bun run src/index.ts create my-app
28
+
29
+ # example: MERN + Bun + TypeScript, no prompts
30
+ bun run src/index.ts create my-app --stack mern --language typescript --runtime bun --pm bun -y
31
+
32
+ # example: PERN + Node + JavaScript, skip install + git
33
+ bun run src/index.ts create shop-api --stack pern --language javascript --runtime node --pm npm -y --no-install --no-git
34
+ ```
35
+
36
+ ### `create` options
37
+
38
+ | Flag | Values | Default |
39
+ | ---- | ------ | ------- |
40
+ | `[project-name]` | `my-app` (lowercase, `-_`) | prompt |
41
+ | `--stack` | `mern` \| `pern` \| `hono-pg` \| `go-fiber` | prompt (`mern` with `-y`) |
42
+ | `--language` | `typescript` \| `javascript` (`go-fiber` → `go` auto) | prompt (`typescript` with `-y`) |
43
+ | `--runtime` | `node` \| `bun` (`go-fiber` → `go` auto) | prompt (stack default with `-y`) |
44
+ | `--pm` | `npm` \| `pnpm` \| `yarn` \| `bun` | prompt (`bun` if runtime is bun, else `npm`) |
45
+ | `-y, --yes` | skip all prompts | off |
46
+ | `--no-install` | skip dependency install | install |
47
+ | `--no-git` | skip `git init` | init |
48
+
49
+ ## Generated project
50
+
51
+ ```bash
52
+ cd my-app
53
+ cp .env.example server/.env # fill in DB URL etc.
54
+ docker compose up -d # starts MongoDB / PostgreSQL
55
+ bun run dev # runs client + server (or npm/pnpm/yarn run dev)
56
+ ```
57
+
58
+ | Service | URL |
59
+ | ------- | --- |
60
+ | Frontend | http://localhost:5173 |
61
+ | API | http://localhost:5000 |
62
+ | Health | http://localhost:5000/api/health |
63
+
64
+ ### Layout (JS stacks)
65
+
66
+ ```
67
+ my-app/
68
+ ├── client/ # Vite + React (proxies /api → :5000)
69
+ │ └── src/{App,main,lib/api}
70
+ ├── server/ # Express / Hono API
71
+ │ └── src/
72
+ │ ├── index.* # entrypoint (env → connect → listen)
73
+ │ ├── app.* # app factory (middleware + routes)
74
+ │ ├── config/ # env, db connection
75
+ │ ├── routes/ # health, users
76
+ │ ├── controllers/ # handlers (express) / routes carry logic (hono)
77
+ │ ├── models/ # mongoose schema / SQL DDL
78
+ │ ├── middlewares/ # errorHandler, notFound, zod validation
79
+ │ └── utils/ # asyncHandler, ApiError
80
+ ├── docker-compose.yml
81
+ └── .env.example
82
+ ```
83
+
84
+ ### Layout (go-fiber)
85
+
86
+ ```
87
+ my-app/
88
+ ├── client/ # same Vite + React frontend
89
+ └── server/ # Go + Fiber
90
+ ├── cmd/api/main.go
91
+ └── internal/{config,db,handlers,middleware,models,routes}
92
+ ```
93
+
94
+ `DATABASE_URL` unset → API runs with an in-memory store (demo mode);
95
+ set it (docker compose gives you Postgres) → real persistence via `pgx`.
96
+
97
+ ## Scripts (this repo)
98
+
99
+ ```bash
100
+ bun install # deps
101
+ bun run src/index.ts --help
102
+ bun test # 13 tests: semver, registry, scaffold file-maps
103
+ bunx tsc --noEmit # typecheck
104
+ bun run build # bun build → dist/stackit
105
+ ```
106
+
107
+ ## Tech
108
+
109
+ commander (CLI) · @clack/prompts (interactive UI) · zod (validation) ·
110
+ fs-extra (file writes) · yocto-spinner + picocolors (output). Templates are
111
+ plain TypeScript functions — no template engine, no network at scaffold time.