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.
- 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
- Docker:
- Run the service with:
- Docker:
sudo docker run -d -p 8787:8787 --network <db_network> mse-back:1.0
- Docker:
- 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.
- The Go language
- The gin router
- The Docker containerization system
- The Postgres database
- HTTP Protocol
- Create a .env.development file at the root of the project containing the .env file fields
go run ./cmd/main.go --dev
- Add support for gRPC
- Add support for databases besides Posgres