Setting Up Heroku
Last updated
Last updated
Heroku is a free cloud server where you can easily deploy a NodeJS Express App. When you create a project on Heroku, you will be given a git URL where you can push the server files to. The Heroku backend will run "npm install" to build the NodeJS Express App and then run "npm run start", thus deploying your App. Heroku will also provide you a https url that can be used as the webhook URL in your Trading View alert.
Download files from the Github repository to your computer
Sign up for a Github account
Install Git ()
Establish authentication to Github API
Windows
download VSCode
download the Github Pull Requests Extension
Click Accounts (bottom left) > sign in with Github
MacOS
Use VSCode, as above
Alternatively, use a Personal Access Token
Log into Github > Profile photo (top right) > Settings > Developer Settings (left menu, scroll down) > Personal access tokens > Tokens (classic) > Generate new token (top right) > Generate a new token (classic)
Give name, expiration date, and scopes (for scopes, click "repo" checkbox)
Click Generate token
When you run git clone
(Step 1.4), it will ask for a username and password. Use your Github username. For password, use the generated token.
Cache token with git config --global credential.helper osxkeychain
view cached credentials with echo url=https://github.com/git/git.git | git credential fill
In your CLI, cd into where you want the “trading-view-automation” folder downloaded, then run git clone
Upload files to Heroku
Create a Heroku account
Create a new app on Heroku
Go to New (top right) > Create new app
Enter a name, choose region, and click Create app
Install the Heroku CLI ()
verify installation with heroku --version
heroku update
// updates heroku CLI
heroku login
press any key to continue
Web browser should popup prompting login
cd into the "trading-view-automation" folder
git remote add heroku https://git.heroku.com/example-app.git
// adds a remote labeled "heroku", which is an alias for the url
find the https url in the your Heroku account > project page > Settings tab (top center). Look in the App Information category for the Heroku git URL
git remote -v
// check if remote is added
push files to Heroku git URL with git push heroku main
macOS may show a prompt for additional authentication. If so, type "blank" into username field and enter API Key into the password field. You can generate API Key withheroku auth:token
Code is uploaded if you see various logs appearing for 10-15s
Set environment variables
In your Heroku account, go to Settings > Config Vars > click Reveal Config Vars
Enter the environment variables detailed in
Copy the app URL and use it as the webhook URL in your or
URL is located in your Heroku account > project page > Settings > scroll down to Domains. It looks like
To view logs, go to More (top right) > View logs
Every time you need to update the Heroku remote
git pull origin main
// this pulls changes from Github repository
git push heroku main
// this pushes changes to the Heroku repository
Set up Google Sheets to see successful or failed trades (see )
Set up Telegram to see successful or failed trades (see )
Send a T or mimic one using . Use the provided Heroku HTTPS URL (see Step 1.4) as the webhook URL.