Backend system for a simple dating app. The system is built using Golang and PostgreSQL. in this project I use multiple protocols, GRPC and RestFull API. This project represents speed in feature development
- Golang version 1.21 or higher
- PostgreSQL
- Docker
- Docker Compose
- Makefile
- Golang Migrate
- Golang Mockery
- Buf Protoc
- Golang Google Wire
-
Connect RPC
Connect RPC is a library for building RPC servers and clients in Go. It's built on the gRPC framework, and it's designed to be easy to use and highly performant.
Connect RPC support multiple protocols, such as HTTP/1.1, HTTP/2, and gRPC.
-
Gin Gonic
Gin is a web framework written in Go, Gin support RESTful API and http2 it's easy to use.
-
Gorm
Gorm is a library for building ORM in Go, it's easy to use and support multiple databases. Using gorm we can build a database model easily and fast, then focus for the business logic.
-
Go Cron
Go Cron is a library for building cron jobs in Go, it's easy to use and support multiple time format. I use this library to build a cron job for deleting the table interest that has been show for yesterday.
- Clone this repository
- Create a new file
.env
in the root directory - Copy the content of
.env.example
to.env
- Fill the
.env
file with your configuration - Run the mode development following command
make gow
- Run in docker compose
docker-compose up
- Connect your database and Run the migration
make migration-up version=1
Run the test following command
make test
assets
contains the assets for the projectconfig
contains the configuration for the projectconstant
contains the constant for the projectcrons
contains the cron job for the projectdomain
contains the contract interface for the projectdto
contains the data transfer object for the projectgen
contains the generated file from the protobufinjector
contains the dependency injection for the projectmiddleware
contains the middleware for the projectmigration
contains the database migration for the projectmodel
contains the database model for the projectpkg
contains the package or utils for the projectproto
contains the protobuf file for the projectrepository
contains the repository to access the databaserouters
contains the router handler for the projectservice
contains the service to handle business logic for the project.env
contains the environment configuration for the project.env.example
contains the example of the environment configuration for the project.gitignore
contains the git ignore for the projectgo.mod
contains the go module for the projectgo.sum
contains the go sum for the projectmain.go
contains the main file for the projectMakefile
contains the makefile for the projectbuf.gen.yaml
contains the buf configuration for generate proto the projectbuf.yaml
contains the buf configuration for the projectDockerfile
contains the docker file for the projectdocker-compose.yaml
contains the docker compose file for the projectREADME.md
contains the readme and documentation for the project