Skip to content

Commit 7ef1dea

Browse files
rrnewtonclaude
andcommitted
Replace happy-demo.sh with happy-launcher.sh everywhere
- Update Makefile targets to use happy-launcher.sh - Make `stop` target stop daemon and cleanup all slots - Update start-server.sh to wrap happy-launcher.sh - Update .devcontainer/Makefile server target - Expand QUICKSTART in README with full self-hosting steps: - Create account in webapp - Get secret key - Install CLI on dev machines - Authenticate with backup key - Start daemon - Optional voice assistant setup - Update all documentation to reference happy-launcher.sh 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3edcff4 commit 7ef1dea

File tree

10 files changed

+93
-92
lines changed

10 files changed

+93
-92
lines changed

.devcontainer/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ server:
115115
-v `pwd`/home:/root \
116116
-v `pwd`/..:$(WORKDIR) \
117117
$(PORTS_SERVER) $(FULLTAG) \
118-
bash -c "cd $(WORKDIR) && ./happy-demo.sh start && tail -f /dev/null"
118+
bash -c "cd $(WORKDIR) && ./happy-launcher.sh start-backend && tail -f /dev/null"
119119

120120
AGENT_LAYERS = Dockerfile.claude Dockerfile.copilot
121121
# Dockerfile.gemini

DEBUG_WEB_AUTH.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ Then when you submit the secret key:
6969
**Solutions:**
7070
1. The secret key might be from a different account
7171
2. Run `node scripts/setup-test-credentials.mjs` to generate a fresh account
72-
3. Check server logs: `./happy-demo.sh logs server`
72+
3. Check server logs: `./happy-launcher.sh logs server`
7373

7474
### If you see network error or CORS error
7575

7676
**Problem:** Can't connect to the server.
7777

7878
**Solutions:**
7979
1. Check server is running: `curl http://localhost:3005`
80-
2. Restart server: `./happy-demo.sh restart`
80+
2. Restart server: `./happy-launcher.sh restart`
8181

8282
### If logs show different bytes length (not 32)
8383

DEPENDENCIES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ This document tracks all dependencies installed during the self-hosted setup pro
9494
### e2e-demo.sh
9595
- **Location**: `/e2e-demo.sh`
9696
- **Purpose**: Complete e2e demo script that shows the full self-hosted flow
97-
- **Dependencies**: setup-postgres.sh, happy-demo.sh, setup-test-credentials.mjs
97+
- **Dependencies**: setup-postgres.sh, happy-launcher.sh, setup-test-credentials.mjs
9898
- **Usage**: `./e2e-demo.sh`
9999

100100
## Environment Variables

E2E_TESTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ For headless e2e testing, we've created a script that automates the entire authe
1414

1515
```bash
1616
# 1. Start all services
17-
./happy-demo.sh start
17+
./happy-launcher.sh start
1818

1919
# 2. Setup test credentials (automated, no interaction needed)
2020
node scripts/setup-test-credentials.mjs
@@ -54,7 +54,7 @@ The `happy` directory contains an Expo React Native app that supports web deploy
5454
### 1. Start the Services
5555

5656
```bash
57-
./happy-demo.sh start
57+
./happy-launcher.sh start
5858
```
5959

6060
This starts:
@@ -106,7 +106,7 @@ Open `http://localhost:8081` in a text-based web browser (or any browser):
106106
In another terminal:
107107

108108
```bash
109-
./happy-demo.sh cli
109+
./happy-launcher.sh cli
110110
```
111111

112112
Or directly:
@@ -159,14 +159,14 @@ Key endpoints used in tests:
159159

160160
### Server not responding
161161
```bash
162-
./happy-demo.sh status # Check all services
163-
./happy-demo.sh logs server # View server logs
162+
./happy-launcher.sh status # Check all services
163+
./happy-launcher.sh logs server # View server logs
164164
```
165165

