Developing

This document guides you through the development process of Hybridilusmu.

Development Environment

The development environment is arranged with Docker containers. However, developing Slack apps also requires proper access to a Slack workspace. You will not be able to run this program purely locally.

Requirements

These are required to be installed on the development machine:

  • Docker
  • Node.js

Fairly recent versions will do.

Configuration

Create .env.development file at project root and populate it with the variables below.

NameDescription
SLACK_APP_TOKENApp-Level Token with the connections:write scope. Used to authenticate the WebSocket connection (found under Basic Information > App-Level Tokens).
SLACK_BOT_TOKENBot User OAuth Token (found under OAuth & Permissions).
SLACK_SIGNING_SECRETSigning Secret (found under Basic Information > App Credentials).

Installation (optional)

Install dependencies locally

npm run init

Used to enable intellisense for local tools such as VS Code extensions. The containerized development environment does not require this to function.

Usage

Start Development Environment

npm start

Stop Development Environment

npm stop

View Logs

npm run logs

(Using npm start, the containers start detached.)

Run Linter

npm run lint

Environment Maintenance

Reset Database

Postgres data is persisted in a Docker volume. Removing the volume will cause a new database to be created on next run.

docker compose down
docker container rm lusmu-db
docker volume rm hybridilusmu_lusmu-db

Note that your volume may be named differently depending on where you cloned the repository to.