You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

github.com/erickoliv/finances-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/erickoliv/finances-api

v0.0.0-20201225193838-1f6e3fedb249
Source
Go
Version published
Created
Source

Build Status codecov Go Report Card HitCount

This is just a personal project I'm using to learn the Go programming language and its libraries.

using different package approaches to validate the better structure for each use case

The road so far

  • configs from environment
  • go modules
  • GORM atabase models, using UUID as identifiers
  • Dockerfile with build layer
  • docker-compose for single machine deployment
  • JWT Authentication

Pending

  • Replace GORM for a better solution, without so many abstrations
  • improve database migration
  • Validate Request Payloads
  • better error handling, with "stack trace" build, using errors.Wrap
  • metrics using influx and grafana
  • > 90% test coverage
  • Split domain interface definitions into Reader and Writer actions

Running:

create a .env file containing application environment variables:

APP_TOKEN=aRandomGeneratedString
DB_NAME=databaseName
DB_USER=databaseUsername
DB_PASSWORD=databasePassword
DB_HOST=0.0.0.0
DB_PORT=5432
IMAGE_NAME=dockerRepositoryImage
IMAGE_VERSION=dockerTagVersion
GIN_MODE=release 

vscode configuration file for debugging

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${workspaceFolder}/main.go",
            "envFile": "${workspaceFolder}/.env",
        }
    ]
}

deploy a local database server for development

$ make database

show database logs

$ docker logs financedb

build docker image and execute development environment with a local database

$ make dev

FAQs

Package last updated on 25 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts