A web application that listens for webhooks from the Concept2 logbook API and converts rowing results into a discord message with generated image attachment.
This app uses Turso (sqlite) for stateful data.
I also chose to use Bun for this project just to try it out!
here's an example output that would be added as an attachment to a discord message:
-
Clone and install dependencies:
git clone <repository-url> cd rowbot bun install
note: this app relies on several external dependencies including:
- Turso
- Concept2 logbook
- Discord webhook
-
Configure environment variables:
cp .env.example .env
Edit
.envwith your actual values:CONCEPT2_CLIENT_ID: Your Concept2 OAuth client IDCONCEPT2_CLIENT_SECRET: Your Concept2 OAuth client secretCONCEPT2_REDIRECT_URI: OAuth callback URL (default: http://localhost:3000/callback)DISCORD_WEBHOOK_URL: Your Discord webhook URLPORT: Server port (default: 3000)TURSO_DATABASE_URL: url to your turso databaseTURSO_AUTH_TOKEN: authentication token for your turso db
-
Get Concept2 OAuth credentials:
- Visit Concept2 Developer Documentation
- Register your application to get client ID and secret
- Set the redirect URI to match your
APP_EXTERNAL_URL/callback. If you want to run this locally, you can use ngrok to set up a publicly accessible URL that can reach your localhost.
-
Run the application:
bun run index.ts
How to Create a Discord webhook:
- Go to your Discord server settings
- Navigate to Integrations > Webhooks
- Create a new webhook and copy the URL
- Open your browser to
http://localhost:3000 - Click "Login with Concept2" to authenticate
- Configure your Concept2 logbook to send webhooks to a publiclly accessible url
http://12345.ngrok-free.app/webhook - When you complete a rowing session, the app will receive a webhook from concept2 logbook, convert it to a discord message, and send it to the configured channel.
GET /- Main page with login/logout interfaceGET /callback- OAuth callback handlerPOST /logout- Logout and clear cookiesPOST /webhook- Concept2 webhook endpoint
