Skip to content
/ webapp Public

A cloud-native web application built with Go, featuring CI/CD integration using GitHub Actions. Leveraging Terraform and Google Cloud Platform (GCP) for auto scaling, and cloud functions as serverless feature. This project automates the deployment of resources, ensuring scalability and reliability in cloud environments.

Notifications You must be signed in to change notification settings

jicodes/webapp

Repository files navigation

Webapp inplemented in Go/Gin with Postgres and Gorm

Prerequisites

  • Go 1.21.6
  • Postgres 16

Packages Installation

# for web server and routing - Gin
go get -u github.com/gin-gonic/gin

# for loading environment variables
go get -u github.com/joho/godotenv

# for DB
go get -u gorm.io/gorm
go get -u gorm.io/driver/postgres

# for hashing the password
go get -u golang.org/x/crypto/bcrypt

# for testing
go get github.com/stretchr/testify

# for logging
go get -u github.com/rs/zerolog/log

## Note

1. We need use cross build for Go app to build then run on a different environment.

```sh
# for local dev: build on local machine(MacOS) and run on VM server (Linux-CentOS)
GOOS=linux GOARCH=amd64 go build -o webapp

# for workflow: build in Github actions runner (latest-Ubuntu) and run on VM server (Linux-CentOS)
# use static linking to create a standalone binary that doesn't depend on dynamic libraries.
go build -ldflags="-linkmode external -extldflags -static" -o webapp

About

A cloud-native web application built with Go, featuring CI/CD integration using GitHub Actions. Leveraging Terraform and Google Cloud Platform (GCP) for auto scaling, and cloud functions as serverless feature. This project automates the deployment of resources, ensuring scalability and reliability in cloud environments.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published