Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 1.36 KB

README.md

File metadata and controls

64 lines (45 loc) · 1.36 KB

Welcome to go-mq-boilerplate 👋

documentation: yes maintained: yes

This project is boilerplate for Message Queueing Processing, in this project using MySQL Database, and using RabbitMQ Message Broker, and using AMQP for interacting with the RabbitMQ.

Tech Stack

  • Programming Language : Go
  • Message Broker : RabbitMQ
  • Database : MySQL
  • Query Builder : DBR
  • Architecture : Clean Architecture

Getting Started

  • Clone this project & Rename everything as your project

  • Then run these command

    go mod tidy
    go mod download
    go mod verify
  • Create .env file, here is the example

    DB_DRIVER="mysql"
    DB_HOST="localhost"
    DB_NAME="foobar"
    DB_PASSWORD="password"
    DB_PORT="3306"
    DB_USER="root"
    MQ_PORT="5672"
    MQ_USERNAME="guest"
    MQ_PASSWORd="guest"
    MQ_HOST="localhost"
    MODE="mq"
  • Create your database, and set the name inside .env file

  • Start your RabbitMQ service, and set the host,user,pass for connect to your RabbitMQ

  • Compiling project & Migrate tables defined inside db/schemas folder

    go build -o mq.exe main.go
    mq.exe migrate --loadenv .env
  • Run the server

    mq.exe run-server