Skip to content

Commit 6f82265

Browse files
Init deep sea stories example (#1)
* Init deep sea stories example * Add CI * Add yarnrc * Update CI * Format * Add engines to package.json * Use node version file * Move typescript to root package.json * Some backend boilerplate * Init vite * Use biome * Add build script * Format * Setup tRPC in the backend * Add tRPC to web * Remove redundant ignore comment * Update lock * Init theme * Format and lint * Include fishjam * Draft backend * format * /Agent integration left * lint, format * elevenlabs integration * format, lint * Basic UI * story selection api * extract game starting stopping to separate file * almost works * adjust sample rate to elevenlabs's default * apply comment suggestions * throw when room nonempty with no fishjam agent * apply comment suggestions * fix adding peer during game logic * Safelist grid cols * builting websocket, implement creating agent using elevenlabs-js * utilize nunjucks add interface for sessions and conversations, add id to stories * add tests to CI * use globalSetup in tests * format * refactor * add common types package, adjust adjust format bar * readable-slug ref * make sure grid is displayed correctly * fmt * comment suggestiosn * make backend work again * scope common package * choosing and starting game, agent audio working * format, lint * format * deployment * correct project path * make docker compose work * remove healthchecks, add nginx * remove healthcheck from deployment * make backend build work * remove waiting 5 seconds after deploying * bump react client, apply comments * bump react-client * comment suggestions * make sure deploy works * maybe now * deploy code from main --------- Co-authored-by: Bernard Gawor <gaworbernard@gmail.com> Co-authored-by: Bernard Gawor <81643606+Gawor270@users.noreply.github.com>
1 parent 1391804 commit 6f82265

Some content is hidden

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

94 files changed

+8196
-0
lines changed

.github/workflows/CI.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
deep-sea-stories:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: deep-sea-stories
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v5
18+
19+
- name: Enable corepack
20+
run: corepack enable
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v5
24+
with:
25+
node-version-file: ./deep-sea-stories/package.json
26+
cache: yarn
27+
cache-dependency-path: ./deep-sea-stories/yarn.lock
28+
29+
- name: Install dependencies
30+
run: yarn --immutable
31+
32+
- name: Run format
33+
run: yarn format:check
34+
35+
- name: Run lint
36+
run: yarn lint
37+
38+
- name: Run backend tests
39+
run: yarn workspace backend test
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy deep-sea-stories
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Deploy
13+
uses: appleboy/ssh-action@v0.1.7
14+
with:
15+
host: ${{ secrets.VM_HOST }}
16+
username: ${{ secrets.VM_USERNAME }}
17+
key: ${{ secrets.VM_SSH_KEY }}
18+
script: |
19+
cd ~/examples/deep-sea-stories
20+
git switch main
21+
git pull
22+
23+
umask 077
24+
cat > .env << 'EOF'
25+
26+
FISHJAM_ID=${{ secrets.FISHJAM_ID }}
27+
FISHJAM_MANAGEMENT_TOKEN=${{ secrets.FISHJAM_MANAGEMENT_TOKEN }}
28+
ELEVENLABS_API_KEY=${{ secrets.ELEVENLABS_API_KEY }}
29+
30+
EOF
31+
32+
docker compose down
33+
docker compose up -d --build

deep-sea-stories/.gitignore

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
### Node ###
2+
# Logs
3+
logs
4+
*.log
5+
npm-debug.log*
6+
yarn-debug.log*
7+
yarn-error.log*
8+
lerna-debug.log*
9+
.pnpm-debug.log*
10+
11+
# Diagnostic reports (https://nodejs.org/api/report.html)
12+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
13+
14+
# Runtime data
15+
pids
16+
*.pid
17+
*.seed
18+
*.pid.lock
19+
20+
# Directory for instrumented libs generated by jscoverage/JSCover
21+
lib-cov
22+
23+
# Coverage directory used by tools like istanbul
24+
coverage
25+
*.lcov
26+
27+
# nyc test coverage
28+
.nyc_output
29+
30+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
31+
.grunt
32+
33+
# Bower dependency directory (https://bower.io/)
34+
bower_components
35+
36+
# node-waf configuration
37+
.lock-wscript
38+
39+
# Compiled binary addons (https://nodejs.org/api/addons.html)
40+
build/Release
41+
42+
# Dependency directories
43+
node_modules/
44+
jspm_packages/
45+
46+
# Snowpack dependency directory (https://snowpack.dev/)
47+
web_modules/
48+
49+
# TypeScript cache
50+
*.tsbuildinfo
51+
52+
# Optional npm cache directory
53+
.npm
54+
55+
# Optional eslint cache
56+
.eslintcache
57+
58+
# Optional stylelint cache
59+
.stylelintcache
60+
61+
# Microbundle cache
62+
.rpt2_cache/
63+
.rts2_cache_cjs/
64+
.rts2_cache_es/
65+
.rts2_cache_umd/
66+
67+
# Optional REPL history
68+
.node_repl_history
69+
70+
# Output of 'npm pack'
71+
*.tgz
72+
73+
# Yarn Integrity file
74+
.yarn-integrity
75+
76+
# dotenv environment variable files
77+
.env
78+
.env.development.local
79+
.env.test.local
80+
.env.production.local
81+
.env.local
82+
83+
# parcel-bundler cache (https://parceljs.org/)
84+
.cache
85+
.parcel-cache
86+
87+
# Next.js build output
88+
.next
89+
out
90+
91+
# Nuxt.js build / generate output
92+
.nuxt
93+
dist
94+
95+
# Gatsby files
96+
.cache/
97+
# Comment in the public line in if your project uses Gatsby and not Next.js
98+
# https://nextjs.org/blog/next-9-1#public-directory-support
99+
# public
100+
101+
# vuepress build output
102+
.vuepress/dist
103+
104+
# vuepress v2.x temp and cache directory
105+
.temp
106+
107+
# Docusaurus cache and generated files
108+
.docusaurus
109+
110+
# Serverless directories
111+
.serverless/
112+
113+
# FuseBox cache
114+
.fusebox/
115+
116+
# DynamoDB Local files
117+
.dynamodb/
118+
119+
# TernJS port file
120+
.tern-port
121+
122+
# Stores VSCode versions used for testing VSCode extensions
123+
.vscode-test
124+
125+
# yarn v2
126+
.yarn/cache
127+
.yarn/unplugged
128+
.yarn/build-state.yml
129+
.yarn/install-state.gz
130+
.pnp.*
131+
132+
### Node Patch ###
133+
# Serverless Webpack directories
134+
.webpack/
135+
136+
# Optional stylelint cache
137+
138+
# SvelteKit build / generate output
139+
.svelte-kit
140+
141+
### react ###
142+
.DS_*
143+
**/*.backup.*
144+
**/*.back.*
145+
146+
node_modules
147+
148+
*.sublime*
149+
150+
psd
151+
thumb
152+
sketch
153+
154+
### yarn ###
155+
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
156+
157+
.yarn/*
158+
!.yarn/releases
159+
!.yarn/patches
160+
!.yarn/plugins
161+
!.yarn/sdks
162+
!.yarn/versions
163+
164+
# if you are NOT using Zero-installs, then:
165+
# comment the following lines
166+
!.yarn/cache
167+
168+
# and uncomment the following lines
169+
# .pnp.*
170+

deep-sea-stories/.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

deep-sea-stories/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Deep Sea Stories Example App

deep-sea-stories/biome.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
7+
},
8+
"files": {
9+
"includes": ["**", "!**/dist"],
10+
"ignoreUnknown": false
11+
},
12+
"formatter": {
13+
"enabled": true,
14+
"indentStyle": "tab"
15+
},
16+
"linter": {
17+
"enabled": true,
18+
"rules": {
19+
"recommended": true
20+
}
21+
},
22+
"javascript": {
23+
"formatter": {
24+
"quoteStyle": "single"
25+
}
26+
},
27+
"assist": {
28+
"enabled": true,
29+
"actions": {
30+
"source": {
31+
"organizeImports": "on"
32+
}
33+
}
34+
}
35+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
services:
2+
backend:
3+
build:
4+
context: .
5+
dockerfile: packages/backend/Dockerfile
6+
ports:
7+
- "8000:8000"
8+
environment:
9+
- NODE_ENV=production
10+
- PORT=8000
11+
- FISHJAM_ID=${FISHJAM_ID}
12+
- FISHJAM_MANAGEMENT_TOKEN=${FISHJAM_MANAGEMENT_TOKEN}
13+
- ELEVENLABS_API_KEY=${ELEVENLABS_API_KEY}
14+
restart: unless-stopped
15+
16+
web:
17+
build:
18+
context: .
19+
dockerfile: packages/web/Dockerfile
20+
args:
21+
- VITE_FISHJAM_ID=${FISHJAM_ID}
22+
- VITE_BACKEND_URL=${BACKEND_URL:-http://nginx/api}
23+
environment:
24+
- VITE_BACKEND_URL=http://nginx/api
25+
restart: unless-stopped
26+
depends_on:
27+
- backend
28+
29+
nginx:
30+
image: nginx:alpine
31+
ports:
32+
- "5000:80"
33+
volumes:
34+
- ./nginx.conf:/etc/nginx/nginx.conf:ro
35+
depends_on:
36+
- backend
37+
- web
38+
restart: unless-stopped

0 commit comments

Comments
 (0)