Giter Club home page Giter Club logo

chitchat's Introduction

ChitChat

Prerequisites

  1. Create an account on Heroku

  2. Install Heroku CLI

  3. Set up pgAdmin4

    • Forget it; this tool is uggggh - just go with DataGrip instead.

General Notes

Further reading to enhance the app:


Setup Steps:

Step 1:

Step 2:

  • Do search (from top dir in repo) for mefune and change to your GitHub account name.

Step 3:

  • Run go test
  • Run go mod tidy (cleans up unused dependencies).
  • Check go.mod and go.sum files to ensure all looks good.
  • go list -m all

Step 4:

  • heroku create
  • This creates a new empty application on Heroku, along with an associated empty Git repository. If you run this command from your app’s root directory, the empty Heroku Git repository is automatically set as a remote for your local repository.
  • git remote -v
  • git push heroku master
  • Note, the file Procfile tells Heroku which command(s) to run to start your app.

Step 5:

Add a free Heroku Postgres Starter Tier dev database to your app:

  • heroku addons:create heroku-postgresql:hobby-dev

Show the $DATABASE_URL environment variable:

  • heroku config

Heroku also provides a pg command that shows a lot more:

  • heroku pg

Step 6:

  • Add a .env file.
  • Note, this file is intentionally in .gitignore

Step 7:

Step 8:

  • Using pgAdmin run the data/setup.sql script.

Git it on up:

  • Note this will be the general flow for working with Git now that we have Heroku remote as well.
go mod tidy
go mod vendor

git status
git add --all
git commit -a  -m 'Initial launch'
git push heroku master

# Push to GitHub as well:
git push origin master

Run your app on Heroku:

As a handy shortcut, you can open the website as follows:

  • heroku open

View information about your running app:

  • heroku logs --tail

Run the app locally:

Build package:

go build -o bin/chitchat -v .
  • Start your app locally using the heroku local command.
    • This is installed as part of the Heroku CLI.
    • Just like Heroku, it examines the Procfile to determine what to run.
heroku local web
  • Open http://localhost:8080 with your web browser.
  • To stop the app from running locally, go back to your terminal window and press Ctrl+C to exit.

Setting Up A Custom Domain For Your Heroku-Hosted App

Note the glossary:

Approach taken here is based on:

Step 1:

  • Buy a custom domain name (I used name.com)
  • Example used below is for domain b7forum.com

Step 2:

heroku domains:add www.b7forum.com

heroku domains:wait 'www.b7forum.com' 

Note the output; configure your app's DNS provider to point to the DNS Target:

  • integrative-kiwi-i8a0bariil1ahajauz37x4n6.herokudns.com

Step 3: Add a custom root domain.

heroku domains:add b7forum.com

heroku domains:wait 'b7forum.com' 

Note the output, configure your app's DNS provider to point to the DNS Target:

  • still-sprout-wdcdz1tpzkyitakes8rs9x7z.herokudns.com

Step 4:

  • Add the DNS Records in name.com (or whatever site you bought your domain on).

Step 5:

View existing domains:

  • heroku domains

... Now wait a few minutes ...


NOT NEEDED YET:

Step ???:

  • Set your config variables on Heroku.
  • Note, $PORT is automatically set by Heroku on web dynos - so don't set that one.

heroku config:set REPEAT=10

chitchat's People

Contributors

ylazerson avatar mefune avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.