Categorygithub.com/wonjinsin/web-api-language-agnostic
modulepackage
0.0.0-20241221051831-896561799a20
Repository: https://github.com/wonjinsin/web-api-language-agnostic.git
Documentation: pkg.go.dev

# README

wonjinsin/go-web-boilerplate(pikachu)

Simple rest api server with Echo framework

License MIT DB Version Go Report Card

Features

  • Gorm : For mysql ORM
  • Zap : Go leveled Logging
  • Viper : Config Setting
  • Makefile : go build, test, vendor using Make

Project structure

Clean Architecture with DDD(Domain Driven Design) pattern

Getting started

Set infra

$ docker-compose -f infra-docker.yml up -d

Initial action

$ make all && make build && make start

Migration initial data

$ make migrate-up ENV=local

If you have error when Init Please use below command and do Inital action again

make clean

MakeFile Command

migrate up

# e.g make migrate up ENV=local
$ make migrate-up ENV=${ENV}

migrate down

# e.g make migrate down ENV=local
$ make migrate-down ENV=${ENV}

Build vendors

$ make vendor

Build and start

$ make build && bin/pikachu

Test

$ make vet && make fmt && make lint && make test
// or
$ make test-all

Clean

$ make clean

Docs

Specification

https://github.com/upsidr/coding-test/blob/main/web-api-language-agnostic/README.ja.md

Api docs

  • Use this with post man, swagger etc

    open api

How to use

  1. Set initial datas at Getting Started

  2. Get access token with /auths/signin api, mock user is already created

  3. Put access token to Bearer token, and call other apis(need create with post api/invoices first to get invoices)

todo

  • todo. add test code for service logic, e2e
  • todo. consider library gorm to sqlc because of reflect performance problem
  • todo. refactoring code with writing test code
  • todo. consider about in-memory or caching for perfomance

# Packages

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