create-workerstack 0.1.0 → 0.1.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 ADDED
@@ -0,0 +1,58 @@
1
+ # create-workerstack
2
+
3
+ Scaffold a full-stack Cloudflare Workers app in seconds.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ # With bun (recommended)
9
+ bunx create-workerstack@latest my-app
10
+
11
+ # With npm
12
+ npm create workerstack@latest my-app
13
+
14
+ # With pnpm
15
+ pnpm create workerstack@latest my-app
16
+ ```
17
+
18
+ ## What's Included
19
+
20
+ | Technology | Role |
21
+ |---|---|
22
+ | **Cloudflare Workers** | Edge-first serverless runtime |
23
+ | **Hono** | Ultrafast web framework |
24
+ | **React 19** | UI library with SSR support |
25
+ | **MUI Material** | Production-grade component library |
26
+ | **Better Auth** | Authentication (email/password, OAuth, admin) |
27
+ | **Drizzle ORM** | Type-safe SQL ORM with PostgreSQL |
28
+ | **Vite** | Build tool with HMR |
29
+ | **Resend** | Transactional email service |
30
+ | **TypeScript** | End-to-end type safety |
31
+
32
+ ## CLI Options
33
+
34
+ The CLI walks you through an interactive setup:
35
+
36
+ - **Project name** — also used for `package.json` and `wrangler.jsonc`
37
+ - **Description** — sets `package.json` description
38
+ - **Package manager** — bun, npm, or pnpm
39
+ - **Install dependencies** — run install automatically after scaffolding
40
+ - **Initialize git** — run `git init` in the new project
41
+
42
+ You can also pass the project name as an argument to skip the first prompt:
43
+
44
+ ```bash
45
+ bunx create-workerstack@latest my-app
46
+ ```
47
+
48
+ ## After Scaffolding
49
+
50
+ ```bash
51
+ cd my-app
52
+ cp .env.example .env # configure your environment variables
53
+ bun run dev # start the development server
54
+ ```
55
+
56
+ ## License
57
+
58
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-workerstack",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Scaffold a full-stack Cloudflare Workers app with Hono, React, MUI, Better Auth, and Drizzle",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,109 @@
1
+ # WorkerStack App
2
+
3
+ Full-stack app running on Cloudflare Workers, built with [WorkerStack](https://www.npmjs.com/package/create-workerstack).
4
+
5
+ ## Stack
6
+
7
+ - **Runtime** — Cloudflare Workers (edge serverless)
8
+ - **Backend** — Hono
9
+ - **Frontend** — React 19 + MUI Material
10
+ - **Auth** — Better Auth (email/password, admin plugin)
11
+ - **Database** — Drizzle ORM + PostgreSQL
12
+ - **Email** — Resend
13
+ - **Build** — Vite + TypeScript
14
+
15
+ ## Prerequisites
16
+
17
+ - [Bun](https://bun.sh/) (or npm/pnpm)
18
+ - [Cloudflare account](https://dash.cloudflare.com/sign-up)
19
+ - PostgreSQL database (e.g. [Neon](https://neon.tech/), [Supabase](https://supabase.com/))
20
+
21
+ ## Getting Started
22
+
23
+ ```bash
24
+ # Install dependencies
25
+ bun install
26
+
27
+ # Set up environment variables
28
+ cp .env.example .env
29
+ # Edit .env with your DATABASE_URL, BETTER_AUTH_SECRET, etc.
30
+
31
+ # Generate Cloudflare types
32
+ bun run cf-typegen
33
+
34
+ # Run database migrations
35
+ bun run db:migrate
36
+
37
+ # Start development server
38
+ bun run dev
39
+ ```
40
+
41
+ The app will be available at `http://localhost:5000`.
42
+
43
+ ## Scripts
44
+
45
+ | Script | Description |
46
+ |---|---|
47
+ | `bun run dev` | Start Vite dev server with HMR |
48
+ | `bun run build` | Production build |
49
+ | `bun run preview` | Build and preview locally |
50
+ | `bun run deploy` | Build and deploy to Cloudflare |
51
+ | `bun run deploy:dev` | Deploy to dev environment |
52
+ | `bun run cf-typegen` | Generate Cloudflare bindings types |
53
+ | `bun run typecheck:client` | Type-check client code |
54
+ | `bun run typecheck:server` | Type-check server code |
55
+ | `bun run db:generate` | Generate Drizzle migrations |
56
+ | `bun run db:migrate` | Run database migrations |
57
+ | `bun run ba:schema` | Generate Better Auth schema |
58
+
59
+ ## Project Structure
60
+
61
+ ```
62
+ src/
63
+ ├── api/
64
+ │ ├── index.ts # API routes (Hono)
65
+ │ └── middlewares/
66
+ │ └── auth.ts # Authentication middleware
67
+ ├── client/
68
+ │ ├── App.tsx # React app entry point
69
+ │ ├── main.tsx # React DOM mount
70
+ │ └── tsconfig.json # Client TypeScript config
71
+ ├── database/
72
+ │ ├── db.ts # Drizzle ORM setup
73
+ │ ├── schema.ts # Database schema
74
+ │ ├── auth-schema.ts # Better Auth generated schema
75
+ │ └── migrations/ # SQL migrations
76
+ ├── lib/
77
+ │ └── better-auth/
78
+ │ ├── index.ts # Auth instance factory
79
+ │ └── options.ts # Auth configuration
80
+ ├── services/
81
+ │ └── email.ts # Email service (Resend)
82
+ ├── utils/
83
+ │ ├── logger.ts # Structured logging
84
+ │ └── noCache.ts # Cache control middleware
85
+ ├── index.tsx # Server entry (Hono app)
86
+ ├── client.tsx # HTML shell renderer
87
+ └── style.css # Global styles
88
+ ```
89
+
90
+ ## Environment Variables
91
+
92
+ | Variable | Description |
93
+ |---|---|
94
+ | `DATABASE_URL` | PostgreSQL connection string |
95
+ | `BETTER_AUTH_URL` | Base URL for auth (e.g. `http://localhost:5000`) |
96
+ | `BETTER_AUTH_SECRET` | Secret key for sessions |
97
+ | `RESEND_API_KEY` | Resend API key for emails |
98
+
99
+ ## Deploy
100
+
101
+ ```bash
102
+ # Production
103
+ bun run deploy
104
+
105
+ # Dev environment
106
+ bun run deploy:dev
107
+ ```
108
+
109
+ Make sure to set your environment variables in the Cloudflare dashboard under **Workers & Pages > your-worker > Settings > Variables**.