Skip to content

raflynagachi/go-rest-api-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go REST API starter kit

Coverage Status Go Report Card

Overview

The Go REST API Starter Kit is a boilerplate project designed to help you quickly set up and develop RESTful APIs using Go.

Prerequisites

  • Go (version 1.22.x)
  • Postgres 16
  • mockery (for mock testing)

Setup

  1. Create Database

    CREATE DATABASE go-rest-api-starter;
  2. Run DDL Script

    • Execute the DDL script in migration directory to set up the database schema.
    make migrate-up -e DB_HOST=localhost -e DB_PORT=5432 -e DB_NAME=go-rest-api-starter -e DB_USER=postgres -e DB_PASSWORD=postgres
  3. Configure Environment

    • Create environment configuration files in the env directory with the filename format {appname}.{env}.json. Please check the example file.

How to Run

Make sure to follow Setup section first

  1. Build the Project

    make build # linux/mac

    Then, run the binary file bin/go-rest-api-starter

  2. Run Locally

    make run

How to Test

Run the unit test using:

make test

How to mock

Run the mock (mockery required) using:

make mock

About

A Go REST API starter kit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors