REST API written in GO with PostgreSQL and Nginx Proxy + Certbot Let's Encrypt HTTPS certificates + Graphical Frontend in PHP. Deployed via docker-compose.

SSOA-PT REST APP

Services

  • Backend: REST API in Go
    • Database: PostgreSQL
    • Web Proxy: Nginx
      • Let's Encrypt HTTPS certificates with certbot
  • Frontend: PHP App

How to run the app

Install docker https://docs.docker.com/engine/install/ and docker-compose https://docs.docker.com/compose/install/.

Now become root, or make sure your user is allowed to use docker.

Make sure your server has port 80 and 443 exposed to the Internet.

Clone this repo to your machine.

Before the first run, get a Let's Encrypt certificate by executing the bash script ./init-letsencrypt.sh.

After that, you can run the app via docker-compose up -d.

Optional configuration

By default, the app gets the current public ip address and creates a domain name with the help of nip.io. If you want to use your own dns domain, supply the environment variable PUBLIC_SERVER_NAME to the init script ./init-letsencrypt.sh, or by setting it in a .env file in the root project directory.

PUBLIC_SERVER_NAME=
   
    
STAGING=1

   

Set STAGING to 0 if you want to use Let's Encrypt without --staging (production mode).

Set the database password in the file ./db/password.txt

Lastly, have a look at the main configuration file docker-compose.yaml.

Deploy with docker-compose

Run the stack

docker-compose up -d

View logs

docker-compose logs

Restart the stack

docker-compose restart

Stop and remove the containers

$ docker-compose down

All persistent data will be stored in ./data/. Remove this directory too.

Similar Resources

Best lightweight, powerful and really fast Api with Golang (Fiber, REL, Dbmate) PostgreSqL

Best lightweight, powerful and really fast Api with Golang (Fiber, REL, Dbmate) PostgreSqL

Dec 26, 2021

Another - REST API Written In Go

REST API Written In Go This simple REST API was built to better understand how t

Feb 10, 2022

A restful api's with Gin Framework with a structured project that defaults to PostgreSQL database

A restful api's with Gin Framework with a structured project that defaults to PostgreSQL database

Welcome to Golang Gin boilerplate v2 The fastest way to deploy a restful api's with Gin Framework with a structured project that defaults to PostgreSQ

Oct 15, 2021

GO API with Gin Gonic with postgresql using gorp

GO API with Gin Gonic with postgresql using gorp Tips: Make sure you have project in src folder of $GOPATH Also, iniitalize go mod init project-name a

Jul 28, 2022

Ecommerce-api - Rest api of e-commerce web application

Ecommerce-api - Rest api of e-commerce web application

E-commerce Rest API Swagger documentation to test api Domain diagram

Jan 2, 2023

goof is a woof written in go - share files via a simple httpd

#goof - share files through HTTP protocol goof (Go Offer One File) is a very simple tool to send and receive files on your local LAN. Features include

Oct 4, 2022

Account Generator Bot, written in GoLang via gotgbot library

Account Generator Bot Account Generator Bot, written in GoLang via gotgbot library. Variables Env Vars - BOT_TOKEN - Get it from @BotFather CHANNEL_ID

Dec 28, 2021

An easy, fluent way of building URLs via chainable methods written in Go(lang)

Burl - a fluent URL builder Burl provides an easy, fluent way of building URLs via chainable methods. How to install go get github.com/mr-cryka/burl Q

Feb 5, 2022

A Golang REST API to handle users and posts for a simple instagram backend. Uses MongoDB as the database. Tested using golang-testing and Postman.

A Golang REST API to handle users and posts for a simple instagram backend. Uses MongoDB as the database. Tested using golang-testing and Postman.

A Golang REST API to handle users and posts for a simple instagram backend. Uses MongoDB as the database. Tested using golang-testing and Postman.

Oct 10, 2021
A CRUD Phone Book app by REST-API, Golang and PostgreSQL
A CRUD Phone Book app by REST-API, Golang and PostgreSQL

in this repository, I've created a CRUD Phone Book app by REST-API, Golang and PostgreSQL. in this app, you can: 1-Create a new contact 2-See all contacts 3-Search among the contacts 4-Delete a contact by it's name 5-Delete a contact by it's number 6-Delete all contacts

Oct 8, 2022
Go (Golang) API REST with Gin FrameworkGo (Golang) API REST with Gin Framework

go-rest-api-aml-service Go (Golang) API REST with Gin Framework 1. Project Description Build REST APIs to support AML service with the support of exte

Nov 21, 2021
Go-restapi - Go REST API with mysql and docker

GET localhost:8080/polygons localhost:8080/polygons/:name localhost:8080/polygon

Jan 24, 2022
A barebones Go app, which can easily be deployed to Heroku

go-getting-started A barebones Go app, which can easily be deployed to Heroku. This application supports the Getting Started with Go on Heroku article

Nov 29, 2021
Go-get-gin - Simple golang app deployed on gcp

go-get-gin a simple golang gin app to be deployed on gcp Getting started make su

Jan 12, 2022
Oct 1, 2021
gin middlewares, just like nginx try-file function

Gin Middleware TryFile This project is to solve the problem that the gin framework processes the dynamic routing file in the front-end compilation fil

Aug 11, 2022
Plenti Static Site Generator with Go backend and Svelte frontend
Plenti Static Site Generator with Go backend and Svelte frontend

Plenti Static Site Generator with Go backend and Svelte frontend Website: https://plenti.co Requirements ❗ You must have NodeJS version 13 or newer As

Jan 2, 2023
A barebones URL Shortener implementation in Go using Gin and MySQL. Also features a basic frontend.

URL Shortener in Go This is a barebones URL Shortener implementation in Go using the Gin web framework and MySQL. Also features a basic frontend. Loca

Dec 22, 2021
A basic example of a go web server with a react frontend
A basic example of a go web server with a react frontend

GO-React starter This is a basic example of a go web server with a react frontend. It uses the go fiber framework Getting started Running locally Clon

Nov 16, 2021