scanner_backend is a backend side represented as full-stack application with go-template for processing data from tg scanner
Server:
- gorilla/mux
- Apache Kafka
- Go Templates
DB:
- PostgreSQL
- golang-migrate/migrate
Testing:
- stretchr/testify
- DATA-DOG/go-sqlmock
- mockery/mockery
To run this project, you will need to add the following environment variables to your ".env" file:
POSTGRES_USER
- PostgreSQL userPOSTGRES_PASSWORD
- PostgreSQL user passwordPOSTGRES_HOST
- PostgreSQL hostPOSTGRES_DB
- PostgreSQL database nameMIGRATIONS_PATH
- Path to migrations:“file://./db/migrations”PORT
- Bind address which server will useDATABASE_URL
- this field you can use if you don’t want to create PostgreSQL fields
Clone the project
git clone git@github.com:VladPetriv/scanner_backend.git
Go to the project directory
cd scanner_backend
Install dependencies
go mod download
Start the server locally:
# Make sure that Apache Kafka and PostgreSQL are running
make run
To run tests, run the following command:
# Run it only if "mocks" folder not exist or if you updated "repository.go" files
make mock
make test