A modern chat support application with Slack integration.
- Node.js 20.x or higher
- Docker and Docker Compose
git clone https://github.com/Designveloper/dsv-chat-support
cd dsv-chat-supportEach service has its own env file. Copy both examples:
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.envbackend/.envβ database, Slack, JWT, SMTP. Defaults are pre-filled for local dev; fill in Slack and SMTP after their setup steps.frontend/.envβ frontend-onlyVITE_*vars. Defaults tohttp://localhost:5173for local dev.
The project uses Docker Compose to spin up a MySQL database locally. Make sure Docker and Docker Compose are installed, then run:
docker-compose up -d dbThis starts a MySQL 8.0 container using credentials from your .env file. On first startup, Docker automatically runs db-migration.sql to create all tables β no manual step required. Data is persisted in a named Docker volume (mysql-data).
To verify the database is ready:
docker-compose logs db
# Look for: mysqld: ready for connectionsBefore starting the application, you need a Slack app to enable the Slack integration.
Create a Slack App
- Go to Slack API: Your Apps and click Create New App.
- Choose From scratch, give your app a name, and select your workspace.
Configure OAuth & Permissions
Add the following OAuth scopes under Bot Token Scopes:
channels:historychannels:managechannels:readchannels:joinchat:writechat:write.customizeusers:readusers:read.emailcommands
After adding scopes, click Install App to Workspace.
Copy the Bot User OAuth Token and add it to your .env as SLACK_BOT_TOKEN.
Set the Redirect URL
Under OAuth & Permissions β Redirect URLs, add:
https://<your-domain>/slack/oauth_redirect
If running locally, use ngrok to expose your local backend:
ngrok http 3000
Copy remaining credentials to .env
SLACK_CLIENT_ID=your-client-id
SLACK_CLIENT_SECRET=your-client-secret
SLACK_SIGNING_SECRET=your-signing-secret
SLACK_REDIRECT_URI=https://<your-domain>/slack/oauth_redirectYou can run the full stack (frontend + backend) with Docker Compose, or run each service individually for development.
docker-compose up --build- Frontend: http://localhost
- Backend: http://localhost:3000
To stop all services:
docker-compose downEnvironment for local dev: NestJS reads
backend/.envfrom thebackend/folder. The frontend readsfrontend/.env. Both were already copied in step 2 β no extra steps needed here.
Backend:
cd backend
npm install
npm run start:devThe backend will be available at http://localhost:3000.
Frontend (in a separate terminal):
cd frontend
npm install
npm run devThe frontend dev server will be available at http://localhost:5173 (or as shown in the terminal output).
Important: The backend (and ngrok tunnel, if running locally) must be running before this step. Slack sends a verification challenge to your server, so it needs to be reachable.
-
Go to the Event Subscriptions tab for your Slack app and toggle it on.
-
Set the Request URL to:
https://<your-domain>/slack/eventsSlack will send a
url_verificationchallenge β wait until it shows Verified β. -
Under Subscribe to bot events, click Add Bot User Event and add:
message.channelsβ to receive messages posted in public channels
-
Click Save Changes (the button is only enabled after adding at least one event above).
After the app is running, log in and navigate to the dashboard. Use the Connect Slack option to link your workspace and select a channel for notifications.
To embed the chat widget on your website:
The widget script (chat-widget.js) is not available in dev mode β it requires a production build. Run the following commands from the frontend/ directory:
cd frontend
# Step 1 β build the main app
npm run build
# Step 2 β build the widget bundle
npm run build:widget
# Step 3 β serve the build output (available at http://localhost:4173)
npm run previewNote: You must complete all three steps in order. The widget URL (
http://localhost:4173) only works afterpreviewis running.
<script
src="{VITE_WIDGET_URL}/chat-widget.js"
async
></script>Replace
{VITE_WIDGET_URL}with the preview URL (e.g.http://localhost:4173locally, or your deployed frontend domain in production).
<chat-support-widget widgetid="your-widget-id"></chat-support-widget>You can find your widgetid in your workspace settings.
After adding both snippets, open your website and confirm the chat widget appears. If you encounter any issues, please contact our support team.
Open an issue or contact the maintainers for support.