Skip to content

bygui86/go-complete-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-complete-project

This is a blog application where a user can:

  • Signup (Register)
  • Edit his account
  • Shutdown (Delete his account)
  • Create a blog post
  • Edit blog post
  • View all blog posts
  • View a particular blog post
  • View other blog posts published by other users
  • Delete blog post

Technologies

  • Go
  • GoDotenv
  • GORM (Golang ORM)
  • Postgres
  • Mysql
  • Gorilla Mux (HTTP routing and URL matcher)
  • JWT

You might be wondering seeing Postgres and Mysql. The API is built in a way that you can decide to use Mysql or Postgres driver, simply by changing the configuration in the .env.


Spin it up!

Prepare

export GO111MODULE=on

Build

Run

Test

# all
go test -v ./...

# models only
cd tests/modeltests && go test -v && cd ../..

# controllers only
cd tests/controllertests && go test -v && cd ../..

# specific one only
go test -v --run TestFindAllUsers
go test -v --run TestUpdatePost
go test -v --run TestLogin
go test -v --run TestCreateUser

Improvements

  • implementation, clarification of doubts
  • implement db unit-testing using interface and mocks
  • try use testcontainers-go for integration-testing
  • improve logging
  • improve error handling
  • improve structure
  • docker
  • kubernetes
  • kubernetes probes
  • interrupt signals
  • prometheus metrics
  • tracing

Links

Part 1 > Version 1.x

Part 2 > Version 2.x

Part 3 > Version 3.x

About

Golang complete project: CRUD RESTful API service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages