Skip to content

Commit 5870fa8

Browse files
authored
Add live translation demo (#72)
1 parent 2109ce4 commit 5870fa8

49 files changed

Lines changed: 7095 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

translation-demo/.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Required: your Fishjam ID — the relay's root namespace and the connection path segment.
2+
# MoQ tokens are scoped to paths under it (a stream `<name>` token authorizes `<fishjam-id>/<name>`).
3+
VITE_FISHJAM_ID=ea94930e3ffd47c490f5144c43d57340
4+
5+
# Required: Fishjam sandbox API base URL. The app fetches a MoQ JWT from the sandbox and
6+
# appends it to the relay connection URL as `?jwt=`. Get it at https://fishjam.io/app/sandbox.
7+
VITE_SANDBOX_API_URL=https://fishjam.io/api/v1/connect/ea94930e3ffd47c490f5144c43d57340/room-manager

translation-demo/.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Dependencies
2+
node_modules
3+
4+
# Build output
5+
dist
6+
dist-ssr
7+
*.local
8+
9+
# Env
10+
.env
11+
12+
# Yarn (Berry)
13+
.yarn/*
14+
!.yarn/patches
15+
!.yarn/plugins
16+
!.yarn/releases
17+
!.yarn/sdks
18+
!.yarn/versions
19+
20+
# Logs
21+
*.log
22+
23+
# Editor / OS
24+
.vscode/*
25+
!.vscode/extensions.json
26+
.idea
27+
.DS_Store

translation-demo/.yarnrc.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
nodeLinker: node-modules
2+
3+
packageExtensions:
4+
"@moq/hang@0.2.10":
5+
dependencies:
6+
"@svta/cml-utils": "1.5.0"
7+
"@moq/loc@0.1.1":
8+
dependencies:
9+
zod: "^4.4.3"
10+
"@moq/publish@0.2.15":
11+
dependencies:
12+
zod: "^4.4.3"
13+
"@moq/watch@0.2.17":
14+
dependencies:
15+
zod: "^4.4.3"

translation-demo/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Translation Demo
2+
3+
An example React app that streams over the MoQ protocol with Fishjam, with live audio translation and captions for the viewer.
4+
5+
## Getting Started
6+
7+
Install dependencies:
8+
9+
```bash
10+
yarn
11+
```
12+
13+
Configure the MoQ relay (required):
14+
15+
```bash
16+
cp .env.example .env
17+
# then set VITE_MOQ_URL and VITE_MOQ_FISHJAM_ID in .env to your MoQ relay URL
18+
```
19+
20+
Start the development server:
21+
22+
```bash
23+
yarn dev
24+
```
25+
26+
## Environment Variables
27+
28+
- `VITE_MOQ_URL` (required) — URL of the MoQ relay to connect to. The app has no built-in default and will not connect until this is set.

translation-demo/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Translation Demo</title>
8+
<link rel="preconnect" href="https://fonts.googleapis.com" />
9+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10+
<link
11+
href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
12+
rel="stylesheet" />
13+
</head>
14+
<body>
15+
<div id="root"></div>
16+
<script type="module" src="/src/main.tsx"></script>
17+
</body>
18+
</html>

translation-demo/package.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "@moq/translation-demo",
3+
"private": true,
4+
"version": "0.1.0",
5+
"description": "MoQ streaming demo with live audio translation and captions",
6+
"license": "(MIT OR Apache-2.0)",
7+
"type": "module",
8+
"scripts": {
9+
"dev": "vite",
10+
"build": "tsc && vite build",
11+
"preview": "vite preview"
12+
},
13+
"dependencies": {
14+
"@fishjam-cloud/react-client": "0.28.1",
15+
"@moq/publish": "0.2.15",
16+
"@moq/signals": "0.1.9",
17+
"@moq/watch": "0.2.17",
18+
"@radix-ui/react-icons": "^1.3.2",
19+
"@radix-ui/react-label": "^2.1.0",
20+
"@radix-ui/react-popover": "^1.1.17",
21+
"@radix-ui/react-select": "^2.1.4",
22+
"@radix-ui/react-slot": "^1.1.1",
23+
"@svta/cml-utils": "1.5.0",
24+
"class-variance-authority": "^0.7.0",
25+
"clsx": "^2.1.1",
26+
"lucide-react": "^0.476.0",
27+
"qrcode.react": "^4.2.0",
28+
"react": "^19.0.0",
29+
"react-dom": "^19.0.0",
30+
"react-router": "^7.1.5",
31+
"sonner": "^2.0.3",
32+
"tailwind-merge": "^3.0.2",
33+
"tailwindcss-animate": "^1.0.7",
34+
"unique-names-generator": "^4.7.1"
35+
},
36+
"devDependencies": {
37+
"@types/node": "^22.12.0",
38+
"@types/react": "19.2.17",
39+
"@types/react-dom": "19.2.3",
40+
"@vitejs/plugin-react-swc": "^3.7.2",
41+
"autoprefixer": "^10.4.20",
42+
"postcss": "^8.5.1",
43+
"tailwindcss": "^3.4.17",
44+
"typescript": "^5.7.3",
45+
"vite": "^6.0.11"
46+
},
47+
"packageManager": "yarn@4.6.0"
48+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
};
Lines changed: 10 additions & 0 deletions
Loading
Lines changed: 10 additions & 0 deletions
Loading
Lines changed: 17 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)