Skip to content

Started as a backend code challenge but I wanted to make it complete production ready for myself, will be updating it

Notifications You must be signed in to change notification settings

jvfrodrigues/production-ready-golang

Repository files navigation

Production Ready Reference for Go

Project given by WEX as code challenge, a API that stores transaction and allows users to retrieve those transactions converting the value of the trasaction to the speciefied country's currency

Language

This project is written in Golang 1.21

Used libraries

Gin is our HTTP Server, it handles our routing system and HTTP requests

ORM library for dealing with database connections

Helps in validating our entities and dtos

Leveled loggin library

Testing tools

How to run

The project can run through Docker or locally first will need to

  1. Download and install Go and/or Docker

  2. Download this repository

     git clone https://github.com/jvfrodrigues/transaction-product-wex
  3. Create .env file copying .env.example

    cp .env.example .env

Using Docker

  1. Run docker compose

     docker-compose -f docker-compose-prod.yaml up -d
  2. Test! It should run on localhost:8080

  3. If you want you can set the env variable in .env to "prd" so it will use postgres instead of sqlite

Locally

  1. Install all dependencies
    go mod download
  2. Run the project
    go run main.go
  3. Test! It should run on localhost:8080

Routes

All available routes are on the insomnia file in the repository.

Here is a list of the routes:

About

Started as a backend code challenge but I wanted to make it complete production ready for myself, will be updating it

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages