Farm Store Bot is a Slack bot for Bag that allows users to buy and sell farm items.
- Make Offers: Users can make offers for farm items.
- Node.js: Ensure Node.js (v14 or higher) is installed.
- Docker: Install Docker and Docker Compose for containerization.
- Slack App: Create a Slack app with the required permissions and tokens.
- PostgreSQL Database: Set up a PostgreSQL database.
@slack/bolt
@prisma/client
@bufbuild/protobuf
@connectrpc/connect
dotenv
typescript
Install these using:
npm install
- PostgreSQL: Install PostgreSQL and create a database.
- Prisma: Generate and apply migrations:
npx prisma migrate dev
Update the DATABASE_URL
in .env
to reflect your PostgreSQL setup:
DATABASE_URL=postgresql://user:password@localhost:5432/farm_store
Create a .env
file in the root directory with the following:
SLACK_SIGNING_SECRET=your_slack_signing_secret
SLACK_APP_TOKEN=your_slack_app_token
SLACK_BOT_TOKEN=your_slack_bot_token
DATABASE_URL=your_database_url
SLACK_CHANNEL=your_slack_channel_id
- Start the Bot:
npm start
- Port Details: The bot runs on port 3000 by default. Ensure this port is open or modify it in your Docker Compose or
.env
file.
- Build the Docker Image:
docker-compose up --build
This will build and start the bot in a container, exposing port 3000.
- Buy Items:
/farmshop buy
- Make an Offer:
/farmshop offer <item> <price>
-This needs to be updated