adventure-bot is a Choose Your Own Adventure Bot that you can play within GitHub Issues. It runs as a GitHub App using the GitHub SDK, GitHub Webhooks, and Node (NextJS).
Feel free to fork this repository and replace the story with your own adventure.
You can play the demo adventure by clicking the link below:
-
Create your own GitHub App:
- Webhook URL:
http://{your-ngrok-domain.io}/api/hook
- Webhook secret: (add your secret here)
- Permissions: Repository > Issues > Read and Write
- Subscribe to Events: Check both Issues & Issue Comment
- Webhook URL:
-
Install the GitHub App you created into a repository of your choice.
-
Copy
.env.example
to.env.local
. -
Update
.env.local
:- Update
REPO_URL="..."
with the repository URL.- Example:
https://github.com/taptapdan/adventure-bot
.
- Example:
- Update
GITHUB_APP_ID="..."
with the GitHub App ID.- Find the ID in Settings > Developer Settings > GitHub Apps > Edit > General > About.
- Update
GITHUB_SECRET_KEY="-----BEGIN PRIVATE KEY-----\niLov3..."
with the GitHub App private key.- Find the private key in Settings > Developer Settings > GitHub Apps > Edit > General > Private Keys.
- Hint: Replace any newlines in the private key with
\n
.
- Update
-
Start the development server:
yarn dev
-
Start ngrok:
yarn ngrok
- Update your GitHub App's Webhook URL to
http://{your-ngrok-domain.io}/api/hook
.
-
Create a GitHub App for your deployment:
- The process is similar to the development setup, but adjust the settings to point to your Vercel installation.
-
Deploy to Vercel and add Environment Variables (Project > Settings > Environment Variables):
REPO_URL
: URL of your cloned adventure-bot repository.GAME_URL
: URL of the repository where users will play the game (can be the same asREPO_URL
).GITHUB_APP_ID
andGITHUB_PRIVATE_KEY
: From your GitHub App developer settings.GITHUB_WEBHOOK_SECRET
: The Webhook secret you entered earlier.
- Game Icons is licensed under CC BY 3.0.
- Story written with assistance from ChatGPT.
- Illustrations generated by Leonardo.ai.
- The Dragon of Wantley by Owen Wister, 1892.