Very simple Receipts management system.
We use CarrierWave instead of ActiveStorage because we care about file paths.
Users can send receipt images/PDFs directly to a Slack bot via DM. The bot automatically creates a receipt in Kiroku, matching the Slack user by email (or creating a new account if none exists).
Go to https://api.slack.com/apps and create a new app for your workspace. Get the SLACK_SIGNING_SECRET and set it in the app. Then restart it.
Under App Home → Show Tabs:
- Enable Messages Tab
- Check "Allow users to send Slash commands and messages from the messages tab"
Without this, users will see "Sending messages to this app has been turned off."
Under OAuth & Permissions, add these Bot Token Scopes:
chat:write— post confirmation messagesfiles:read— download files shared with the botim:history— read DM messages (required for Event Subscriptions)users:read— look up user profilesusers:read.email— retrieve user email addresses
Under Event Subscriptions:
- Toggle Enable Events on
- Set the Request URL to
https://<your-domain>/slack/events - Subscribe to the bot event:
message.im
Slack will send a verification challenge to the URL — the app handles this automatically.
Install (or reinstall) the app to your workspace. Copy:
- Bot User OAuth Token (
xoxb-...) from OAuth & Permissions - Signing Secret from Basic Information
Note: If you change scopes or settings after the initial install, you must reinstall the app for changes to take effect.
bin/rails credentials:editAdd:
slack:
bot_token: "xoxb-your-bot-token"
signing_secret: "your-signing-secret"For local development, you can also set SLACK_BOT_TOKEN and SLACK_SIGNING_SECRET in your .env file.
Send a file (JPG, PNG, HEIC, WebP, or PDF, max 10MB) as a DM to the bot. Optionally include a date in the message (e.g.
2026-01-15 or 15.01.2026) to set the spent_on date. The bot will reply confirming the receipt was saved.