Your music, beautifully tracked. All yours. (coming soon) teal.fm
teal-fm atproto

wip

+55 -21
+9
.env.template
···
··· 1 + NODE_ENV=development 2 + PORT=3000 3 + HOST=localhost 4 + PUBLIC_URL= 5 + DB_USER= 6 + DID_WEB_PUBKEY= 7 + DB_PASSWORD= 8 + DB_NAME= 9 + DATABASE_URL="postgresql://${DB_USER}:${DB_PASSWORD}@localhost:5432/${DB_NAME}"
+1
.gitignore
··· 46 **/*.log 47 package-lock.json 48 **/*.bun
··· 46 **/*.log 47 package-lock.json 48 **/*.bun 49 + .idea
+3 -3
apps/aqua/Dockerfile
··· 5 WORKDIR /app 6 7 # Copy root workspace files 8 - COPY package.json bun.lockb ./ 9 10 # Copy turbo.json 11 COPY turbo.json ./ ··· 22 RUN bun install 23 24 # Build workspace packages (if needed) 25 - RUN bun run build --filter=@teal/db 26 - RUN bun run build --filter=@teal/lexicons 27 28 # Build the aqua app 29 WORKDIR /app/apps/aqua
··· 5 WORKDIR /app 6 7 # Copy root workspace files 8 + COPY package.json ./ 9 10 # Copy turbo.json 11 COPY turbo.json ./ ··· 22 RUN bun install 23 24 # Build workspace packages (if needed) 25 + RUN bun run build --filter=@teal/db --filter !@teal/amethyst 26 + RUN bun run build --filter=@teal/lexicons --filter !@teal/amethyst 27 28 # Build the aqua app 29 WORKDIR /app/apps/aqua
+1 -1
apps/aqua/src/index.ts
··· 84 logger.info( 85 `Listening on ${ 86 info.address == '::1' 87 - ? 'http://0.0.0.0' 88 : // TODO: below should probably be https:// 89 // but i just want to ctrl click in the terminal 90 'http://' + info.address
··· 84 logger.info( 85 `Listening on ${ 86 info.address == '::1' 87 + ? `http://${env.HOST}` 88 : // TODO: below should probably be https:// 89 // but i just want to ctrl click in the terminal 90 'http://' + info.address
+17 -15
compose.dev.yml
··· 10 - app_network 11 depends_on: 12 - postgres 13 - - redis 14 env_file: 15 - .env 16 # traefik: 17 # image: traefik:v2.10 18 # container_name: traefik ··· 31 # extra_hosts: 32 # - "host.docker.internal:host-gateway" # This allows reaching host machine 33 34 - # postgres: 35 - # image: postgres:latest 36 - # container_name: postgres_db 37 - # environment: 38 - # POSTGRES_USER: postgres 39 - # POSTGRES_PASSWORD: yourpassword 40 - # POSTGRES_DB: yourdatabase 41 - # ports: 42 - # - "5432:5432" 43 - # volumes: 44 - # - postgres_data:/var/lib/postgresql/data 45 - # networks: 46 - # - app_network 47 48 # redis: 49 # image: redis:latest ··· 62 63 volumes: 64 postgres_data: 65 - redis_data:
··· 10 - app_network 11 depends_on: 12 - postgres 13 env_file: 14 - .env 15 + postgres: 16 + image: postgres:latest 17 + container_name: postgres_db 18 + environment: 19 + POSTGRES_USER: ${DB_USER} 20 + POSTGRES_PASSWORD: ${DB_PASSWORD} 21 + POSTGRES_DB: ${DB_NAME} 22 + ports: 23 + - "5432:5432" 24 + volumes: 25 + - postgres_data:/var/lib/postgresql/data 26 + extra_hosts: 27 + - "host.docker.internal:host-gateway" 28 + networks: 29 + - app_network 30 + env_file: .env 31 # traefik: 32 # image: traefik:v2.10 33 # container_name: traefik ··· 46 # extra_hosts: 47 # - "host.docker.internal:host-gateway" # This allows reaching host machine 48 49 50 # redis: 51 # image: redis:latest ··· 64 65 volumes: 66 postgres_data: 67 + # redis_data:
+2 -1
package.json
··· 9 "typecheck": "pnpm -r exec tsc --noEmit", 10 "fix": "biome lint --apply . && biome format --write . && biome check . --apply", 11 "nuke": "rimraf node_modules */*/node_modules", 12 - "lex:gen-server": "turbo lex:gen-server" 13 }, 14 "dependencies": { 15 "@atproto/oauth-client": "^0.3.8"
··· 9 "typecheck": "pnpm -r exec tsc --noEmit", 10 "fix": "biome lint --apply . && biome format --write . && biome check . --apply", 11 "nuke": "rimraf node_modules */*/node_modules", 12 + "lex:gen-server": "turbo lex:gen-server", 13 + "db:migrate": "cd ./packages/db && drizzle-kit migrate" 14 }, 15 "dependencies": { 16 "@atproto/oauth-client": "^0.3.8"
+9
packages/db/drizzle.config.ts
··· 1 import { defineConfig } from "drizzle-kit"; 2 3 export default defineConfig({ 4 dialect: "postgresql",
··· 1 import { defineConfig } from "drizzle-kit"; 2 + import dotenv from "dotenv"; 3 + import dotenvExpand from "dotenv-expand"; 4 + 5 + //Loads from root .env 6 + dotenvExpand.expand(dotenv.config({ path: '../../.env' })); 7 + //Or can be overridden by .env in the current folder 8 + dotenvExpand.expand(dotenv.config()); 9 + 10 + 11 12 export default defineConfig({ 13 dialect: "postgresql",
+2 -1
packages/db/package.json
··· 18 "postgres": "^3.4.5" 19 }, 20 "devDependencies": { 21 - "@types/node": "^20.17.6" 22 } 23 }
··· 18 "postgres": "^3.4.5" 19 }, 20 "devDependencies": { 21 + "@types/node": "^20.17.6", 22 + "dotenv-expand": "^12.0.2" 23 } 24 }
+11
pnpm-lock.yaml
··· 336 '@types/node': 337 specifier: ^20.17.6 338 version: 20.17.14 339 340 packages/lexicons: 341 dependencies: ··· 3686 3687 dotenv-expand@11.0.7: 3688 resolution: {integrity: sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==} 3689 engines: {node: '>=12'} 3690 3691 dotenv@16.4.7: ··· 11013 domhandler: 5.0.3 11014 11015 dotenv-expand@11.0.7: 11016 dependencies: 11017 dotenv: 16.4.7 11018
··· 336 '@types/node': 337 specifier: ^20.17.6 338 version: 20.17.14 339 + dotenv-expand: 340 + specifier: ^12.0.2 341 + version: 12.0.2 342 343 packages/lexicons: 344 dependencies: ··· 3689 3690 dotenv-expand@11.0.7: 3691 resolution: {integrity: sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==} 3692 + engines: {node: '>=12'} 3693 + 3694 + dotenv-expand@12.0.2: 3695 + resolution: {integrity: sha512-lXpXz2ZE1cea1gL4sz2Ipj8y4PiVjytYr3Ij0SWoms1PGxIv7m2CRKuRuCRtHdVuvM/hNJPMxt5PbhboNC4dPQ==} 3696 engines: {node: '>=12'} 3697 3698 dotenv@16.4.7: ··· 11020 domhandler: 5.0.3 11021 11022 dotenv-expand@11.0.7: 11023 + dependencies: 11024 + dotenv: 16.4.7 11025 + 11026 + dotenv-expand@12.0.2: 11027 dependencies: 11028 dotenv: 16.4.7 11029