Developer Setup Guide
This guide will help you set up a local development environment for the Community Signal Moderation Bot.
Prerequisites
Section titled “Prerequisites”- Node.js (v18 or higher)
- Docker and Docker Compose
- pnpm
1. Clone the Repository
Section titled “1. Clone the Repository”git clone https://github.com/your-username/Community-Signal-Moderation-Bot.gitcd Community-Signal-Moderation-Bot2. Install Dependencies
Section titled “2. Install Dependencies”Install the project dependencies using pnpm:
pnpm install3. Set up the Database and Redis
Section titled “3. Set up the Database and Redis”The bot requires a PostgreSQL database and a Redis cache. You can start these services using Docker Compose:
docker compose up -d postgres redis4. Configure Environment Variables
Section titled “4. Configure Environment Variables”Copy the .env.example file to .env:
cp .env.example .envNow, open the .env file and fill in the required environment variables. For local development, you will need to set the following variables:
DATABASE_URLREDIS_URLBOT_NUMBERSIGNAL_CLI_CONFIG_PATH
5. Run the Bot
Section titled “5. Run the Bot”You can run the bot in development mode using the following command:
pnpm devThis will start the bot and automatically restart it when you make changes to the code.
6. Running Tests
Section titled “6. Running Tests”To run the tests, use the following command:
pnpm test