This file outlines the steps to take to get the example app up and running in your local development environment.
An overview of this app's functionality can be found in ../README.md file
.
Prerequisites: A working installation of Node 12+ and a text editor is expected. You'll also need an Airtable account where you can create new bases and a Slack account where you can create a new custom app.
The example code in this project expects the Airtable table you specify (in the next step) to have the following fields: Short description
(single line text), Long description
(long text), Priority
(single select), Submitter Slack UID
(single line text), Submitter Slack Name
(single line text), Updater Slack UID
(single line text), and Updater Slack Name
(single line text).
You can copy this sample table into your own base if you'd like. Pointers on how which code to modify to adapt this example are below. It's recommended you use this exact schema for your initial test of the example code.
- Visit https://api.slack.com/apps
- Click Create New App
- Select From an app manifest
- Choose a workspace
- Copy and paste the contents of this repo's
manifest.yaml
into the textarea - Click Create
- You now have a new Slack app and it's time to install it. Click Install to Workspace and follow the prompts to Allow your new app to be installed to the workspace you chose in step 4.
- Finally, scroll to the bottom of the Basic Information page for your app and click Generate Token and Scopes.
- Name your app-token something descriptive such as "local dev"
- Add the two scopes (
connections:write
andauthorizations:read
) - Click Generate
You now have a Slack app installed into your workspace with a bot token and app-level token you'll need in the next step.
Copy .env.example
to .env
and paste your unique values:
cp .env.example .env
The environment variables you'll need to define in your new .env
filer are:
## Slack...
# Bot token from the 'OAuth & Permissions' > 'OAuth Tokens for Your Workspace' section of your Slack app config off of api.slack.com/apps
SLACK_BOT_TOKEN=xoxb-...
# App token from the 'Basic Information' > 'App-Level Tokens' section of your Slack app config off of api.slack.com/apps
SLACK_APP_TOKEN=xapp-...
## Airtable...
# API key from https://airtable.com/account
AIRTABLE_API_KEY=key...
# Base ID from API docs or https://support.airtable.com/hc/en-us/articles/4405741487383
AIRTABLE_BASE_ID=app...
# Table ID from https://support.airtable.com/hc/en-us/articles/4405741487383
AIRTABLE_TABLE_ID=tbl...
# Primary field name for the table
AIRTABLE_PRIMARY_FIELD_NAME=Name
LOG_LEVEL=info # error, warn, info, and debug are valid options
From your terminal...
-
Clone this project onto your machine
git clone https://github.com/airtable-labs/example-slack-bug-tracker.git
-
Change directory into the project and install dependencies
cd example-slack-bug-tracker/ && npm install
-
From your terminal, run:
npm run start
-
You should see output that looks like the following:
✅ Environment variables validated & loaded [INFO] web-api:WebClient:0 ✅ Connected to Airtable [INFO] web-api:WebClient:0 ✅ Slack Bolt app is running!
Your app should be ready to try from Slack 🚀. Check out the Global Shortcut ⚡️, Message Shortcut 💬, and App Home 🏡!
- You can run
npm run watch
(instead ofnpm run start
) to havenodemon
watch code files for changes and automatically restart the server for a quicker iterating. - To change the fields in the form, update
configs/fields.js
. To update user-facing messages, check outapp.js
andviews/
too.