166166
### Authentication timeout
167167
- Verify server URL in web client matches CLI config
168168
- Check that both are using `http://localhost:3005`
169-
- Ensure `.env` file exists in happy-server (run `./happy-demo.sh start` to create it)
169+
- Ensure `.env` file exists in happy-server (run `./happy-launcher.sh start` to create it)
170170

171171
### Database connection errors
172172
```bash
@@ -178,8 +178,8 @@ cd happy-server && yarn migrate
178178

179179
### Clean slate
180180
```bash
181-
./happy-demo.sh cleanup --clean-logs # Stop everything and clean logs
182-
./happy-demo.sh start # Fresh start
181+
./happy-launcher.sh cleanup --clean-logs # Stop everything and clean logs
182+
./happy-launcher.sh start # Fresh start
183183
```
184184

185185
## Architecture

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,16 @@ server: build
233233
@echo ""
234234
@./start-server.sh
235235

236-
# Stop all services
236+
# Stop all services (all slots)
237237
stop:
238238
@echo "=== Stopping all services ==="
239-
@./happy-demo.sh cleanup
240-
@pkill -f 'expo start' 2>/dev/null || true
239+
@./happy-cli/bin/happy.mjs daemon stop 2>/dev/null || true
240+
@./happy-launcher.sh cleanup --all-slots
241241
@echo "All services stopped"
242242

243243
# View server logs
244244
logs:
245-
@./happy-demo.sh logs server
245+
@./happy-launcher.sh logs server
246246

247247
# Run CLI with local server (uses default ~/.happy credentials)
248248
cli:
@@ -265,7 +265,7 @@ e2e-test: build
265265
@echo ""
266266
@echo "=== Running E2E Test (isolated credentials) ==="
267267
@echo ""
268-
@./happy-demo.sh cleanup --clean-logs
268+
@./happy-launcher.sh cleanup --clean-logs
269269
@./e2e-web-demo.sh
270270

271271
# Inspect webapp with headless browser (requires webapp to be running)

README.md

Lines changed: 63 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ This repository contains a working self-hosted setup of Happy (server + CLI) wit
44

55
## QUICKSTART: Self Hosting
66

7+
### Step 0: Build and Launch Services
8+
79
Run your own Happy instance with two containers - one for the webapp and one for the server:
810

911
```bash
@@ -17,12 +19,58 @@ make server
1719
make web
1820
```
1921

20-
Then open http://localhost:8081 in your browser.
21-
2222
**Other container options:**
2323
- `make root` - Interactive shell with no ports forwarded
2424
- `make root-all-ports` - Interactive shell with both ports (8081 + 3005) forwarded
2525

26+
### Step 1: Create an Account
27+
28+
1. Open http://localhost:8081 in your browser
29+
2. Click "Create Account"
30+
3. Optionally add a recognizable username in Account settings
31+
32+
### Step 2: View Your Secret Key
33+
34+
1. Go to Account settings in the webapp
35+
2. Find and copy your secret backup key (format: `XXXXX-XXXXX-...`)
36+
37+
### Step 3: Install the CLI on Development Machines
38+
39+
On each machine where you want to run Claude with Happy:
40+
41+
```bash
42+
# Clone and install the fork
43+
git clone --depth=1 https://github.com/rrnewton/happy-cli.git /usr/local/happy
44+
cd /usr/local/happy
45+
npm install
46+
npm run build
47+
npm install -g .
48+
```
49+
50+
### Step 4: Authenticate the CLI
51+
52+
Use the secret key from Step 2 to authenticate:
53+
54+
```bash
55+
happy auth login --backup-key <YOUR-SECRET-KEY>
56+
```
57+
58+
### Step 5: Start the Daemon
59+
60+
```bash
61+
happy daemon start
62+
```
63+
64+
The daemon connects your machine to the Happy server, allowing remote control from the webapp.
65+
66+
### Step 6: (Optional) Voice Assistant Setup
67+
68+
For ElevenLabs voice assistant integration:
69+
1. Go to Account > Voice Assistant in the webapp
70+
2. Click "Get API Key" to create an ElevenLabs API key with required permissions
71+
3. Enter your API key and save credentials
72+
4. Use "Find Agent" or "Create/Update Agent" to set up the voice agent
73+
2674
## Getting Started
2775

2876
### Build and Run Container
@@ -117,10 +165,10 @@ See [WEB_CLIENT_GUIDE.md](WEB_CLIENT_GUIDE.md) for detailed instructions.
117165
### Start Services
118166

119167
```bash
120-
./happy-demo.sh start # Start all services
121-
./happy-demo.sh status # Check what's running
122-
./happy-demo.sh stop # Stop services
123-
./happy-demo.sh cleanup # Stop everything including databases
168+
./happy-launcher.sh start # Start all services
169+
./happy-launcher.sh status # Check what's running
170+
./happy-launcher.sh stop # Stop services
171+
./happy-launcher.sh cleanup # Stop everything including databases
124172
```
125173

126174
### Setup Test Credentials
@@ -176,10 +224,12 @@ export HAPPY_SERVER_URL=http://localhost:3005
176224

177225
## Key Scripts
178226

179-
### happy-demo.sh
227+
### happy-launcher.sh
180228
Main control script for managing services:
181-
- `start` - Start all services
182-
- `stop` - Stop happy-server and MinIO
229+
- `start` - Start all services (backend + webapp)
230+
- `start-backend` - Start only backend services
231+
- `start-webapp` - Start only the webapp
232+
- `stop` - Stop happy-server, webapp, and MinIO
183233
- `cleanup` - Stop everything including databases
184234
- `status` - Show service status
185235
- `logs <service>` - View logs
@@ -213,14 +263,14 @@ All ports are automatically forwarded when using the devcontainer.
213263

214264
### Server not responding
215265
```bash
216-
./happy-demo.sh status # Check all services
217-
./happy-demo.sh logs server # View server logs
266+
./happy-launcher.sh status # Check all services
267+
./happy-launcher.sh logs server # View server logs
218268
```
219269

220270
### Clean slate
221271
```bash
222-
./happy-demo.sh cleanup --clean-logs # Stop everything and clean logs
223-
./happy-demo.sh start # Fresh start
272+
./happy-launcher.sh cleanup --clean-logs # Stop everything and clean logs
273+
./happy-launcher.sh start # Fresh start
224274
```
225275

226276
### Database issues

SELF_HOSTED_SETUP.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ set -e
124124
echo "=== Happy Real Authentication Demo ==="
125125

126126
# Step 1: Start services
127-
./happy-demo.sh start
127+
./happy-launcher.sh start
128128

129129
# Step 2: Start web client
130130
echo "Starting web client..."
@@ -228,7 +228,7 @@ happy auth
228228

229229
1. **Start services**:
230230
```bash
231-
./happy-demo.sh start
231+
./happy-launcher.sh start
232232
```
233233

234234
2. **Start web client** (in separate terminal):

SETUP_COMPLETE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ All dependencies have been added to `.devcontainer/Dockerfile.project`. When you
125125

126126
1. Install PostgreSQL, Redis, lsof, and wget
127127
2. Download and install MinIO server and client
128-
3. Copy the `happy-demo.sh` control script to `/workspace/`
128+
3. Copy the `happy-launcher.sh` control script to `/workspace/`
129129

130130
After rebuilding, you'll still need to:
131-
1. Run `happy-demo.sh start` to start all services
131+
1. Run `happy-launcher.sh start` to start all services
132132
2. Set up the database: Create the `handy` database and run migrations
133133
3. Configure MinIO: Create the `happy` bucket
134134

135135
Or simply use the quick start:
136136
```bash
137-
./happy-demo.sh start
137+
./happy-launcher.sh start
138138
```

WEB_CLIENT_GUIDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The Happy web client provides a browser-based interface to:
1515
### 1. Start All Services
1616

1717
```bash
18-
./happy-demo.sh start
18+
./happy-launcher.sh start
1919
```
2020

2121
This starts:
@@ -177,7 +177,7 @@ export HAPPY_SERVER_URL=http://localhost:3005
177177
### Web client can't connect to server
178178

179179
Check that:
180-
1. happy-server is running: `./happy-demo.sh status`
180+
1. happy-server is running: `./happy-launcher.sh status`
181181
2. Server URL is correct in web client environment variables
182182
3. No firewall is blocking port 3005
183183

@@ -226,8 +226,8 @@ Priority order for server URL:
226226
### Authentication fails in web browser
227227

228228
Check:
229-
1. Server logs: `./happy-demo.sh logs server`
230-
2. Database is running: `./happy-demo.sh status`
229+
1. Server logs: `./happy-launcher.sh logs server`
230+
2. Database is running: `./happy-launcher.sh status`
231231
3. Try creating fresh test credentials: `node scripts/setup-test-credentials.mjs`
232232
4. See "Invalid secret key" troubleshooting section above
233233

start-server.sh

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,13 @@
33
# Start Happy Server (infrastructure only)
44
# This script starts all backend services without creating test accounts or sessions
55
# Use this for normal development work
6+
#
7+
# This is a thin wrapper around happy-launcher.sh
68

79
set -e
810

911
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1012

11-
# Colors for output
12-
GREEN='\033[0;32m'
13-
BLUE='\033[0;34m'
14-
CYAN='\033[0;36m'
15-
NC='\033[0m'
16-
17-
info() { echo -e "${BLUE}[INFO]${NC} $1"; }
18-
success() { echo -e "${GREEN}[SUCCESS]${NC} $1"; }
19-
step() { echo -e "${CYAN}[STEP]${NC} $1"; }
20-
2113
echo ""
2214
echo "=== Happy Server Startup ==="
2315
echo ""
@@ -29,50 +21,9 @@ echo " - happy-server API (port 3005)"
2921
echo " - happy webapp (port 8081)"
3022
echo ""
3123

32-
# Step 1: Start backend services
33-
step "Step 1: Starting backend services..."
34-
./happy-demo.sh start
35-
success "Backend services started"
36-
echo ""
37-
38-
# Step 2: Start web client
39-
step "Step 2: Starting Happy web client..."
40-
info "Building may take a minute on first run..."
41-
cd happy
42-
# Clear cache to ensure latest code
43-
rm -rf .expo/web node_modules/.cache 2>/dev/null || true
44-
yarn start:local-server > /tmp/happy-web.log 2>&1 &
45-
WEB_PID=$!
46-
cd ..
47-
echo "Web client PID: $WEB_PID"
48-
echo ""
24+
# Use happy-launcher.sh to start all services
25+
"$SCRIPT_DIR/happy-launcher.sh" start
4926

50-
# Wait for web server to be ready
51-
info "Waiting for web server to start..."
52-
sleep 10
53-
for i in {1..12}; do
54-
if curl -s http://localhost:8081 > /dev/null 2>&1; then
55-
success "Web client is ready!"
56-
break
57-
fi
58-
echo -n "."
59-
sleep 5
60-
done
61-
echo ""
62-
63-
echo ""
64-
echo "=== Server Started ==="
65-
echo ""
66-
success "API Server: http://localhost:3005"
67-
success "Web Client: http://localhost:8081"
68-
success "MinIO Console: http://localhost:9001 (minioadmin/minioadmin)"
69-
echo ""
70-
echo "To use the CLI (defaults to ~/.happy):"
71-
echo " HAPPY_SERVER_URL=http://localhost:3005 ./happy-cli/bin/happy.mjs"
72-
echo ""
73-
echo "To authenticate a new CLI:"
74-
echo " 1. Run CLI and scan QR code with webapp"
75-
echo " 2. Or use 'make setup-credentials' to auto-create credentials"
7627
echo ""
7728
echo "Useful commands:"
7829
echo " make stop # Stop all services"

0 commit comments

Comments
 (0)