Skip to content

Commit 1a15a86

Browse files
authored
Add deploy scripts, env-based config, and docs updates (#18)
* Add environment-aware token server URL and deploy-website script Replace hardcoded token server URLs in Widget.astro and Head.astro with PUBLIC_SERVER_URL env var, allowing localhost for dev and a deployer-provided URL for production. Add deploy-website npm script, env var guard in the deploy shell script, .env.example template, and TypeScript env declaration. * Enable interactive highlights in astrophotography demo * Add deploy-token-server npm script with .env support Add deploy-token-server script to package.json, create root .env.example for GCP_PROJECT_ID, and update deploy-token-server.sh to source root .env when the env var is not already set. * Update README with logo, badges, setup docs, and add LICENSE Add ArionTalk logo variants (light/dark) with GitHub picture element, Gemini Live and Chrome badges, env file setup in Development section, updated token server deployment docs, and MIT license file. * Update favicon to use accent logo * Serve logo from ariontalk.com and add public logo images
1 parent 6fe47a7 commit 1a15a86

16 files changed

Lines changed: 171 additions & 37 deletions

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Google Cloud project ID — required for Cloud Run deployments (deploy-token-server).
2+
GCP_PROJECT_ID=your-gcp-project-id
3+
4+
# GCP region — optional, defaults to us-central1.
5+
# GCP_REGION=us-central1

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Luis Aviles
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
1-
# ArionTalk
1+
# ArionTalk - Voice AI Agent for Any Website
2+
3+
<p align="center">
4+
<picture>
5+
<source media="(prefers-color-scheme: light)" srcset="https://ariontalk.com/images/logo-full-light.svg" />
6+
<source media="(prefers-color-scheme: dark)" srcset="https://ariontalk.com/images/logo-full-dark.svg" />
7+
<img src="https://ariontalk.com/images/logo-full-light.svg" alt="ArionTalk Logo" width="200" />
8+
</picture>
9+
</p>
10+
11+
<p align="center">
12+
<a href="https://www.typescriptlang.org/">
13+
<img src="https://img.shields.io/badge/TypeScript-5.x-blue?logo=typescript" alt="TypeScript" />
14+
</a>
15+
<a href="https://nodejs.org/">
16+
<img src="https://img.shields.io/badge/Node.js-22%2B-green?logo=node.js" alt="Node.js" />
17+
</a>
18+
<a href="https://ai.google.dev/gemini-api/docs/live">
19+
<img src="https://img.shields.io/badge/Gemini_Live-API-8E75B2?logo=googlegemini&logoColor=white" alt="Gemini Live" />
20+
</a>
21+
<a href="https://www.google.com/chrome/">
22+
<img src="https://img.shields.io/badge/Chrome-139%2B-4285F4?logo=googlechrome&logoColor=white" alt="Chrome 139+" />
23+
</a>
24+
<a href="https://opensource.org/licenses/MIT">
25+
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" />
26+
</a>
27+
</p>
228

329
A voice AI agent that understands your webpage — reads your content, sees your images, and highlights what it's talking about. Powered by Gemini Live.
430

@@ -151,14 +177,19 @@ git clone https://github.com/luixaviles/ariontalk.git
151177
cd ariontalk
152178
pnpm install
153179
pnpm build
180+
181+
# Configure environment
182+
cp packages/token-server/.env.example packages/token-server/.env
183+
# Edit packages/token-server/.env and add your GEMINI_API_KEY
184+
185+
cp website/.env.example website/.env
186+
# Defaults to http://localhost:3001 — no changes needed for local dev
154187
```
155188

156189
### Run with Gemini Live
157190

158191
```bash
159192
# Terminal 1: Start the token server
160-
cp packages/token-server/.env.example packages/token-server/.env
161-
# Edit .env and add your GEMINI_API_KEY
162193
pnpm token-server
163194
# Runs on http://localhost:3001
164195

@@ -184,27 +215,32 @@ pnpm test
184215

185216
### Token Server on Google Cloud Run
186217

187-
The token server is a lightweight Node.js HTTP server built with [Hono](https://hono.dev/). Deploy it to Google Cloud Run:
218+
**One-time GCP setup:**
188219

189220
```bash
190-
# Build and deploy
191-
gcloud run deploy ariontalk-token-server \
192-
--source packages/token-server \
193-
--set-env-vars GEMINI_API_KEY=your-key \
194-
--allow-unauthenticated \
195-
--region us-central1
221+
gcloud auth login
222+
GCP_PROJECT_ID=your-project ./scripts/setup-gcp.sh
196223
```
197224

198-
Then point your widget to the deployed URL:
225+
This enables required APIs, creates an Artifact Registry repository, and stores your `GEMINI_API_KEY` in Secret Manager.
199226

200-
```html
201-
<ariontalk-widget
202-
engine="gemini"
203-
token-server="https://ariontalk-token-server-xxxxx.run.app/api/token"
204-
interactive-highlights
205-
></ariontalk-widget>
227+
Save your project ID so the deploy script picks it up automatically:
228+
229+
```bash
230+
cp .env.example .env
231+
# Edit .env and set GCP_PROJECT_ID
206232
```
207233

234+
**Deploy:**
235+
236+
```bash
237+
pnpm deploy-token-server
238+
```
239+
240+
Builds a Docker image, pushes to Artifact Registry, and deploys to Cloud Run. The `GEMINI_API_KEY` is pulled from Secret Manager at runtime — never passed in plain text.
241+
242+
You can also pass the project ID inline: `GCP_PROJECT_ID=your-project pnpm deploy-token-server`.
243+
208244
## Tech Stack
209245

210246
- **[Gemini Live API](https://ai.google.dev/)** — Real-time multimodal voice streaming with function calling
@@ -222,9 +258,6 @@ Then point your widget to the deployed URL:
222258
| Gemini Live | Any modern browser | Requires WebSocket + microphone access |
223259
| Local | Chrome 139+ | Requires Prompt API origin trial |
224260

225-
## Bundle Size
226-
227-
~12-16 KB gzipped (widget + Lit, excluding engine add-ons).
228261

229262
## License
230263

demo/astrophotography.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ <h2>Getting Started Tonight</h2>
302302
</article>
303303
</main>
304304

305-
<ariontalk-widget id="widget" engine="gemini" token-server="http://localhost:3001/api/token" lang="en" settings log-level="debug"></ariontalk-widget>
305+
<ariontalk-widget id="widget" engine="gemini" token-server="http://localhost:3001/api/token" lang="en" interactive-highlights settings log-level="debug"></ariontalk-widget>
306306
<script type="module">
307307
import '@ariontalk/widget';
308308
import { initToolbar } from './scripts/toolbar.js';

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"test": "pnpm -r test",
1010
"website": "pnpm --filter @ariontalk/website dev",
1111
"website-build": "pnpm --filter @ariontalk/website build",
12-
"website-preview": "pnpm --filter @ariontalk/website preview"
12+
"website-preview": "pnpm --filter @ariontalk/website preview",
13+
"deploy-website": "./scripts/deploy-website.sh",
14+
"deploy-token-server": "./scripts/deploy-token-server.sh"
1315
},
1416
"devDependencies": {
1517
"@changesets/cli": "^2.27.0"

scripts/deploy-token-server.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@ ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
66

77
cd "${ROOT_DIR}"
88

9+
# Load root .env if GCP_PROJECT_ID is not already set
10+
if [ -z "${GCP_PROJECT_ID:-}" ] && [ -f "${ROOT_DIR}/.env" ]; then
11+
set -a
12+
source "${ROOT_DIR}/.env"
13+
set +a
14+
fi
15+
916
# ── Configuration ──
10-
PROJECT_ID="${GCP_PROJECT_ID:?Set GCP_PROJECT_ID env var}"
17+
PROJECT_ID="${GCP_PROJECT_ID:?Set GCP_PROJECT_ID env var or add it to .env}"
1118
REGION="${GCP_REGION:-us-central1}"
1219
SERVICE_NAME="ariontalk-token-server"
1320
REPO_NAME="ariontalk"

scripts/deploy-website.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,28 @@ ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
66

77
cd "${ROOT_DIR}"
88

9+
# Load .env.production if PUBLIC_SERVER_URL is not already set
10+
if [ -z "${PUBLIC_SERVER_URL:-}" ] && [ -f "website/.env.production" ]; then
11+
set -a
12+
source website/.env.production
13+
set +a
14+
fi
15+
16+
# Ensure the production token server URL is set
17+
if [ -z "${PUBLIC_SERVER_URL:-}" ]; then
18+
echo "ERROR: PUBLIC_SERVER_URL is not set."
19+
echo "Set it as an env var or in website/.env.production"
20+
exit 1
21+
fi
22+
923
echo "==> Installing dependencies"
1024
pnpm install --frozen-lockfile
1125

1226
echo "==> Building all packages"
1327
pnpm build
1428

1529
echo "==> Building website"
16-
pnpm website-build
30+
PUBLIC_SERVER_URL="${PUBLIC_SERVER_URL}" pnpm website-build
1731

1832
echo "==> Deploying to Firebase Hosting"
1933
firebase deploy --only hosting

website/.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Base URL of the token server — the widget appends /api/token automatically.
2+
# For local development, run `pnpm token-server` and use the default below.
3+
# For production, create .env.production with your deployed token server URL.
4+
# Example: PUBLIC_SERVER_URL=https://my-token-server-xxxxx.us-central1.run.app
5+
PUBLIC_SERVER_URL=http://localhost:3001

website/public/favicon.svg

Lines changed: 6 additions & 11 deletions
Loading
Lines changed: 11 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)