Skip to content

LottePitcher/CodegardenBar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodegardenBar

Local dev setup

Prerequisites

Setup configuration

  • Add a new file in the root of the backend app named appsetttings.json.local with all necessary credentials
{
  "TwitterApi": {
    "ConsumerKey": "",
    "ConsumerKeySecret": "",
    "ApplicationBearerToken": "",
    "AccessToken": "",
    "AccessTokenSecret": "",
    "Host": "https://3e3c31de0a42.ngrok.io/",
    "Environment": "",
    "AdminPassword": "" //used to contact internal apis
  },
  "BarTender": {
    "AdminPassword": "" //used to contact internal apis
  },
  "DiscordBotToken" : "",
  "DiscordBotPrefix" : "!bar "
}
  • If using postman, edit the collection variables with your host(baseUrl) and admin passwords

Running the app

  • Serve the static website files that hold the app that shows the bartending (https://github.com/LottePitcher/CGBarFrontend)
  • Open the visual studio project and run the backend project, it should open a webpage with an https url. Append /status/ping to the url to confirm it's working (there is no default page).
  • Run your tunneling software (ngrok) on that https url, you should get a url like this https://3e3c31de0a42.ngrok.io
  • Ensure that the static website is using the correct baseUrl

Register Twitter webhooks

  • Register your tunnel url:
    • send a get request (with adminPassword header) to /TwitterAdmin/RegisterWebhook (or use postman)
  • Request an appAuthorization Pin:
    • send a get request (with adminPassword header) to /TwitterAdmin/StartSubscribeToAccount (or use postman)
    • browse the twitter url in that response (having logged in to the correct twitter account first) to obtain the pin
  • Finish registration:
    • send a get request (with adminPassword header) to /TwitterAdmin/SubscribeToAccount (or use postman) using:
      • authkey: the key from the StartSubscribeToAccount response
      • pin: the pin obtained from twitter url

To do every time your tunnel url changes

  • Update appsettings.json.local Host
  • Update postman collection baseUrl
  • Rerun Twitter webhooks registration process

About

The app that drives the Umbraco virtual bar

Resources

License

Stars

Watchers

Forks

Languages