bongster / golang_20210228

Golang Sample project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pipeline

golang_20210228

Golang Sample project

Sample transfer money project

Requirements


  • User accesses the service through an authenticated HTTP-based API. (user registration, login not required, provisioned user/credentials through SQL script are fine)
  • User should be able to send money to other users
  • User should be able to retrieve their balance, and transactions
  • Usually MobileWallet2020 stores their data on relational Database, but other means of storage are fine
  • Give some thought as to how the application would be monitored, instrumentation etc, considering that it would be expected to provide logging downstream to an external platform such as Prometheus (To be discussed during the interview)
  • Please state any assumptions that you make You have the luxury of proposing (not implementing) one killer feature in your app, to impress the management of the company.

Features

  • User can login
  • User can register
  • Only Authenticated user can access transfer, user information
  • User A send money to User B
  • User can see a users transaction history
  • Github CI Action
  • Maintain database schema
  • model base Unit test
  • Documentation
  • API base unit test
  • Stress test
  • Logging System
  • Monitoring System
  • Deployment

Database Diagram

This is an image database diagram

API Documentation


go to API documentation

Development


  • git clone project
  • run command docker-compose up or docker-compose up -d

HOW TO TEST

  • unit test -> go to src folder and run make test

HOW TO MIGRATE

  • In docker -> docker-compose build migrate -> docker-compose start migrate
  • In terminal -> go to src folder and make migrateup

TODO

  • Fixing take longer in unit test
  • Configure Logging system
  • Configure Monitoring System
  • Deployment
  • Set Load test
  • Support multiple currency by user

Tech Stacks


  • Golang
  • go-migrate
  • Postgres
  • docker
  • docker-compose
  • sqlc
  • gin

References

About

Golang Sample project


Languages

Language:Go 93.2%Language:Makefile 5.1%Language:Dockerfile 0.8%Language:Shell 0.8%