This repository hosts a chat platform that bridges external messaging channels with a custom frontend built in Svelte and a backend powered by Rust Actix Web. LINE is the first connector, but the architecture allows adding other platforms (e.g. Facebook Messenger, WhatsApp, web chat) without rewriting the operator experience. The backend is responsible for serving the compiled frontend bundle, exposing APIs, and relaying webhook events so operators get a seamless experience when replying to customers, managing context, and extending the conversation with internal tooling.
frontend/dist
and mounted as static assets inside the Actix service..
├── frontend/ # SvelteKit app (chat console, operator tools)
├── backend/ # Actix services, domain logic, integrations
├── infra/ # Docker Compose, infrastructure as code, deployment manifests
├── docs/ # Architecture docs, task lists, integration guides
├── scripts/ # Helper scripts (database migrations, data import)
└── README.md
rustup
, cargo
and the wasm32-unknown-unknown
target (for potential Svelte adapters).pnpm
(preferred) or npm
.Create a .env
file for both backend and frontend build steps. Suggested keys:
# Backend
DATABASE_URL=postgres://user:password@localhost:5432/line_chat
REDIS_URL=redis://localhost:6379/0
LINE_CHANNEL_SECRET=<line-channel-secret>
LINE_CHANNEL_ACCESS_TOKEN=<line-channel-access-token>
LINE_WEBHOOK_PATH=/line/webhook
FRONTEND_ORIGIN=http://localhost:8080
RUST_LOG=info
# Frontend
VITE_API_BASE_URL=http://localhost:8080
VITE_LINE_LIFF_ID=<optional-liff-id>
rustup target add wasm32-unknown-unknown
pnpm install
cd frontend
pnpm dev
cd backend
cargo run
ngrok
or Cloudflared
and register the public URL with the LINE channel.For integrated testing or production, build the frontend once and let Actix serve the static files:
cd frontend
pnpm build
cd ../backend
cargo run --release # ensure Actix is configured to serve ../frontend/dist
The backend should mount the compiled bundle (e.g. using actix-files
) and fall back to index.html
for client-side routing.
cargo test --all
for backend unit/integration tests. Add structured logging (tracing
) and contract tests for external integrations.pnpm test
/ pnpm check
for frontend unit tests and type checks.cargo-chef
for caching) and deploy to container orchestrators (Fly.io, AWS ECS, Kubernetes, etc.)./frontend/dist
.High-level task breakdown with statuses lives in docs/tasks.md
. Keep it updated as work progresses.