Questions and answers example project.

Question Answer Service

REST Service for questions and answers

Database modeling

model

Directory tree

  • pkg: Here is the main source code.
  • sql: Here are all the SQL files to create the tables, data insertions and methods (it is not necessary run these files manually).
  • postman: Here is a json file to import to your local Postman.

1. Requirements

Software Version Importance
🐳 Docker 20.10.11 Required
🐙 Docker Compose 1.29.2 Required
🐃 GNU Make 4.2.1 Optional
‍🚀 Postman 9.1.5 Optional

2. Prepare the environment file (.env)

  1. Copy the .env-example file to .env file:
cp .env-example .env
  1. Fill out the variables with your own credentials, If you want to start quickly, these are the default values (do not modify):
API_PORT=8087

POSTGRES_DB=qas_db
POSTGRES_USER=qas
POSTGRES_PASSWORD=secret
POSTGRES_DRIVER=postgres
POSTGRES_HOST=qas_pgsql

3. Run the service

  1. Execute the command make l/up, if you are on Windows execute:
docker-compose down --remove-orphans --rmi all

and

docker-compose --env-file ./.env up --detach --remove-orphans --force-recreate --build

The queries at .sql/ directory run with the docker-composer command (lines 21, 22), so it is not necessary run separately.

  1. Finally, you can run the command, the output should be an array with all the questions.
curl http://127.0.0.1:8087/question

4. Testing using postman

  • You can import the collection file at ./postman/collection.json
  • You can import the environment file at ./postman/environment.json
Owner
Ken Esparta Ccorahua
Software Engineer
Ken Esparta Ccorahua
Similar Resources

Example go clean architecture folder pattern

Golang Clean Architecture (Maintenance) Berikut ini adalah folder structure pattern yang biasa saya gunakan, walaupun tidak semua nya saya terapkan di

Dec 21, 2022

Go realworld example

TODOs Users and Authentication POST /user/login: Existing user login POST /users: Register a new user GET /user: Get current user PUT /user: Update cu

Dec 8, 2022

A golang example of gRPCtutorials.

A golang example of gRPCtutorials.

Nov 20, 2021

A software architecture style example for APIs that utilizes the features of SOLID-Principle.

A software architecture style example for APIs that utilizes the features of SOLID-Principle.

Engelbyte's Waterbyte Clean Architecture A software architecture style example for APIs that utilizes the features of SOLID-Principle. The example sho

Feb 9, 2022

This project is a GO Restful API service with Gin framework and Gorm SQLite with authorization

GO Restful API service with Gin framework and Gorm SQLite Template Structure Gin is a web framework written in Go (Golang). It features a martini-like

Oct 24, 2022

This project is a collection of many of the basic tools used on Unix-like operating systems implemented in Go as a learning exercize.

GoUnix This project is a collection of many of the basic tools used on Unix-like operating systems implemented in Go as a learning exercize. The idea

Jul 21, 2022

Go-Notebook is inspired by Jupyter Project (link) in order to document Golang code.

Go-Notebook is inspired by Jupyter Project (link) in order to document Golang code.

Go-Notebook Go-Notebook is an app that was developed using go-echo-live-view framework, developed also by us. GitHub repository is here. For this proj

Jan 9, 2023

The purpose of this project is to learn about go-swagger.

learn-go-swagger The purpose of this project is to learn about go-swagger. Requirements Go go-swagger Setup Run ./scripts/gen-swagger to generate swag

Nov 20, 2021

Exercise project written in Go that I did on my own during the course "gRPC [Golang] Master Class: Build Modern API & Microservices" taught by Stephane Maarek on Udemy

calculator Exercise project written in Go that I did on my own during the course "gRPC [Golang] Master Class: Build Modern API & Microservices" taught

Nov 9, 2022
At this example project, I'm trying to learn Golang with Clean structure and come up with a reusable

Learning Golang Language In Clean Structure At this example project, I'm trying to learn Golang with Clean structure and come up with a reusable, nice

Sep 25, 2022
Learn-Nakama - An example project template on how to set up and write custom logic in Nakama server

Nakama Project Template An example project template on how to set up and write c

Apr 18, 2022
This is my first golang project. The main reason for its existence is the need for practice. I will be studying golang while writing this project

My first GoLang project Project Aim The goal of this project is to develop the most simple golang bot to learn how to work with this programming langu

Jan 7, 2022
Go-beginners-guide-project - golang beginners project from tutorialedge.net

Go Beginner's Project Running Locally If you want to run this application locally then run the following commands: $ go run cmd/cli/main.go Build Appl

Jan 2, 2022
Example skills and a cli utility written in Go for interacting with Webex Assistant Skills

Webex Assistant Skills - Go This repository holds example skills and a cli utility written in Go for interacting with Webex Assistant Skills. It is in

Oct 29, 2021
This is an example of a keep-it-simple directory layout for Go projects that was created using DDD principles, please copy and share if you like it.

DDD Go Template This project was created to illustrate a great architectural structure I developed together with @fabiorodrigues in the period I was w

Dec 5, 2022
Example repository for embedding Litestream in a Go application.

Litestream as Library This repository is an example of embedding Litestream as a library in a Go application. The Litestream API is not stable so you

Dec 6, 2022
go mev-geth example. signTx,send transaction to relay.

go-mev-geth go mev-geth example. signTx,send transaction to relay. sample smart contract /eth/contract/mevtransfer/mevtransfer.sol pragma solidity 0.6

Dec 9, 2022
Example code for my Cadence Intro Workshop

Temporal Intro Workshop This repository contains example code for my Temporal Intro Workshop. Prerequisites Git, Make, etc. Make sure you have the lat

Dec 18, 2022
Example resource for alt:V Go module

Example resource for alt:V Go module

Dec 9, 2022