🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

github.com/Iluhander/currency-project-backend

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/Iluhander/currency-project-backend

Source
Go Modules
Version
v0.0.0-20241030021051-9a522452a9e8
Version published
Created
Source

Virtual currency service

Provides a thin additional layer above payment systems. The layer stores currency balances of users. The service functionality may be extended by modifying the request pipeline handler.

Usage

  • Specify configuration in a .env file at the root of the project. The config should include the following fields:
    • SERVE_ENDPOINT: the ip or domain name listened by the application. Defaults to '127.0.0.1'
    • SERVE_PORT: the port listened by the application. Defaults to 8787.
    • DB_HOST: the ip or domain name of the DBMS. 'Defaults to 127.0.0.1'
    • DB_PORT: the port listened by the DBMS. Defaults to 5432.
    • DB_USER: the database user.
    • DB_PASSWORD: the database user's password.
    • DB_NAME: the database name.
  • Note, that for now only the postgres database is supported
  • Build the service:
    • Docker: sudo docker build -t mse-back:1.0 .
    • Executable: go build -o srvr ./cmd/main.g
  • Run the service with:
    • Docker: sudo docker run -d -p 8787:8787 --network <db_network> mse-back:1.0
  • Setup requests handling logic: each user balance modification request is handled by this service and external services in a specific order. This order is declared in an implementation of the Pipeline pattern in the virtual currency service. You can modify the pipeline using the api, described in the currency-project-api/openapi-back.yaml. There are currenly 3 types of pipelines:
    • Statistics service, being called first to observe the state of the system,
    • Authentication services, being called second to control the access,
    • Payment service, being called at the end to perform the payment.

Development

Technologies

  • The Go language
  • The gin router
  • The Docker containerization system
  • The Postgres database
  • HTTP Protocol

Modifying

  • Create a .env.development file at the root of the project containing the .env file fields
  • go run ./cmd/main.go --dev

TODO

  • Add support for gRPC
  • Add support for databases besides Posgres

FAQs

Package last updated on 30 Oct 2024

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