{"id":26289961,"url":"https://github.com/slack-samples/bolt-java-starter-template","last_synced_at":"2025-05-07T22:43:50.912Z","repository":{"id":50421067,"uuid":"510877408","full_name":"slack-samples/bolt-java-starter-template","owner":"slack-samples","description":"A template for building Slack apps with Bolt for Java","archived":false,"fork":false,"pushed_at":"2025-04-08T19:18:02.000Z","size":347,"stargazers_count":18,"open_issues_count":0,"forks_count":16,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-08T20:24:24.245Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slack-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-05T19:58:55.000Z","updated_at":"2025-04-08T19:18:05.000Z","dependencies_parsed_at":"2023-02-01T08:10:12.801Z","dependency_job_id":"5ec6014d-de41-4d2d-bdc2-ec063e372654","html_url":"https://github.com/slack-samples/bolt-java-starter-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slack-samples%2Fbolt-java-starter-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slack-samples%2Fbolt-java-starter-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slack-samples%2Fbolt-java-starter-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slack-samples%2Fbolt-java-starter-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slack-samples","download_url":"https://codeload.github.com/slack-samples/bolt-java-starter-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252967973,"owners_count":21833245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-14T23:17:29.244Z","updated_at":"2025-05-07T22:43:50.884Z","avatar_url":"https://github.com/slack-samples.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bolt for Java Template App\n\nThis is a generic Bolt for Java template app used to build out Slack apps.\n\nBefore getting started, make sure you have a development workspace where you have permissions to install apps. If you don’t have one setup, go ahead and [create one](https://slack.com/create).\n\n## Installation\n\n#### Create a Slack App\n\n1. Open [https://api.slack.com/apps/new](https://api.slack.com/apps/new) and choose \"From an app manifest\"\n2. Choose the workspace you want to install the application to\n3. Copy the contents of [manifest.json](./manifest.json) into the text box that says `*Paste your manifest code here*` (within the JSON tab) and click *Next*\n4. Review the configuration and click *Create*\n5. Click *Install to Workspace* and *Allow* on the screen that follows. You'll then be redirected to the App Configuration dashboard.\n\n#### Environment Variables\n\nBefore you can run the app, you'll need to store some environment variables.\n\n1. Open your app's configuration page from this list, click **OAuth \u0026 Permissions** in the left hand menu, then copy the Bot User OAuth Token. You will store this in your environment as `SLACK_BOT_TOKEN`.\n2. Click **Basic Information** from the left hand menu and follow the steps in the App-Level Tokens section to create an app-level token with the `connections:write` scope. Copy this token. You will store this in your environment as `SLACK_APP_TOKEN`.\n\n```zsh\n# Replace with your app token and bot token\nexport SLACK_BOT_TOKEN=\u003cyour-bot-token\u003e\nexport SLACK_APP_TOKEN=\u003cyour-app-token\u003e\n```\n\n### Setup Your Local Project\n\n```zsh\n# Clone this project onto your machine\ngit clone https://github.com/slack-samples/bolt-java-starter-template.git\n\n# Change into this project directory\ncd bolt-java-template\n```\n\n#### Maven: Run\n\nEnsure [maven](https://maven.apache.org/index.html) is installed on your local environment.\n* We recommend using [brew to install Maven on macOS](https://formulae.brew.sh/formula/maven)\n\n```zsh\n# Install the dependencies and compile\nmvn clean compile\n\n# apply linter to your project\nmvn spotless:apply\n\n# Install the dependencies and test\nmvn clean test\n\n# Compile and start your local server\nmvn clean compile exec:java -Dexec.mainClass=\"Main\"\n```\n\n**NOTE**: If you chose to use Maven as your build tool you can remove the `builde.gradle` file from this project.\n\n------\n\n#### Gradle: Run\n\nEnsure [gradle](https://gradle.org/) is installed on your local environment.\n* We recommend using [brew to install Gradle on macOS](https://formulae.brew.sh/formula/gradle)\n\n```zsh\n# Run tests\ngradle test\n\n# Apply linter to project\ngradle spotlessApply\n\n# Start your local server\ngradle run\n```\n\n**NOTE**: If you chose to use Gradle as your build tool you can remove the `pom.xml` file from this project.\n\n## Project Structure\n\n### `manifest.json`\n\n`manifest.json` is a configuration for Slack apps. With a manifest, you can create an app with a pre-defined configuration, or adjust the configuration of an existing app.\n\n### `Main.java`\n\n`./src/main/java/Main.java` is the entry point for the application and is the file you'll run to start the server. This project aims to keep this file as thin as possible, primarily using it as a way to route inbound requests.\n\n### `/listeners`\n\nEvery incoming request is routed to a \"listener\". Inside this directory, we group each listener based on the Slack Platform feature used, so `/listeners/shortcuts` handles incoming [Shortcuts](https://api.slack.com/interactivity/shortcuts) requests, `/listeners/views` handles [View submissions](https://api.slack.com/reference/interaction-payloads/views#view_submission), and so on.\n\n### `/logback.xml`\n\n[`logback-classic`](https://search.maven.org/artifact/ch.qos.logback/logback-classic) is imported as a dependency to configure the logs of the project, this configuration is defined in a [logback.xml](https://logback.qos.ch/manual/configuration.html) found in `src/main/resources/logback.xml`. Note that by default the project should be logging `debug` level logs for slack dependencies.\n\n### Tests\n\nThis project provides some sample unit tests. They can be found in `src/test`. They are to be used as examples to show how unit tests can be implemented. **As you modify this project don't hesitate to modify, add, or remove these tests.**\n\n## App Distribution / OAuth\n\nOnly implement OAuth if you plan to distribute your application across multiple workspaces. A separate `OAuthMain.java` file can be found with relevant OAuth settings.\n\nWhen using OAuth, Slack requires a public URL where it can send requests. In this template app, we've used [`ngrok`](https://ngrok.com/download). Checkout [this guide](https://ngrok.com/docs#getting-started-expose) for setting it up.\n\nStart `ngrok` to access the app on an external network and create a redirect URL for OAuth.\n\n```\nngrok http 3000\n```\n\nThis output should include a forwarding address for `http` and `https` (we'll use `https`). It should look something like the following:\n\n```\nForwarding   https://3cb89939.ngrok.io -\u003e http://localhost:3000\n```\n\nNavigate to **OAuth \u0026 Permissions** in your app configuration and click **Add a Redirect URL**. The redirect URL should be set to your `ngrok` forwarding address with the `slack/oauth/callback` path appended. For example:\n\n```\nhttps://3cb89939.ngrok.io/slack/oauth/callback\n```\n\n*NOTE:* if you do not require OAuth you can remove all `OAUTH DEPENDENCIES` in the `pom.xml` or `build.gradle` files, along with `src/main/java/OAuthMain.java`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslack-samples%2Fbolt-java-starter-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslack-samples%2Fbolt-java-starter-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslack-samples%2Fbolt-java-starter-template/lists"}