Commit Graph
2 Commits
Author SHA1 Message Date
rogee 1535e6cd55 Decouple frontend from Rails, establish pnpm workspace dev workflow
Strip the Chatwoot frontend down to a standalone Vite + Vue 3 SPA that talks
directly to the GoChat Go backend — no Ruby/Rails required.

Deleted from frontend/ (all Rails-only):
- Ruby: Gemfile, Gemfile.lock, config.ru, Capfile, Rakefile, bin/ (binstubs),
  config/ (application/boot/environment/routes/initializers/environments/locales),
  app/helpers/ (*.rb), app/views/ (ERB/jbuilder), app/assets/ (administrate scss)
- Enterprise overlay (enterprise/ — pure Ruby/jbuilder, zero JS)
- Infra: Procfile*, docker-compose*, docker/, deployment/, swagger/, .circleci/,
  .devcontainer/, .qlty/, .codegraph/, .windsurf/, .github/, .vscode/, .husky/
- Lint/config: .rubocop.yml, .scss-lint.yml, .rspec, rubocop/, .bundler-audit.yml,
  .annotaterb.yml, .all-contributorsrc, crowdin.yml, histoire.config.ts, etc.
- Stale frontend/pnpm-lock.yaml (replaced by root workspace lockfile)

Kept (frontend build essentials):
- app/javascript/ (all Vue SPA source — dashboard/widget/sdk/portal/superadmin/survey/v3)
- package.json, vite.config.ts, tailwind.config.js, postcss.config.js
- theme/, vitest.setup.js, .prettierrc

Key decoupling changes:
- vite.config.ts: removed vite-plugin-ruby, added explicit rollupOptions.input
  for all 7 entrypoints + dev-server proxy (/api,/platform,/cable,/health → GoChat)
- index.html: created static SPA entry that injects window.chatwootConfig /
  window.globalConfig (previously done by Rails ERB vueapp.html.erb)
- package.json: renamed @gochat/frontend, removed vite-plugin-ruby/histoire/husky,
  scripts now use plain vite dev/build
- tailwind.config.js: removed enterprise ERB content paths
- markdownEmbeds.js: relocated markdown_embeds.yml into app/javascript/dashboard/config/

Root pnpm workspace:
- package.json: dev:backend (air), dev:frontend (vite), dev (concurrently)
- pnpm-workspace.yaml: frontend as workspace package
- .gitignore: node_modules/, frontend/dist/, frontend build artifacts

Verified: pnpm install + vite build succeeds (4446 modules, all 7 entrypoints
produce JS+CSS chunks in dist/).
2026-07-07 15:37:24 +08:00
rogee 321c61aaae Vendor Chatwoot Vue 3 frontend into frontend/
Copy the Chatwoot (v4.14.0) frontend runnable subset into frontend/ for
customization:
- app/javascript/ (Vue SPA: dashboard, widget, sdk, portal, superadmin)
- app/views/ (ERB templates for vite-plugin-ruby entrypoint resolution)
- app/helpers/, app/assets/ (Rails view helpers, static assets)
- enterprise/ (Enterprise edition frontend overlay)
- config/vite.json, vite.config.ts, bin/vite (Vite-Rails toolchain)
- package.json, pnpm-lock.yaml, tailwind/postcss/eslint configs
- Gemfile, Gemfile.lock (vite_rails gem for bin/vite binstub)

Excluded Rails backend: controllers, models, services, jobs, mailers,
policies, db, lib, spec, public, node_modules.

Update references to the new frontend location:
- .gitignore: exclude frontend build artifacts (node_modules, tmp, packs),
  keep frontend/bin/ and frontend/vendor/ via negation
- backend/scripts/parity_frontend_smoke.sh: CHATWOOT_DIR default
  reference/chatwoot -> ../frontend
- backend/scripts/parity_frontend_browser_smoke.mjs: same default update
- AGENTS.md: add frontend section with Rails/Vite coupling notes
- README: architecture tree includes frontend/
2026-07-07 14:56:01 +08:00