Skip to content
Ebenezer Emelogu edited this page Jul 18, 2024 · 12 revisions

Environment Setup for HNG Boilerplate Golang Web

Overview

This document outlines the environment setup required to run the HNG Boilerplate Golang Web application. It covers the necessary software, hardware, and configuration settings to ensure a smooth development and deployment process.

Required Software

Go Programming Language

  • Version: 1.17 or later
  • Installation: Follow the official Go installation guide for your operating system.

PostgreSQL

  • Version: 9.6 or later
  • Installation: You can install PostgreSQL using the package manager of your choice:
    • Homebrew (MacOS):
      brew install postgresql
    • APT (Ubuntu):
      sudo apt-get update
      sudo apt-get install postgresql postgresql-contrib
    • YUM (CentOS):
      sudo yum install postgresql-server postgresql-contrib

Docker (Optional)

  • Purpose: To run PostgreSQL instances in containers, simplifying setup and teardown.
  • Installation: Follow the official Docker installation guide.

Git

Setting Up the Environment

PostgreSQL Instances

You need two PostgreSQL instances: one for regular development and one for running tests. You can set them up locally or use Docker for convenience.

Using Docker

To set up PostgreSQL instances using Docker, run the following commands:

docker run --name main_db -e POSTGRES_PASSWORD=password -d postgres
docker run --name test_db -e POSTGRES_PASSWORD=password -d postgres