Skip to content

Commit c90372c

Browse files
committed
Build dependencies
1 parent 5ebbd52 commit c90372c

File tree

3 files changed

+163
-13
lines changed

3 files changed

+163
-13
lines changed

DEPENDENCIES.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Dependencies
2+
3+
This document lists all system and package dependencies required to run the Happy self-hosted stack.
4+
5+
## System Dependencies
6+
7+
These must be installed on the host system:
8+
9+
### Required
10+
- **Node.js 24+** - Runtime for all JavaScript/TypeScript code
11+
- **Yarn 1.22.22+** - Package manager (specified in package.json)
12+
- **PostgreSQL 17+** - Primary database
13+
- **Redis 7+** - Caching and pub/sub
14+
- **MinIO** - S3-compatible object storage
15+
16+
### Optional
17+
- **FFmpeg** - Required by happy-server for media processing
18+
- **Python3** - Required by happy-server for some operations
19+
20+
## Installation Commands
21+
22+
### Ubuntu/Debian
23+
```bash
24+
# Node.js 24
25+
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
26+
sudo apt-get install -y nodejs
27+
28+
# Yarn
29+
npm install -g yarn
30+
31+
# PostgreSQL 17
32+
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
33+
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
34+
sudo apt-get update
35+
sudo apt-get install -y postgresql-17
36+
37+
# Redis
38+
sudo apt-get install -y redis-server
39+
40+
# MinIO
41+
wget https://dl.min.io/server/minio/release/linux-amd64/minio
42+
chmod +x minio
43+
sudo mv minio /usr/local/bin/
44+
wget https://dl.min.io/client/mc/release/linux-amd64/mc
45+
chmod +x mc
46+
sudo mv mc /usr/local/bin/
47+
48+
# Optional: FFmpeg and Python3
49+
sudo apt-get install -y ffmpeg python3
50+
```
51+
52+
## Package Dependencies
53+
54+
After installing system dependencies, install package dependencies:
55+
56+
```bash
57+
make install
58+
```
59+
60+
This runs `yarn install` in each submodule:
61+
- `happy-cli/` - Installs CLI dependencies including:
62+
- `tsx` - TypeScript executor (devDependency)
63+
- `shx` - Cross-platform shell commands (devDependency)
64+
- `pkgroll` - Package bundler (devDependency)
65+
- And all production dependencies
66+
67+
- `happy-server/` - Installs server dependencies including:
68+
- `tsx` - TypeScript executor (production dependency)
69+
- Prisma ORM and other server dependencies
70+
71+
- `happy/` - Installs webapp dependencies (Expo/React Native)
72+
73+
## Dependency Check
74+
75+
The `happy-launcher.sh` script automatically checks for installed package dependencies before starting services. If you see this error:
76+
77+
```
78+
[ERROR] Dependencies not installed in happy-cli
79+
```
80+
81+
Run:
82+
```bash
83+
make install
84+
```
85+
86+
## CI Dependencies
87+
88+
The GitHub Actions CI workflow (`.github/workflows/ci.yml`) installs all dependencies automatically:
89+
1. Node.js 24 via `setup-node` action
90+
2. PostgreSQL 17 and Redis 7 via Docker services
91+
3. MinIO server and client downloaded during workflow
92+
4. Playwright for browser automation testing
93+
5. All package dependencies via `yarn install --frozen-lockfile`

