Section 001, Slack API, JavaScript, Bolt, Node.js Python, MongoDB, Google Gemini, Generative AI, Render.
This project aims to develop a novel application capable of collecting and organizing message data contained in company communication platforms such as Slack. The application will be able to structure any message data across different channels and users into a consistent data model once it is granted proper permissions to access a channel or user direct messaging. The resulting organized data can then be used in multiple workplace tasks such as automating regularly performed actions or summarizing projects for newly onboarded team members.
The application will primarily function as a tool compatible with Slack that can extract context from direct messages (DMs) between users and channels/conversations between multiple users. The tool operates within Slack's interface through a bot or similar automation, meaning that users will adjust the application's settings or control whether they consent to their messages being collected through the application directly. When a user begins a DM or enters a conversation where the bot is configured, the user is prompted to give permission for all message data to be collected (either via an opt-in or hybrid approval). If active, the tool marks whenever a new message within the DM or conversation has been stored in memory for contextualization. When the user wishes to retrieve their structured message data, they can prompt the tool within Slack, which will result in the application displaying a basic data model of all included messages in a digestable format, which can be directly downloaded or accessed for the use of context-based automation at a larger scale, such as for summarizing entire channel's worth of information.
For the scope of our project, our application's design will utilize the Slack API to access all user, message, and channel data, but development of a codebase compatible with multiple communication platforms is anticipated. For the best compatibility with the existing Web API that communication platforms generally provide, the application will integrate with the target platform using routes composed in JavaScript and Node.js; this version of the app specifically will leverege the Bolt for JavaScript open-source framework in the backend designed directly for Slack, allowing both the access of Slack data and interaction with Slack's UI. The tool's backend also will have the ability to extract context and structure data into meaningful units, accomplished through a custom built LLM or similar NLP model designed for organizing data based on learned language patterns. The tools used to implement this may shift as the project scope is fully defined, but possible services include the LangChain framework for Python or JavaScript or the LangExtract Python library. All instances of raw user and message data, as well as all the resulting strucutred conversation data will be placed in a persistent storage source such as MongoDB or NoSQL.
Communication platforms like Slack are being increasingly normalized in various workplace environments to discuss projects, schedule meetings, and many other interactions relevant to the specific work the business does. Often, this increased use in messaging applications results in signficant information being buried deep in Slack channel discussions or previous direct messages; the further back a conversation may be, the more context may be necessary for a user to get a proper understanding of the subjects being discussed, making it difficult to fully process information being covered in a conversation's history. Several custom bots and pre-built automation features exist for Slack that can summarize individual messages or perform actions within Slack when an expected message type is sent, but few technologies currently exist that can organize a collection of message data from a conversation into a standardized data model that fully addresses the possible context that can exist and change every time a user sends a new message. By developing a Slack bot with these features in mind, the use cases for structured message data are greatly expanded.
This project requires significant backround research on existing LLMs that develop context for extensive collections of data, especially from diverse text sources such as documents or verbal conversations, as understanding the current developments of applications that perform a similar structuring task can help discover applicable tools or well-tested data extraction/processing methods. Reviewing existing automations within Slack and other communication platforms will also be useful for the modeling places where the user interacts directly with the interface to ensure the essential features of the tool are fully and securely realized.
This section contains everything you need to install, configure, and use the application. If you're looking for information about development or maintenance, see "For the Maintainer" below.
To add SUD Bud directly to your Slack workspace, click this button
Or click this link! Click Here
If you've deployed Node.js + MongoDB apps before:
- Clone/download the repository
- Set up a Slack app at api.slack.com/apps (or use manifest file in
bolt_slack/slack-app-manifest.json) - Create
.envin repo root with tokens from Slack + MongoDB credentials - Run setup:
npm install(bothbolt_slack/andmongo_storage/) - Start services:
# Terminal 1: MongoDB API cd mongo_storage && node server.js # Terminal 2: Slack Bot cd bolt_slack && npm start
- Invite bot to your Slack channels:
/invite @YourBotName - Done! Use
/store-messages,/messages,/channel-infoin Slack
Before installing, ensure your system meets these minimum requirements:
- Node.js: 18.0.0 or higher (Download)
- npm: 9.0.0 or higher (bundled with Node.js)
- MongoDB: One of the following:
- MongoDB Atlas account (cloud-hosted, no local install needed), OR
- Docker Desktop 4.0+ (for local MongoDB container), OR
- MongoDB Community Edition 5.0+ (for local installation)
- Git: For cloning the repository (optional, can download as ZIP)
- RAM: 4 GB minimum (8 GB recommended)
- Disk Space: 2 GB free space
- Processor: Dual-core processor minimum
- Stable internet connection for Slack API communication
- Ability to reach
slack.comandapi.slack.com - If using MongoDB Atlas: ability to reach Atlas cluster endpoint (firewall/proxy compatible)
- Ports available: 3000 (Slack bot), 5000 (MongoDB API) must not be in use
- Slack workspace where you have app installation permissions
- Ability to create/configure Slack apps (Admin access recommended)
- Node.js 18+ installed
- MongoDB credentials ready (Atlas or Docker)
- Slack App tokens created (Bot Token, App Token, Signing Secret)
-
.envfile populated with credentials - Dependencies installed
- Both services running on ports 3000 & 5000
- Bot invited to at least one Slack channel
Before installing, ensure your network configuration supports the application:
- Port 3000: Must be available for the Slack bot service (Node.js app)
- Port 5000: Must be available for the MongoDB API service (Node.js app)
- Firewall: Both ports must not be blocked by local firewall (Windows Defender, third-party firewalls)
- Localhost: Application assumes
localhost(127.0.0.1) for local development
- Network Access: Your machine's public IP must be whitelisted in MongoDB Atlas
- Go to: Cluster → Network Access → Add IP Address
- Recommended: Add your IP or "Allow access from anywhere" (0.0.0.0/0) for development
- Connection String: Atlas provides a connection string; store securely in
.env - Username/Password: Create MongoDB database user in Atlas (not your account password)
- Outbound HTTPS (443): Required for Slack API calls
- WebSocket (Port 443): Required for Socket Mode (bot event streaming)
- DNS Resolution: Must be able to reach
slack.com,api.slack.com,hooks.slack.com
Follow these steps to install dependencies, configure environment variables, and run both services locally. Commands are PowerShell-friendly for Windows.
- Node.js 18+ installed
- MongoDB Atlas credentials (user/password) with your IP whitelisted
- A Slack App with the Socket Mode and Bots features enabled, and the following tokens/secrets:
- Bot Token (xoxb-*)
- Signing Secret
- App Token (xapp-*, required for Socket Mode)
Create a .env file in the repo root (same level as bolt_slack/ and mongo_storage/).
# Slack Bot
SLACK_BOT_TOKEN=your-bot-token
SLACK_SIGNING_SECRET=your-signing-secret
SLACK_APP_TOKEN=your-app-level-token
SLACK_BOT_USER_ID=your-bot-user-id
SLACK_SOCKET_MODE=true
SLACK_BOT_PORT=3000
# Mongo Storage API
API_URL=http://localhost:5000
DB_PORT=5000
MONGODB_USER=sudbud_test_user
MONGODB_PASSWORD=8zAk8e6DRunJk9kF
Keep secrets out of version control. The services now read from this shared root
.env.
cd c:\project-structuring-unstructured-data\bolt_slack
npm install
cd ..\mongo_storage
npm installTerminal A – Mongo storage API
cd c:\project-structuring-unstructured-data\mongo_storage
node server.jsExpected log: App is listening on port 5000
Health check: http://localhost:5000/health
Terminal B – Slack bot (Socket Mode)
cd c:\project-structuring-unstructured-data\bolt_slack
npm startExpected log: ⚡️ Slack Bot is running! and DB API URL printed.
There are two ways to configure your Slack bot: using a manifest file (recommended) or manual setup.
The manifest file (bolt_slack/slack-app-manifest.json) automatically configures all permissions, scopes, and event subscriptions.
Steps:
- Go to api.slack.com/apps
- Click "Create New App" → "From an app manifest"
- Choose your workspace
- Copy the contents of
bolt_slack/slack-app-manifest.jsonfrom this repository - Paste it into the manifest editor
- Click "Create" → "Install to Workspace"
- Review permissions and click "Allow"
- Copy your Bot User OAuth Token (starts with
xoxb-found in the "OAuth & Permissions" tab) and Signing Secret (found in the "Basic Information" tab) - Add these to your
.envfile underSLACK_BOT_TOKENandSLACK_SIGNING_SECRETrespectively (should already be there from step 2) - If necessary, create an app-level token for your bot under the general app credentials section. Name the token however you choose and select the
connections:writescope - Copy the app-level token to your
.envfile underSLACK_APP_TOKEN - Find your bot's member ID directly in your Slack workspace by right-clicking the app from the "Apps" tab and selecting "view app details". Copy the value named "Member ID" into
SLACK_BOT_USER_ID - Invite the bot to channels: in Slack, run
/invite @YourBotNamein each channel
If you prefer to manually configure the bot:
- In Slack API settings for your app, enable Socket Mode and copy the App Token (xapp-*).
- Add required OAuth scopes for the bot:
app_mentions:read,chat:write,commands,channels:history,groups:history,im:history,mpim:history- Plus for interactive features:
reactions:read,reactions:write,users:read
- Install the app to your workspace to generate the Bot Token (xoxb-*)
- Configure event subscriptions:
app_mention,member_joined_channel,message.channels,message.im,reaction_added
- Create slash commands in Slack:
/messages- Retrieve recent messages from this channel/store-messages- Store channel messages to database/channel-info- Get channel information
- Invite the bot to channels: in Slack, run
/invite @YourBotNamein each channel
- Bot replies to channel messages with ephemeral “Save to DB?” buttons (Socket Mode events).
/store-messagesbulk-saves the channel to Mongo via API./messagesreads back the most recent saved messages./channel-inforeturns channel metadata.
Testers can easily set up a local MongoDB database for development and testing without needing MongoDB Atlas. Two methods are supported: Docker (recommended) or local MongoDB installation.
cd c:\project-structuring-unstructured-data\mongo_storage
npm run db:setupThis interactive script will:
- Ask you to choose between Docker (recommended) or Local MongoDB
- Validate prerequisites
- Automatically configure
.envwith connection details - Start MongoDB and prepare it for testing
Option A: Docker (Recommended) ⭐
Prerequisites: Docker Desktop installed and running
npm run db:setup:dockerWhat it does:
- Creates a MongoDB 7.0 container named
suds-local-mongodb - Automatically sets up credentials (testuser/testpass)
- Configures
.envwith local connection details - Container persists data in a Docker volume
Option B: Local MongoDB Installation
Prerequisites: MongoDB Community Edition installed and in PATH
npm run db:setup:localYou'll be prompted to enter:
- MongoDB host (default:
localhost) - MongoDB port (default:
27017) - Username (default:
testuser) - Password (default:
testpass)
Then ensure MongoDB is running:
- Windows: Run
mongodin a separate terminal - macOS:
brew services start mongodb-community - Linux:
sudo systemctl start mongod
# Start MongoDB container (Docker only)
npm run db:start
# Stop MongoDB container (Docker only)
npm run db:stop
# View MongoDB logs
npm run db:logsAfter setup, MongoDB is accessible at:
- Host: localhost
- Port: 27017
- Username: testuser
- Password: testpass
These are automatically added to your .env file as:
MONGODB_USER=testuser
MONGODB_PASSWORD=testpass
MONGODB_LOCAL=true
MONGODB_HOST=localhost
MONGODB_PORT=27017
Run all tests (root, both projects):
cd c:\project-structuring-unstructured-data
npm testWhat it does:
- Runs
bolt_slacktests with--passWithNoTests(ok if none present). - Runs
mongo_storagetests with--passWithNoTests(unit tests pass without MongoDB).
Mongo API unit tests only (no DB required):
cd c:\project-structuring-unstructured-data
npm test -- --testPathPatterns=mongo_storage/routes/__tests__/messages.route.test.js --runInBandMongo API integration tests (requires Atlas creds + IP whitelist):
cd c:\project-structuring-unstructured-data
npm test -- --testPathPatterns=mongo_storage/routes/__tests__/messages.integration.test.js --runInBandNotes:
- Integration tests auto-skip with a warning if MongoDB is unreachable (e.g., IP not whitelisted).
- Ensure
.envcontainsMONGODB_USERandMONGODB_PASSWORDbefore running integration tests.
After setup, run tests from the mongo_storage directory:
# All tests
npm test
# Unit tests only (no database required)
npm run test:unit
# Integration tests (requires MongoDB running)
npm run test:integration
# Watch mode (re-run on file changes)
npm run test:watch
# With coverage report
npm run test:coverage- Cannot find module / missing deps: Run
npm installin bothbolt_slackandmongo_storage. - MongoDB auth/connection errors: Verify
MONGODB_USER/PASSWORD, IP whitelist, andDB_PORTin.env. - Bot not responding: Confirm the bot is invited to the channel and Socket Mode tokens are correct; restart
npm start. - API health: Check http://localhost:5000/health.
If you need to remove the application or reset your installation, follow these steps:
# Stop running services (close Terminal windows or press Ctrl+C)
# Option A: Keep the code, remove only node_modules
cd c:\project-structuring-unstructured-data\bolt_slack
rm -Recurse node_modules
cd ..\mongo_storage
rm -Recurse node_modules
# Option B: Complete uninstall (remove everything except .env and docs)
cd c:\project-structuring-unstructured-data
rm -Recurse bolt_slack/node_modules
rm -Recurse mongo_storage/node_modulesIf using Docker:
cd c:\project-structuring-unstructured-data\mongo_storage
# Stop MongoDB container
npm run db:stop
# Remove container and data volume
docker rm suds-local-mongodb
docker volume rm suds-mongodb-volumeIf using local MongoDB installation:
# Stop MongoDB
# Windows: Close the mongod terminal window, or:
taskkill /IM mongod.exe /F
# Uninstall MongoDB (Windows Add/Remove Programs or):
# - Download MongoDB uninstaller
# - Delete default data directory: C:\Program Files\MongoDB\Server\[version]\data- Go to api.slack.com/apps
- Select your app
- Click "Settings" → scroll to bottom
- Click "Delete this app"
- Confirm deletion
Delete or clear the .env file in the repository root if you don't plan to reinstall:
rm .env.env after stopping all services. It contains tokens and credentials.
To start completely fresh:
# Delete everything except .git (if version controlled)
cd c:\project-structuring-unstructured-data
rm -Recurse -Force bolt_slack/node_modules, mongo_storage/node_modules
rm .env
rm .env.local
# Re-run installation from "Manual Setup" section above(This section is reserved for development, contribution, and maintenance guidelines. Please download maintainer documentation or view MAINTAINER.md in the repository files for detailed contributor instructions.)