LogoLogo
Official WebsiteClass RecordingsSchedules & EventsHomework
  • Welcome to MigraCode Barcelona
  • General Information
    • Code of conduct
    • Experiences
    • Copyright
  • Student support
    • 🙋Student Services
      • Volunteer Support
      • CodeBuddies
      • CodeWomen
      • Language Support
        • Language Lab
        • Oxford House
      • Psychological Support
      • Legal Support
      • Study space
    • 💼Finding a job
      • Self-branding
        • LinkedIn profile
        • GitHub profile
        • Self-developed profile
      • Online networking
      • Events & job fairs
  • COURSES
    • 🎧IT Support & Security Course
      • Structure
      • Course content
      • Planning & Schedule
      • Application process
        • Home assignment
    • 🎧IT Automation with Python Course
      • Structure
      • Course content
      • Planning & Schedule
      • Application process
        • Home assignment
    • 💻Web Development Course
      • Pre-Courses
      • Main Tools & Software
      • Slack Information
      • Grading System
      • Homework
      • Course content
        • Introduction
          • 1 - Dev Tools and command line
          • 2 - Git and Github
          • Git and GitHub Practice Session
        • HTML/CSS
          • 1 - Semantic HTML and CSS
          • 2 - Responsive Web and Layout
          • 3 - Bootstrap
        • JavaScript I
          • 1 - Hello Javascript
          • 2 - Expressions and loops
          • 3 - Arrays and callbacks
        • JavaScript II
        • JavaScript III
          • 1 - Good practices and debugging
          • 2 - APIs and fetch
          • 3 - Project
        • React
          • 1 - React 101
          • 2 - Reacting to changes
          • 3 - Fetching Data
          • Extra Materials
            • Class components
            • Routing
        • Node.js
          • 1 - Node and Express 101
          • 2 - APIs in Node
          • 3 - Workshop
        • Databases
          • 1 - Introduction to SQL
          • 2 - SQL with Node
          • 3 - CRUD with SQL and Node
        • Final Projects
          • Call for project ideas
          • List of projects
          • Planning and Calendar
          • How to start coding
          • Methodology
          • Team meetings
        • Professional Skills
          • Module 1: Soft Skills
          • Module 2: Employability
          • Module 3: Working in projects
    • 💾Advanced JS & ASP.NET course
      • Admission assignment
      • Self Study Prerequisites
        • Index
      • Course content
        • Index
  • Technical Guides
    • How to install course tools
    • Introduction to GIT
    • Trello in Scrum
    • Heroku Deployment
    • Git on Teams
  • Useful links
    • Official website of MigraCode Barcelona
    • Our Homework Trello board
    • Class Recordings
    • Schedules and Events
Powered by GitBook
On this page
  • What is Heroku?
  • Heroku Deployment First steps
  • Register
  • Login
  • Deploy the project
  • Front-end Application
  • Back-end Application
  • Database
  • Environment variables
  • Heroku Extra features
  • Add a Custom Domain
  • Configure SSL
  • Deployment Guides
  • Buy a Domain
  • Buy SSL certificate

Was this helpful?

Export as PDF
  1. Technical Guides

Heroku Deployment

PreviousTrello in ScrumNextGit on Teams

Last updated 4 years ago

Was this helpful?

What is Heroku?

Heroku is a hosting services platform, and offers free services to allow us to publish our final projects for free!

Heroku Deployment First steps

Register

Then install Heroku Command Line Interface (CLI), it makes it easy to create and manage Heroku apps directly from the terminal. It’s an essential part of using Heroku.

Login

After install it, go to the terminal and write:

heroku login

It will open a browser with a button to login if you are already logged, if not you will have to write your credentials:

Deploy the project

In our project we will have to deploy 3 elements:

  1. Front End Code

  2. Back End Code

  3. SQL Database

We will divide the Heroku project into 2 applications:

  1. Front End Application

  2. Back End Application

Create the 2 applications!

IMPORTANT: DO NOT USE A CREDIT CARD (IS NOT NEEDED) Create both applications in the “Personal” area, if you create a Team you will have to complete a form with your credit card, and later all the applications will have a monthly cost.

Front-end Application

Create an application for the front-end code, click in New button:

Choose Europe as the region:

Using your terminal go to the project directory and checkout the branch you want to deploy, normally master or main, then write:

heroku git:remote -a “your_app_name”

It will create a new remote repository, it means that from now you will have two, one for GitHub and a new one for heroku. From now when you push changes again you will have to specify where do you want to push:

To push your commits to Github.com:

git push origin master

To push your commits to Heroku and deploy a new version in the public URL

git push heroku master

To check the deployed version in heroku, you can write:

heroku open

Back-end Application

You have to repeat the same process done in the front-end version.

The only difference is that the public URL that you will choose, you will not have to share it, because normally only you front-end application will access to this URL.

Database

Go to the back-end application in the Heroku platform, and in “Resources” tab, add the Postgres add-on:

Click in Provision button, then it will appear in the project:

If you click in “heroku Postgres” link you can access to the database information.

Go to Settings and View Credentials button:

Then you can see the connection information to access the database from your application and from DBeaver:

So now you can execute your scripts, as if you were working in your computer:

Environment variables

To Link the applications between them (the front-end send a request to the back-end) you will have to configure the new URLs and new ports (the URL will not be localhost and the port will not be 3000)

Also check that the deployed backend to connecting to the deployed Database using a public URL

Use secrets.js or ENV files to configure new addresses.

Heroku Extra features

Add a Custom Domain

Configure SSL

<to be completed>

Deployment Guides

Buy a Domain

<to be completed>

Buy SSL certificate

There are a lot of options:

Buy the SSL with Heroku, which costs if 20$ per month.

Godaddy when I speak with them, they offer a discount, 55,27€ per one year or 118,27€ per two years.

First of all register an account in

Write an available name, choose a good name because it will publish a unique URL to access to your project like:

or just put the complete URL in the browser:

Add a custom domain () to your application.

Follow the guide:

But also you will have to make some changes in your domain provider webpage, if you are using GoDaddy follos this guide:

Free SSL with . They offer a free plan for three months and then you would have to reinstall it again (also free) every three months.

Heroku Website
https://devcenter.heroku.com/articles/heroku-cli#download-and-install
https://your-app-name.herokuapp.com
https://your-app-name.herokuapp.com
www.yourdomain.com
Adding your custom domain to heroku app
Adding a GoDaddy domain to your heroku app
Zerossl.com
https://godaddy.comgodaddy.com