create-rudder-app 0.0.19 → 0.0.20
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 +151 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,19 +1,47 @@
|
|
|
1
1
|
# create-rudder-app
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Spin up a production-ready [RudderJS](https://github.com/rudderjs/rudder) app in under 60 seconds** — with auth that works, a database wired, SSR views rendering, and optional AI / OAuth / real-time / cache / queue, all bootstrapped through Vite + Vike.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```bash
|
|
6
|
+
pnpm create rudder-app my-app
|
|
7
|
+
cd my-app
|
|
8
|
+
pnpm exec prisma generate && pnpm exec prisma db push
|
|
9
|
+
pnpm dev
|
|
10
|
+
# → http://localhost:3000 — welcome page + register/login working end-to-end
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Install
|
|
6
16
|
|
|
7
|
-
The installer
|
|
17
|
+
All four major package managers work. The installer detects which one you used and adapts every generated file, install command, and post-scaffold hint.
|
|
8
18
|
|
|
9
19
|
```bash
|
|
10
|
-
pnpm create rudder-app
|
|
11
|
-
npm create rudder-app@latest
|
|
12
|
-
yarn create rudder-app
|
|
13
|
-
bunx create-rudder-app
|
|
20
|
+
pnpm create rudder-app [name]
|
|
21
|
+
npm create rudder-app@latest [name]
|
|
22
|
+
yarn create rudder-app [name]
|
|
23
|
+
bunx create-rudder-app [name]
|
|
14
24
|
```
|
|
15
25
|
|
|
16
|
-
|
|
26
|
+
Skip `[name]` to be prompted for one.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## What you get out of the box
|
|
31
|
+
|
|
32
|
+
With the **default choices** (Prisma + SQLite + Auth + Cache + React + Tailwind + shadcn/ui), you get a working fullstack app you can register into, log into, and sign out of — without writing any code:
|
|
33
|
+
|
|
34
|
+
- **Welcome page at `/`** — controller-returned view, Tailwind + shadcn styled, with Log in / Register links or a signed-in user + Sign out button.
|
|
35
|
+
- **Auth flow that works** — `/login`, `/register`, `/forgot-password`, `/reset-password` pages vendored into `app/Views/Auth/` (so you can customize them freely) and wired to `POST /api/auth/sign-in/email` / `sign-up/email` / `sign-out` / `request-password-reset` / `reset-password` endpoints.
|
|
36
|
+
- **Database ready** — Prisma schema with a `User` + `PasswordResetToken` model, SQLite by default, a `User` ORM model.
|
|
37
|
+
- **Session-based auth** — cookie sessions via `@rudderjs/session`, `AuthMiddleware` applied globally, ghost-user-safe (see the [mental model guide](https://github.com/rudderjs/rudder/blob/main/docs/guide/mental-model.md)).
|
|
38
|
+
- **Rate limiting** — 10 req/min on auth endpoints out of the box.
|
|
39
|
+
- **Bootstrap you can read** — `bootstrap/app.ts` in 25 lines, `bootstrap/providers.ts` shows auto-discovery, `config/` has one file per concern.
|
|
40
|
+
- **Rudder CLI** — `pnpm rudder --help` lists framework commands; `routes/console.ts` shows you how to add your own.
|
|
41
|
+
|
|
42
|
+
If you tick **AI** you get a `/ai-chat` demo. If you tick **MCP**, `POST /mcp/echo`. If you tick **Passport**, a full OAuth 2 server at `/oauth/authorize` / `/oauth/token`. Everything is opt-in and pay-as-you-go.
|
|
43
|
+
|
|
44
|
+
---
|
|
17
45
|
|
|
18
46
|
## Prompts
|
|
19
47
|
|
|
@@ -21,7 +49,7 @@ The installer walks you through up to 9 prompts (several are conditional):
|
|
|
21
49
|
|
|
22
50
|
| # | Prompt | Options | Default | Condition |
|
|
23
51
|
|---|--------|---------|---------|-----------|
|
|
24
|
-
| 1 | Project name | any string | — | always |
|
|
52
|
+
| 1 | Project name | any string | — | always (skipped if passed as argv) |
|
|
25
53
|
| 2 | Database ORM | Prisma · Drizzle · None | Prisma | always |
|
|
26
54
|
| 3 | Database driver | SQLite · PostgreSQL · MySQL | SQLite | only if ORM selected |
|
|
27
55
|
| 4 | Package checklist | multiselect (see below) | Auth + Cache | always |
|
|
@@ -31,6 +59,8 @@ The installer walks you through up to 9 prompts (several are conditional):
|
|
|
31
59
|
| 8 | Add shadcn/ui? | yes / no | yes | only if React + Tailwind |
|
|
32
60
|
| 9 | Install dependencies? | yes / no | yes | always |
|
|
33
61
|
|
|
62
|
+
> **Not sure what to pick?** Accept every default — it produces the most-used stack (Prisma + SQLite + Auth + Cache + React + Tailwind + shadcn/ui) and is the best-tested path. You can always add packages later.
|
|
63
|
+
|
|
34
64
|
### Package checklist (prompt 4)
|
|
35
65
|
|
|
36
66
|
| Choice | Description | Package |
|
|
@@ -44,20 +74,22 @@ The installer walks you through up to 9 prompts (several are conditional):
|
|
|
44
74
|
| Scheduler | Cron-like task scheduling | `@rudderjs/schedule` |
|
|
45
75
|
| WebSocket | Real-time channels | `@rudderjs/broadcast` |
|
|
46
76
|
| Real-time Collab | Yjs CRDT sync | `@rudderjs/live` |
|
|
47
|
-
| AI | LLM providers (Anthropic, OpenAI, Google, Ollama) | `@rudderjs/ai` |
|
|
77
|
+
| AI | LLM providers (Anthropic, OpenAI, Google, Ollama, Groq, DeepSeek, xAI, Mistral, Azure) | `@rudderjs/ai` |
|
|
48
78
|
| MCP | Model Context Protocol servers — expose tools/resources to LLMs | `@rudderjs/mcp` |
|
|
49
79
|
| Passport (OAuth2) | OAuth 2 server with JWT — **requires Auth + Prisma** | `@rudderjs/passport` |
|
|
50
80
|
| Localization | i18n — `trans()`, `setLocale()` | `@rudderjs/localization` |
|
|
51
81
|
|
|
52
|
-
|
|
82
|
+
Package-specific behavior:
|
|
53
83
|
|
|
54
|
-
|
|
84
|
+
- **AI** — generates `config/ai.ts`, AI chat demo at `/ai-chat`, `POST /api/ai/chat`.
|
|
85
|
+
- **MCP** — generates `app/Mcp/EchoServer.ts` and wires `POST /mcp/echo`.
|
|
86
|
+
- **Passport** — generates `config/passport.ts`, OAuth 2 routes (`/oauth/authorize`, `/oauth/token`, etc.), and `OAuthClient` + `OAuthAccessToken` Prisma models. Fails fast if Auth or Prisma isn't also selected.
|
|
55
87
|
|
|
56
|
-
|
|
88
|
+
Only selected packages get their dependencies, providers, config files, and schema files. Always-included base packages: `core`, `router`, `server-hono`, `middleware`, `vite`, `rudder`, `cli`, `log`. `session` + `hash` are pulled in automatically with Authentication.
|
|
57
89
|
|
|
58
|
-
|
|
90
|
+
---
|
|
59
91
|
|
|
60
|
-
##
|
|
92
|
+
## Generated structure
|
|
61
93
|
|
|
62
94
|
```
|
|
63
95
|
my-app/
|
|
@@ -96,7 +128,12 @@ my-app/
|
|
|
96
128
|
└── package.json
|
|
97
129
|
```
|
|
98
130
|
|
|
99
|
-
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Reference — framework combinations, CSS, PM differences
|
|
134
|
+
|
|
135
|
+
<details>
|
|
136
|
+
<summary>Framework selection → page extension + tsconfig</summary>
|
|
100
137
|
|
|
101
138
|
| Selection | Page extension | tsconfig jsx |
|
|
102
139
|
|-----------|---------------|--------------|
|
|
@@ -107,25 +144,31 @@ my-app/
|
|
|
107
144
|
| React + Solid | `.tsx` — Vite plugins use include/exclude to disambiguate | `react-jsx` |
|
|
108
145
|
| All three | `.tsx` or `.vue` depending on primary | `react-jsx` |
|
|
109
146
|
|
|
110
|
-
**Single framework:** the renderer (`vike-react`, `vike-vue`, or `vike-solid`) is included directly in the root `+config.ts
|
|
147
|
+
**Single framework:** the renderer (`vike-react`, `vike-vue`, or `vike-solid`) is included directly in the root `+config.ts`.
|
|
111
148
|
|
|
112
|
-
**Multiple frameworks:** the root `+config.ts` has no renderer. Each page
|
|
149
|
+
**Multiple frameworks:** the root `+config.ts` has no renderer. Each page folder declares its own `+config.ts` extending the appropriate renderer. Secondary frameworks get a minimal demo page at `pages/{fw}-demo/`.
|
|
150
|
+
</details>
|
|
113
151
|
|
|
114
|
-
|
|
152
|
+
<details>
|
|
153
|
+
<summary>CSS variants based on Tailwind / shadcn selection</summary>
|
|
115
154
|
|
|
116
155
|
| Selection | `src/index.css` content |
|
|
117
156
|
|-----------|------------------------|
|
|
118
157
|
| Tailwind + shadcn | Full shadcn CSS variables + `@import "shadcn/tailwind.css"` |
|
|
119
158
|
| Tailwind only | `@import "tailwindcss"; @import "tw-animate-css";` |
|
|
120
159
|
| No Tailwind | File not generated |
|
|
160
|
+
</details>
|
|
121
161
|
|
|
122
|
-
|
|
162
|
+
<details>
|
|
163
|
+
<summary>Package-manager differences in generated files</summary>
|
|
123
164
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
pnpm
|
|
127
|
-
|
|
128
|
-
|
|
165
|
+
| File | pnpm | npm / yarn | bun |
|
|
166
|
+
|------|------|-----------|-----|
|
|
167
|
+
| `pnpm-workspace.yaml` | generated | not generated | not generated |
|
|
168
|
+
| `package.json` native-build field | `pnpm.onlyBuiltDependencies` | *(not needed)* | `trustedDependencies` |
|
|
169
|
+
</details>
|
|
170
|
+
|
|
171
|
+
---
|
|
129
172
|
|
|
130
173
|
## After scaffolding
|
|
131
174
|
|
|
@@ -141,11 +184,88 @@ The installer prints the exact commands for your package manager. For reference:
|
|
|
141
184
|
| Passport keys (if Passport) | `pnpm rudder passport:keys` | `npm run rudder passport:keys` | `yarn rudder passport:keys` | `bun rudder passport:keys` |
|
|
142
185
|
| Start dev server | `pnpm dev` | `npm run dev` | `yarn dev` | `bun dev` |
|
|
143
186
|
|
|
144
|
-
When you let the installer run
|
|
187
|
+
When you let the installer run **Install dependencies**, it also runs `rudder providers:discover` automatically so the app boots on first `dev`. If you skipped install, run both manually before `dev`.
|
|
145
188
|
|
|
146
|
-
|
|
189
|
+
---
|
|
147
190
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
191
|
+
## Troubleshooting
|
|
192
|
+
|
|
193
|
+
<details>
|
|
194
|
+
<summary><strong>“[RudderJS] @rudderjs/X listed in the provider manifest but not installed”</strong></summary>
|
|
195
|
+
|
|
196
|
+
The auto-discovery manifest (`bootstrap/cache/providers.json`) references a package you no longer have. Regenerate:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
pnpm rudder providers:discover
|
|
200
|
+
```
|
|
201
|
+
</details>
|
|
202
|
+
|
|
203
|
+
<details>
|
|
204
|
+
<summary><strong>Register or login returns 500 with a Prisma error</strong></summary>
|
|
205
|
+
|
|
206
|
+
Usually means the schema wasn't pushed. Run:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
pnpm exec prisma generate
|
|
210
|
+
pnpm exec prisma db push
|
|
211
|
+
```
|
|
212
|
+
</details>
|
|
213
|
+
|
|
214
|
+
<details>
|
|
215
|
+
<summary><strong>Passport endpoints 500 with “no private key found”</strong></summary>
|
|
216
|
+
|
|
217
|
+
You skipped the key generation step. Run:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
pnpm rudder passport:keys
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Keys land in `storage/oauth-{private,public}.key`. They're gitignored — never commit them.
|
|
224
|
+
</details>
|
|
225
|
+
|
|
226
|
+
<details>
|
|
227
|
+
<summary><strong>Port 3000 or HMR port 24678 already in use</strong></summary>
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
lsof -ti :24678 -ti :3000 | xargs kill -9
|
|
231
|
+
```
|
|
232
|
+
</details>
|
|
233
|
+
|
|
234
|
+
<details>
|
|
235
|
+
<summary><strong>Auth views didn't get copied — “run vendor:publish manually”</strong></summary>
|
|
236
|
+
|
|
237
|
+
The installer tries to vendor `@rudderjs/auth/views/{react,vue}/` into `app/Views/Auth/`. If the copy fails (rare), run:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
pnpm rudder vendor:publish --tag=auth-views-react # or auth-views-vue
|
|
241
|
+
```
|
|
242
|
+
</details>
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Related
|
|
247
|
+
|
|
248
|
+
- **Main framework**: [github.com/rudderjs/rudder](https://github.com/rudderjs/rudder)
|
|
249
|
+
- **Docs**: [Mental model](https://github.com/rudderjs/rudder/blob/main/docs/guide/mental-model.md) · [Provider auto-discovery](https://github.com/rudderjs/rudder/blob/main/docs/guide/auto-discovery.md) · [Your first app](https://github.com/rudderjs/rudder/blob/main/docs/guide/your-first-app.md)
|
|
250
|
+
- **Report issues**: [github.com/rudderjs/rudder/issues](https://github.com/rudderjs/rudder/issues)
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## Contributing to the scaffolder
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
git clone https://github.com/rudderjs/rudder.git
|
|
258
|
+
cd rudder/create-rudder-app
|
|
259
|
+
pnpm install
|
|
260
|
+
pnpm build
|
|
261
|
+
node dist/index.js # launches the interactive CLI from source
|
|
262
|
+
pnpm test # 111 template tests
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Template logic lives in `src/templates.ts` (pure — returns `Record<path, content>`, no filesystem). The entrypoint `src/index.ts` handles prompts + writes + installs. Adding a new package option touches both files + `templates.test.ts`.
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## License
|
|
270
|
+
|
|
271
|
+
MIT © [Suleiman Shahbari](https://github.com/rudderjs/rudder)
|