Chat Assistant is a full-stack workspace with:
- a Vite + React dashboard client
- a NestJS + Express authentication server for Google SSO
- a Rocket.Chat OpenAI bot that replies in direct messages
client/: frontend clientserver/: NestJS backend for Google OAuth and session authrocket-chat-openai-bot/: Rocket.Chat bot servicerocketchat-compose/: local Rocket.Chat docker setup
- Node.js 18+
- npm
- A Google OAuth client
- An OpenAI API key
- A Rocket.Chat server and bot user token
From the repo root:
npm installAvailable scripts:
npm run dev- run the Vite clientnpm run dev:client- run the Vite clientnpm run dev:server- run the Nest auth servernpm run dev:bot- run the Rocket.Chat botnpm run dev:all- run client, server, and bot togethernpm run build- build the Vite clientnpm run build:server- build the Nest servernpm run rocket- start the local Rocket.Chat stack fromrocketchat-compose
npm run dev:all uses concurrently, so make sure root dependencies are installed first.
The client runs on http://localhost:8080.
Frontend env is optional in local development because Vite proxies /auth to the Nest server.
See .env.example.
Run only the client:
npm run dev:clientThe backend is a NestJS app using Express sessions and Google OAuth.
It runs on http://localhost:3001 by default and exposes:
GET /auth/googleGET /auth/google/callbackGET /auth/sessionPOST /auth/logout
Setup:
cd server
npm install
cp .env.example .envRequired values in server/.env:
PORT=3001
CLIENT_URL=http://localhost:8080
SESSION_SECRET=replace-this-session-secret
GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_CALLBACK_URL=http://localhost:3001/auth/google/callback
SESSION_COOKIE_NAME=chat_assistant_session
SESSION_COOKIE_SECURE=falseGoogle OAuth configuration:
- Authorized JavaScript origin:
http://localhost:3001 - Authorized redirect URI:
http://localhost:3001/auth/google/callback
Run only the server:
npm run dev:serverThe bot lives in rocket-chat-openai-bot/ and uses token-based Rocket.Chat auth with X-Auth-Token and X-User-Id.
It ignores existing messages when it first syncs a room, so it only replies to new ones after startup.
Setup:
cd rocket-chat-openai-bot
npm install
cp .env.example .envKey bot env values:
RC_URLROCKET_USER_TOKENROCKET_USER_IDOPENAI_API_KEY
Run only the bot:
npm run dev:botFor full bot configuration, see rocket-chat-openai-bot/README.md.
Start everything together from the repo root:
npm run dev:allOr run services separately:
npm run dev:server
npm run dev:client
npm run dev:bot- Vite
- React
- TypeScript
- NestJS
- Express
- Google OAuth
- Rocket.Chat
- OpenAI API
- Tailwind CSS
- Radix UI