Coder Social home page Coder Social logo

flallet's Introduction

Microservice for working with user balance

Documentation

  1. Postman: docs/postman.json
  2. Swagger: localhost:3000/api/v1/docs

Requirements

  1. Go 1.19+: go.dev/dl
  2. Docker: docs.docker.com/get-docker
  3. Docker Compose: docs.docker.com/compose/install
  4. GolangCI: golangci-lint.run/usage/install

Makefile

Display all targets

make help
Usage:
  make <target>
  help                Display this help screen
  install             Installations
  lint                Run linters
  swag                Generate swagger docs
  run                 Run application
  migrate             Migrate database
  build               Build application
  compose-convert     Converts the compose file to platform's canonical format
  compose-build       Build or rebuild services
  compose-up          Create and start containers
  compose-down        Stop and remove containers, networks
  compose-logs        View output from containers
  compose-ps          List containers
  compose-ls          List running compose projects
  compose-exec        Execute a command in a running container
  compose-start       Start services
  compose-restart     Restart services
  compose-stop        Stop services
  docker-rm-volume    Remove db volume
  docker-clean        Remove unused data

Run microservice

Installations

make install

Up database

make compose-up services="db"

Migrate database

make migrate

Run application

make run

Run microservice in Docker

Create and start containers

make compose-up

Environment variables

Display all examples of variables

cat .env.example
# Backend
BACKEND_HOST         = localhost
BACKEND_PORT         = 3000
BACKEND_CORS_ORIGINS = http://localhost, https://localhost, https://localhost:8080, http://localhost:8080

# Database
DB_HOST = localhost
DB_PORT = 5432
DB_USER = postgres
DB_PASS = postgres
DB_NAME = db

# S3
S3_REGION            = us-east-1
S3_BUCKET            = flallet
S3_ENDPOINT          = https://flaiers.s3.amazonaws.com
S3_ACCESS_KEY        = ...
S3_SECRET_ACCESS_KEY = ...

Environment variables in Docker

Display all examples of variables

cat docker/.env.example
# Backend
BACKEND_HOST         = 0.0.0.0
BACKEND_PORT         = 3000
HOST_BACKEND_PORT    = 3000
BACKEND_CORS_ORIGINS = http://localhost, https://localhost, https://localhost:8080, http://localhost:8080

# Database
DB_HOST      = db
DB_PORT      = 5432
HOST_DB_PORT = 5432
DB_USER      = postgres
DB_PASS      = postgres
DB_NAME      = db

# S3
S3_REGION            = us-east-1
S3_BUCKET            = flallet
S3_ENDPOINT          = https://flaiers.s3.amazonaws.com
S3_ACCESS_KEY        = ...
S3_SECRET_ACCESS_KEY = ...

# Docker
COMPOSE_PROJECT_NAME = flallet

flallet's People

Contributors

flaiers avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.