Go RESTful API with Gin Web Framework & PostgreSQL

This is an example golang backend application using PostgreSQL database with clean architecture.

Features

Getting Started

# download the project
git clone https://github.com/aabdullahgungor/personel-resume-api.git

cd personel-resume-api

Build and run image of docker

docker-compose up  --build  -d

Access API using

http://localhost:8000/api/v1

Database Diagram

Database

Sample of Endpoints

  • GET localhost:8000/api/v1/personals
  • GET localhost:8000/api/v1/personals/:id
  • POST localhost:8000/api/v1/personals
  • PUT localhost:8000/api/v1/personals
  • DELETE localhost:8000/api/v1/personals/:id
  • ........

Open API Doc Preview

http://localhost:8000/api/v1/swagger/index.html

Swagger

How to run the test?

# Run tests
go test ./test/test_controller -v
go test ./test/test_service -v