QUICKSTART.md

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,50 @@ This guide walks you through running your own Happy instance.
2121
└─────────┘
2222
```
2323

24-
## Step 1: Build and Launch Services
24+
## Step 1: Install Dependencies
25+
26+
On a fresh checkout, you first need to install all dependencies:
2527

2628
```bash
27-
cd .devcontainer
28-
make build # Build the container image (first time only)
29+
make install # Install dependencies for all components
30+
```
2931

30-
# In terminal 1 - start the server (port 3005):
31-
make server
32+
This installs dependencies for:
33+
- `happy-cli` - CLI tool and daemon
34+
- `happy-server` - Backend server
35+
- `happy` (webapp) - Web interface
3236

33-
# In terminal 2 - start the webapp (port 8081):
34-
make web
37+
## Step 2: Build and Launch Services
38+
39+
```bash
40+
make build # Build TypeScript code (happy-cli and happy-server)
41+
42+
# Start all services (server + webapp):
43+
./happy-launcher.sh start
44+
45+
# OR start just the backend (if you only need the server):
46+
./happy-launcher.sh start-backend
3547
```
3648

37-
## Step 2: Create an Account
49+
The launcher automatically starts:
50+
- PostgreSQL (port 5432)
51+
- Redis (port 6379)
52+
- MinIO (ports 9000/9001)
53+
- happy-server (port 3005)
54+
- Webapp (port 8081, if using `start`)
55+
56+
## Step 3: Create an Account
3857

3958
1. Open http://localhost:8081 in your browser
4059
2. Click "Create Account"
4160
3. Optionally add a recognizable username in Account settings
4261

43-
## Step 3: Get Your Secret Key
62+
## Step 4: Get Your Secret Key
4463

4564
1. Go to Account settings in the webapp
4665
2. Find and copy your secret backup key (format: `XXXXX-XXXXX-...`)
4766

48-
## Step 4: Install the CLI
67+
## Step 5: Install the CLI
4968

5069
On each machine where you want to run Claude with Happy:
5170

@@ -55,21 +74,21 @@ cd /usr/local/happy
5574
npm install && npm run build && npm install -g .
5675
```
5776

58-
## Step 5: Authenticate the CLI
77+
## Step 6: Authenticate the CLI
5978

6079
```bash
6180
happy auth login --backup-key <YOUR-SECRET-KEY>
6281
```
6382

64-
## Step 6: Start the Daemon
83+
## Step 7: Start the Daemon
6584

6685
```bash
6786
happy daemon start
6887
```
6988

7089
The daemon connects your machine to the Happy server, allowing remote control from the webapp.
7190

72-
## Step 7: (Optional) Voice Assistant
91+
## Step 8: (Optional) Voice Assistant
7392

7493
For ElevenLabs voice assistant integration:
7594

happy-launcher.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,41 @@ check_env_vars() {
100100
# Run the check
101101
check_env_vars
102102

103+
# =============================================================================
104+
# Dependency Check
105+
# =============================================================================
106+
107+
check_dependencies() {
108+
local missing_deps=false
109+
110+
# Check if node_modules exist in each submodule
111+
if [ ! -d "$CLI_DIR/node_modules" ]; then
112+
error "Dependencies not installed in happy-cli"
113+
missing_deps=true
114+
fi
115+
116+
if [ ! -d "$SERVER_DIR/node_modules" ]; then
117+
error "Dependencies not installed in happy-server"
118+
missing_deps=true
119+
fi
120+
121+
if [ ! -d "$WEBAPP_DIR/node_modules" ]; then
122+
error "Dependencies not installed in happy webapp"
123+
missing_deps=true
124+
fi
125+
126+
if $missing_deps; then
127+
echo ""
128+
error "Dependencies are not installed. Please run:"
129+
echo ""
130+
echo " make install"
131+
echo ""
132+
echo "This will install all required dependencies for happy-cli, happy-server, and happy webapp."
133+
echo ""
134+
exit 1
135+
fi
136+
}
137+
103138
# =============================================================================
104139
# Port Configuration with Slot Support
105140
# =============================================================================
@@ -907,6 +942,7 @@ test_connection() {
907942

908943
case "${1:-}" in
909944
start)
945+
check_dependencies
910946
info "Starting all services..."
911947
start_postgres
912948
start_redis
@@ -922,6 +958,7 @@ case "${1:-}" in
922958
;;
923959

924960
start-backend)
961+
check_dependencies
925962
info "Starting backend services..."
926963
start_postgres
927964
start_redis
@@ -936,6 +973,7 @@ case "${1:-}" in
936973
;;
937974

938975
start-webapp)
976+
check_dependencies
939977
start_webapp
940978
;;
941979

0 commit comments

Comments
 (0)