https://github.com/mateenbagheri/mysmall-wallet
A simple API project in GO implementing a simple E-wallet
https://github.com/mateenbagheri/mysmall-wallet
api-rest go golang mysql
Last synced: 4 months ago
JSON representation
A simple API project in GO implementing a simple E-wallet
- Host: GitHub
- URL: https://github.com/mateenbagheri/mysmall-wallet
- Owner: mateenbagheri
- Created: 2022-10-28T18:09:26.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-01T09:40:37.000Z (over 2 years ago)
- Last Synced: 2025-01-13T18:35:11.859Z (5 months ago)
- Topics: api-rest, go, golang, mysql
- Language: Go
- Homepage:
- Size: 2.9 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mysmall-wallet
My small wallet is a simple project initially written for a challenge. This project, contains two main APIs:● get-balance:
This API should return a JSON to show the current balance of a user. The parameter which is
needed for this API is user_id and the output should be like the below sample:
```
Input : user_id int
Output : {"balance":4000}
```
● add-money:
This API should add money to the wallet of a user and at the end return the transaction reference
number. The parameter which is needed for this API is user_id and amount and the output should
be like the below sample:
```
Input: user_id int amount int (this parameter can be negative)
Output: {"reference_id":12312312312}
```
There is also an scheduling feature implemented which calculates total amount of transaction done in a day and print it out in the terminal.## How to run?
This application is going to be dockerized soon but till then, if you have go 1.18 installed, simply clone the project, cd to the project dir
and type out these following instructions:
```Batchfile
go mod tidy
go mod vendor
```
after this, you will have all dependancies installed. Now, for running the application simply type out the following command
```Batchfile
go run cmd/main.go
```You also need a mysql database to run migrations on. You can set up your database and schema preferences in `envs/evs.json`