Commit Graph
26 Commits
Author SHA1 Message Date
Developer db021cb1f6 refactor: finalize standalone services cleanup
Build & Deploy / build-and-push (backend) (push) Failing after 39s
Build & Deploy / build-and-push (discord-gateway) (push) Failing after 26s
Build & Deploy / build-and-push (proxy) (push) Failing after 24s
- Remove root pnpm-lock.yaml (stale monorepo lockfile)
- Rename root package from bete-monorepo to bete
- Clean up root scripts to use cd instead of pnpm --prefix
- Remove ignoreScripts/trustedDependencies from frontend package.json
- Optimize Dockerfiles with multi-stage builds and proper layer caching
- Update .dockerignore to exclude build artifacts
- Remove leftover pnpm test config file from frontend
2026-07-30 12:14:24 +07:00
Developer dcd13482c2 refactor: break monorepo into 3 standalone services (gateway, backend, frontend)
Build & Deploy / build-and-push (backend) (push) Failing after 35s
Build & Deploy / build-and-push (discord-gateway) (push) Failing after 25s
Build & Deploy / build-and-push (proxy) (push) Failing after 25s
- Remove pnpm workspace, moon repo, and all monorepo tooling
- Delete packages/shared/, embed shared code directly into each service
- Copy packages/shared/src/* -> services/backend/src/shared/ and services/discord-gateway/src/shared/
- Replace all @bete/shared imports with @/shared/ path alias
- Remove @bete/shared workspace dependency from both services
- Update root package.json scripts from --filter to --prefix
- Rewrite Dockerfiles to build each service standalone
- Clean up biome.json, .gitignore, remove root drizzle.config.ts
2026-07-30 11:50:48 +07:00
DeveloperandClaude Opus 4.8 7bebb23c1d fix: add disk cleanup to CI and reduce Docker layers
Build & Deploy / build-and-push (backend) (push) Successful in 7m34s
Build & Deploy / build-and-push (discord-gateway) (push) Failing after 8m19s
Build & Deploy / build-and-push (proxy) (push) Failing after 1m12s
Runner runs out of disk space during discord-gateway build.
Add docker system prune before build and combine Dockerfile
layers to reduce disk usage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 15:47:23 +07:00
DeveloperandClaude Opus 4.8 8d0f505784 fix: add --legacy flag to pnpm deploy for pnpm v11 compatibility
Build & Deploy / build-and-push (backend) (push) Successful in 27s
Build & Deploy / build-and-push (discord-gateway) (push) Failing after 8m1s
Build & Deploy / build-and-push (proxy) (push) Failing after 8m2s
pnpm v11 requires --legacy flag (or inject-workspace-packages=true)
for pnpm deploy to work with non-injected workspace packages.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-27 22:06:13 +07:00
DeveloperandClaude Opus 4.8 5802d02e29 refactor: large codebase cleanup - consolidate schemas, migrate to Drizzle ORM, extract frontend components, modernize Docker builds
Build & Deploy / build-and-push (discord-gateway) (push) Failing after 2m22s
Build & Deploy / build-and-push (backend) (push) Failing after 3m22s
Build & Deploy / build-and-push (proxy) (push) Successful in 1m36s
Build & Deploy / deploy (push) Skipped
- Consolidate all DB schema definitions into packages/shared as single source of truth
- Migrate backend from raw SQL to Drizzle ORM across all modules
- Extract frontend inline UI into separate component files
- Refactor discord-gateway circuitBreaker into conversationState + moderationState
- Convert messageStore to Proxy singleton pattern
- Add validateBody/validateQuery middleware + Zod schemas for API endpoints
- Modernize Docker builds with multi-stage + pnpm deploy
- Migrate CI/CD from deployment to image-based pipeline
- Remove 60+ unused/dead files (~15K lines)
- Update color scheme from sky-blue to teal-cyan
- Move DB connection management to @bete/shared/database

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-27 21:54:31 +07:00
asepharyana fa82593a38 fix: switch to node:22-slim, install deps from npm, remove vendor 2026-07-02 04:07:18 +07:00
asepharyana d37cecdb38 Revert "fix(Dockerfile): use node:22-slim for backend (glibc), add linux-headers + nodedir for gateway"
This reverts commit 9e8f4377af.
2026-07-02 03:54:44 +07:00
asepharyana 81f541c080 Revert "fix(Dockerfile): switch discord-gateway to node:22-slim for opus compatibility"
This reverts commit 51d3e47fe3.
2026-07-02 03:54:44 +07:00
asepharyana c408a8d1f7 Revert "fix(Dockerfile): install Rust via rustup for node-crc compatibility"
This reverts commit 0200c77fc2.
2026-07-02 03:54:44 +07:00
asepharyana 0200c77fc2 fix(Dockerfile): install Rust via rustup for node-crc compatibility 2026-07-02 02:29:36 +07:00
asepharyana 51d3e47fe3 fix(Dockerfile): switch discord-gateway to node:22-slim for opus compatibility 2026-07-02 02:26:34 +07:00
asepharyana 9e8f4377af fix(Dockerfile): use node:22-slim for backend (glibc), add linux-headers + nodedir for gateway 2026-07-02 02:22:09 +07:00
MythEclipse f04b0f0b42 refactor(voice): optimize recording pipeline and improve performance
Refactor the voice recording and playback systems to improve efficiency, reduce latency, and enhance Docker build performance.

- **Infrastructure**: Optimize Dockerfiles using build mounts for pnpm cache and reorder layers for better caching of dependencies and build tools.
- **Backend/Gateway**:
  - Refactor `broadcast` module to use a generic event-based system instead of hardcoded functions.
  - Simplify voice recording logic by merging metadata and segment management into a unified `segment.ts`.
  - Optimize audio downsampling in `streamSetup.ts` using `Int16Array` views for better performance.
  - Implement `withFallback` utility for more robust Redis/Database command execution.
- **Frontend**:
  - Optimize audio playback visualization using pre-computed level shapes and efficient RMS calculation.
  - Reduce latency in voice commands by prioritizing WebSocket communication over HTTP.
  - Improve base64 encoding efficiency in audio transmission.
- **General**:
  - Add default value for `ADMIN_PASSWORD` in shared config.
  - Fix Docker healthcheck to use `127.0.0.1` instead of `localhost`.
2026-06-09 22:04:05 +07:00
MythEclipseandClaude Opus 4.8 3fcc727187 fix(docker): add ffmpeg to discord-gateway for voice transmit
Voice transmitter requires FFmpeg to encode PCM to OggOpus.
Previously missing from Alpine image, causing:
  spawn ffmpeg ENOENT

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 22:31:16 +07:00
MythEclipse 6f4053c1cc fix(docker): add build tools for native dependencies in discord-gateway
Install python3, make, g++, rust, and cargo in Alpine image to resolve:
- node-crc native build failure (requires cargo)
- @discordjs/opus native build issues (requires build tools)

This fixes the GitHub Actions build failure in the discord-gateway service.
2026-06-08 20:16:47 +07:00
MythEclipseandClaude Opus 4.8 <noreply@anthropic.com d036fbf568 opt(deploy): multi-stage frontend (node→nginx), non-root user, healthchecks, resource limits
Frontend:
- Multi-stage build: builder (node:22-alpine) → runner (nginx:alpine)
  replaces vite preview (400MB RAM) with nginx static serving (<20MB RAM)
- New nginx-frontend.conf with gzip + long-term asset cache + SPA fallback

Backend & Discord Gateway:
- Add non-root user (USER app) for container security
- chown app files to avoid permission issues
- Add HEALTHCHECK: backend via /api/health, gateway via kill -0 1

Docker Compose:
- Remove unnecessary backend→gateway depends_on
- Add deploy.resources.limits.memory for all services
- Add healthchecks for all services

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com
2026-06-08 17:51:29 +07:00
MythEclipseandClaude Opus 4.8 0f32c2a83a fix(docker): build @bete/shared before backend and discord-gateway
@bete/shared emits dist/ artifact; imports resolve via
package.json "main"/"exports" pointing to dist/. Both
services need the shared package built before `tsc` sees it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 23:38:07 +07:00
MythEclipseandClaude Opus 4.8 cd181698bc fix(docker): copy packages/shared workspace dependency into backend and discord-gateway containers
Both services import from @bete/shared but Dockerfiles were missing the
packages/shared/ copy step, causing tsc errors on build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 23:33:53 +07:00
MythEclipseandClaude Opus 4.8 88a1b59f02 fix(docker): copy patches directory for pnpm patchedDependencies
pnpm install --frozen-lockfile fails in Docker with ENOENT when
pnpm-lock.yaml references patched dependencies (jsdoc@3.6.11.patch)
but the patches/ directory is not copied into the container.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 23:31:12 +07:00
MythEclipseandClaude Opus 4.6 e2c1197caf fix(discord-gateway): generate Drizzle migrations and copy to Docker image
Container crashed with 'Can't find meta/_journal.json file' because
Drizzle ORM migration files were never generated. Generated migrations
for all 10 schema tables and updated Dockerfile to copy drizzle/ to
/app/drizzle/ where the migrator expects them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 22:52:03 +07:00
MythEclipseandClaude Opus 4.6 3afa6298e3 refactor(monorepo): remove root package deps, simplify Dockerfiles
Root package.json no longer a workspace member — no src/, no 38 shared
dependencies. Root is now workspace config with dev tooling only (biome,
drizzle-kit, tsx, typescript).

This means Dockerfiles only need:
- pnpm-workspace.yaml + pnpm-lock.yaml + package.json (workspace config)
- The specific service being built
- Only vendor/ packages that service actually depends on (discord-gateway → discord.js-selfbot-v13)

Before: each Dockerfile copied src/, vendor/*, packages/*, all services/
After: each Dockerfile copies only its service + needed vendor deps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 22:47:47 +07:00
MythEclipseandClaude Opus 4.6 a9fa22262e fix(docker): correct CMD paths for service builds
- backend: node services/backend/dist/index.js (not dist/index.js)
- discord-gateway: node services/discord-gateway/dist/index.js
- frontend: pnpm --filter preview instead of root dev:web (missing frontend/ dir)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 22:42:45 +07:00
MythEclipseandClaude Opus 4.6 30b03c68b1 fix(docker): copy all workspace packages and root src to Dockerfiles
pnpm install --frozen-lockfile at workspace root requires ALL workspace
members to be present. Previously vendor/ packages and root src/ were
missing, causing TS2307 'Cannot find module' errors during build.

- Copy vendor/ (discord.js-selfbot-v13, discord-video-stream, better-sqlite3, drizzle-orm)
- Copy root src/ and vite.backend.config.ts
- Copy all services/ to each Dockerfile
- Copy frontend/ and public/ assets to frontend Dockerfile

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 22:09:51 +07:00
MythEclipseandClaude Opus 4.6 e6668ffe51 fix(docker): use pnpm --filter to build each service in Dockerfiles
Root scripts point to old paths (src/, frontend/) that don't exist in the
services/ monorepo layout. Use pnpm --filter to invoke each service's
own build script (tsc) instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 22:05:00 +07:00
MythEclipseandClaude Opus 4.6 37ab92e7ea fix(docker): upgrade all Dockerfiles to node:22-alpine for pnpm v10 compatibility
pnpm v10+ requires the built-in `node:sqlite` module which is only available
in Node 22+. All services now use node:22-alpine.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 22:01:35 +07:00
MythEclipseandClaude Opus 4.8 c48a0c5e3b refactor: split monolith into 3 microservices (frontend, backend, discord-gateway)
- Extract services into services/{frontend,backend,discord-gateway}
- Create packages/shared/ for shared logger, errors, utils, types
- Setup Modular MVC pattern in backend (controller→service→repository)
- Setup event-driven architecture in discord-gateway with Redis pub/sub
- Move Docker files to infra/docker/ with per-service Dockerfiles
- Update docker-compose.yml to use Traefik-only routing (no port exposes)
- Update GitHub Actions deploy workflow for multi-service matrix build
- Fix all import paths and resolve type errors across all services
- All 3 services pass tsc --noEmit clean

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 21:44:29 +07:00