scanner_backend
scanner_backend is a backend side represented as full-stack application with go-template for processing data from tg scanner
Tech Stack
Server:
- gorilla/mux
- Apache Kafka
- Go Templates
DB:
- PostgreSQL
- golang-migrate/migrate
Testing:
- stretchr/testify
- DATA-DOG/go-sqlmock
- mockery/mockery
Environment Variables
To run this project, you will need to add the following environment variables to your ".env" file:
POSTGRES_USER
- PostgreSQL user
POSTGRES_PASSWORD
- PostgreSQL user password
POSTGRES_HOST
- PostgreSQL host
POSTGRES_DB
- PostgreSQL database name
MIGRATIONS_PATH
- Path to migrations:“file://./db/migrations”
PORT
- Bind address which server will use
DATABASE_URL
- this field you can use if you don’t want to create PostgreSQL fields
Run Locally
Clone the project
git clone [email protected]: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
Running Tests
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
License
MIT