Skip to content

Choose Your Own Adventure Bot -- Played within GitHub Issues. Runs as a GitHub App, using the GitHub SDK, GitHub Webhooks, and Node (NextJS).

License

Notifications You must be signed in to change notification settings

taptapdan/adventure-bot

Repository files navigation

Choose Your Own Adventure Bot

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.

Play!

You can play the demo adventure by clicking the link below:

Play The Adventure!

Development

  1. 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
  2. Install the GitHub App you created into a repository of your choice.

  3. Copy .env.example to .env.local.

  4. Update .env.local:

    • Update REPO_URL="..." with the repository URL.
      • Example: https://github.com/taptapdan/adventure-bot.
    • 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.
  5. Start the development server:

    • yarn dev
  6. Start ngrok:

    • yarn ngrok
    • Update your GitHub App's Webhook URL to http://{your-ngrok-domain.io}/api/hook.

Deploying to Vercel

Deploy with Vercel

  1. 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.
  2. 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 as REPO_URL).
    • GITHUB_APP_ID and GITHUB_PRIVATE_KEY: From your GitHub App developer settings.
    • GITHUB_WEBHOOK_SECRET: The Webhook secret you entered earlier.

Credits

About

Choose Your Own Adventure Bot -- Played within GitHub Issues. Runs as a GitHub App, using the GitHub SDK, GitHub Webhooks, and Node (NextJS).

Topics

Resources

License

Stars

Watchers

Forks