Real-Dev-Squad / discord-service

MIT License
0 stars 2 forks source link

Discord Service Setup and Running Instructions

This document provides instructions on how to set up and run the Go project using the provided Makefile commands.

Requirements

Ensure you have these dependencies installed before running the commands.

Prerequisites

Before running the project, ensure that you have the following installed:

Installation

  1. Install Go If you don't have Go installed, follow the official guide to install it:Go Installation Guide.
  2. Install Make To install Make, follow the installations steps from here based on your OS: Make Installation Guide.
  3. Install Ngrok To install Ngrok, follow the installation steps here: Ngrok Installation Guide.
  4. Install Air To install Air, follow the installation steps here: Air Installation Guide

Running the Project Using Go

  1. Install Packages

    go mod download
  2. Verify Packages If it's your first time running the project, ensure all dependencies are set up:

    go mod tidy
  3. Running the Project

    go run .
  4. Running the Project Using Air

    air

Running the Project Using Make

You can run the project using the Makefile, which provides several commands for various tasks. Below are the steps to run the project:

  1. Install Packages

    make download
  2. Verify Packages If it's your first time running the project, ensure all dependencies are set up:

    make tidy
  3. Running the Project

    make run
  4. Running the Project Using Air

    make air

Run the Project Using Docker

You can run the project using the Docker, using the following steps

  1. Compose the Image

    docker-compose up --build

    You can also run the command above in detach mode by specifying -d flag in the end

  2. Remove the Image If you are done with running the docker image and want to remove the image, run the ocmmand below

    docker-compose down

Other Commands Usage

  1. To run tests:

    make test #or go list ./... | grep -v "/config$$" | grep -v "/routes$$" | xargs go test -v
  2. To generate a coverage report:

    make coverage #or go list ./... | grep -v "/config$$" | grep -v "/routes$$" | xargs go test -v -coverprofile=coverage.out
  3. To automatically re-run the application on changes:

    make air #or air
  4. To clean up the generated files:

    make clean #or rm -rf coverage coverage.out coverage.html