@sansavision/create-pulse 0.4.2 → 0.4.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.
package/README.md CHANGED
@@ -27,7 +27,7 @@ npx @sansavision/create-pulse my-pulse-app
27
27
  When you run `create-pulse`, you'll be prompted to select a template.
28
28
 
29
29
  ### 1. Next.js + Auth (Full Demo) ⭐
30
- An **investor-ready** demo application showcasing the full capabilities of Pulse.
30
+ A **full-featured** demo application showcasing the full capabilities of Pulse.
31
31
  - **Better Auth** with email/password, local SQLite + Drizzle ORM
32
32
  - **Webhook auth** — Pulse relay verifies tokens via your Next.js API
33
33
  - 5 comprehensive demos: Real-time Chat, Watch Together, Durable Queues (with offline simulation), Game State Sync, E2E Encrypted Chat
package/dist/index.js CHANGED
@@ -51,7 +51,7 @@ async function main() {
51
51
  return p.select({
52
52
  message: "Pick a template:",
53
53
  options: [
54
- { value: "nextjs-auth-demo", label: "Next.js + Auth (Full Demo)", hint: "Better Auth, all features, investor-ready" },
54
+ { value: "nextjs-auth-demo", label: "Next.js + Auth (Full Demo)", hint: "Better Auth, video calls, all features" },
55
55
  { value: "react-watch-together", label: "Watch Together (React + TS)", hint: "Synchronized video playback" },
56
56
  { value: "react-all-features", label: "All Features (React + TS)", hint: "Chat, Video, Audio, RPC" },
57
57
  { value: "react-queue-demo", label: "Durable Queues (React + TS)", hint: "Persistent queues with WAL/Postgres/Redis" },
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@sansavision/create-pulse",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "Scaffold a new Pulse application",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
7
7
  "create-pulse": "dist/index.js"
8
8
  },
9
9
  "scripts": {
10
- "build": "tsup src/index.ts --format cjs --dts",
10
+ "build": "tsup src/index.ts --format cjs",
11
11
  "dev": "tsup src/index.ts --format cjs --watch"
12
12
  },
13
13
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  # Pulse + Next.js Auth Demo
2
2
 
3
- An **investor-ready** demo application showcasing the full capabilities of [Pulse](https://github.com/Sansa-Organisation/pulse) — the real-time protocol for modern applications.
3
+ A **full-featured** demo application showcasing the full capabilities of [Pulse](https://github.com/Sansa-Organisation/pulse) — the real-time protocol for modern applications.
4
4
 
5
5
  ## Features
6
6
 
@@ -13,26 +13,58 @@ An **investor-ready** demo application showcasing the full capabilities of [Puls
13
13
 
14
14
  ## Quick Start
15
15
 
16
+ ### 1. Install dependencies
17
+
16
18
  ```bash
17
- # 1. Install dependencies
18
19
  npm install
20
+ ```
19
21
 
20
- # 2. Create .env file
22
+ ### 2. Configure environment
23
+
24
+ ```bash
21
25
  cp .env.example .env
26
+ ```
27
+
28
+ Edit `.env` and set your secret (generate one with `openssl rand -base64 32`):
29
+
30
+ ```env
31
+ BETTER_AUTH_SECRET=your-generated-secret-here
32
+ BETTER_AUTH_URL=http://localhost:3000
33
+ NEXT_PUBLIC_PULSE_URL=ws://localhost:4001
34
+ ```
22
35
 
23
- # 3. Generate a secret and update .env
24
- openssl rand -base64 32
36
+ > **Note:** `BETTER_AUTH_URL` must match the port your app runs on. If you use `--port 3444`, set it to `http://localhost:3444`.
25
37
 
26
- # 4. Create database tables
27
- npx @auth/cli migrate
38
+ ### 3. Create database tables
28
39
 
29
- # 5. Start the Pulse relay (in another terminal)
30
- npx @sansavision/pulse-cli serve --auth-mode webhook --auth-webhook http://localhost:3000/api/pulse/verify
40
+ The auth schema is pre-generated in `src/lib/schema.ts`. Push it to SQLite:
31
41
 
32
- # 6. Start the app
42
+ ```bash
43
+ npm run db:push
44
+ ```
45
+
46
+ > This creates the `user`, `session`, `account`, and `verification` tables in `./sqlite.db`.
47
+
48
+ ### 4. Start the Pulse relay
49
+
50
+ In a separate terminal, start the relay with webhook auth:
51
+
52
+ ```bash
53
+ npx @sansavision/pulse-cli serve \
54
+ --auth-mode webhook \
55
+ --auth-webhook http://localhost:3000/api/pulse/verify
56
+ ```
57
+
58
+ > If your app runs on a different port, update the `--auth-webhook` URL accordingly.
59
+
60
+ ### 5. Start the app
61
+
62
+ ```bash
33
63
  npm run dev
34
64
  ```
35
65
 
66
+ Open [http://localhost:3000](http://localhost:3000) in your browser.
67
+
36
68
  ## Multi-User Testing
37
69
 
38
70
  1. Open `http://localhost:3000` in a browser
@@ -70,5 +102,24 @@ Next.js App (port 3000) Pulse Relay (port 4001)
70
102
  | Variable | Description | Default |
71
103
  |----------|-------------|---------|
72
104
  | `BETTER_AUTH_SECRET` | Auth encryption secret (32+ chars) | — |
73
- | `BETTER_AUTH_URL` | Base URL of the app | `http://localhost:3000` |
105
+ | `BETTER_AUTH_URL` | Base URL of the app (must match your port) | `http://localhost:3000` |
74
106
  | `NEXT_PUBLIC_PULSE_URL` | Pulse relay WebSocket URL | `ws://localhost:4001` |
107
+
108
+ ## Troubleshooting
109
+
110
+ ### "Invalid origin" error on signup
111
+
112
+ Your `BETTER_AUTH_URL` doesn't match the port the app is running on. For example, if you start the app with `--port 3444`, set `BETTER_AUTH_URL=http://localhost:3444` in `.env`.
113
+
114
+ ### "Connecting to Pulse relay..." stays loading
115
+
116
+ Make sure the Pulse relay is running in a separate terminal with `--auth-mode webhook`. Without auth flags, the relay won't accept authenticated connections.
117
+
118
+ ### Database errors
119
+
120
+ If you see table-related errors, re-run the schema push:
121
+
122
+ ```bash
123
+ rm -f sqlite.db
124
+ npm run db:push
125
+ ```
@@ -7,6 +7,8 @@
7
7
  "build": "next build",
8
8
  "start": "next start",
9
9
  "db:push": "npx drizzle-kit push",
10
+ "db:generate": "npx drizzle-kit generate",
11
+ "db:migrate": "npx drizzle-kit migrate",
10
12
  "db:studio": "npx drizzle-kit studio"
11
13
  },
12
14
  "dependencies": {