Categorygithub.com/adamnasrudin03/go-template
modulepackage
0.0.4
Repository: https://github.com/adamnasrudin03/go-template.git
Documentation: pkg.go.dev

# README

go-template

This project is an example of a REST API project using the Go language and the implementation of other tools, such as Auth with JWT, Basic Auth, Logger API, Cache, ORM SQL, Message Broker, Export Excel File, OTP Mechanism, Deploy with Docker, Clean Code (smell code checker by CodeScene), Unit Test, and so on.

Technology Used

Feature

MethodAuthEndpointDec
GETno/Welcome API
POSTno/api/v1/auth/sign-upRegister user with role USER
POSTyes/api/v1/root/auth/sign-upRegister user with role USER or ADMIN, auth with super admin (root)
POSTno/api/v1/auth/sign-inLogin
PATCHyes/api/v1/users/:idUpdate User
GETyes/api/v1/users/:idDetail User
GETyes/api/v1/usersList User, auth only admin or super admin (root)
PATCHyes/api/v1/users/change-password/:idChange Password
GETyes/api/v1/users/send-email-verifySend OTP Email verified
POSTyes/api/v1/users/verified-emailVerified email with otp
GETno/api/v1/users/request-reset-password/:idSend OTP Email forgot password
PATCHno/api/v1/users/validate-reset-password/:idVerified Reset password
GETyes/api/v1/logsList log activity history
GETyes/api/v1/logs/downloadDownload xlx List log activity history
GETyes/api/v1/message/translate/idTranslate text to language id (indonesia)
GETyes/api/v1/message/consumerTrigger manual consume queue rabbitMQ

Role

  • ROOT (role super admin) = create a user the first time the project is run, check here
  • ADMIN (role admin)
  • USER (role user)

Development Guide

Documentations

Postman API Documentation

Collection Using Postman

  • ./go-template.postman_collection.json

Installation

  • Clone this repo

        git clone https://github.com/adamnasrudin03/go-template.git
    
  • Copy .env.example to .env

        cp .env.example .env
    
  • Setup local database

  • If you using RabbitMQ, Please check or create queue for ./app/models/queue.go

  • Start service API

        go run main.go
    

Build project by docker

  • check ip address in terminal

        ipconfig
    
  • change data environment in file ./docker-compose.yml

  • build with docker compose

        docker-compose -f "docker-compose.yml" up -d --build 
    
    • with make file
        make docker
    

Coverage Unit Test

  • with make file
    make cover

Connect with me

linkedin logo

# Packages

No description provided by the author
No description provided by the author