# README
My Local Financier Backend
Technology stack
- go 1.16
- gin 1.7.4
- docker 20.10.13
- docker-compose 1.29.2
Database migrations
Postgres 14+ is used
Migrations located in migrations folder
To run migrations manually you can use go-migrate. After installation use command bellow in root directory:
migrate -path ./migrations -database postgresql://{username}:{password}@{host}:{port}/{dbname}?sslmode=disable up
To run database container:
docker run --name mlf-db -e POSTGRES_USER=user -e POSTGRES_DB=db -e POSTGRES_PASSWORD=pass -d -p 5432:5432 postgres
Documentation generation
For API documentation swag library is used. To generate swagger docs install swag cli and use command
swag init -g cmd/app/main.go
API specification will be available at http://localhost:port/swagger/index.html.
Testing
For testing testify and mockery is used. To generate mocks use mockery command:
mockery
Run project with Docker Compose
To build app containers docker-compose libraries is used.
Initial build command:
docker-compose up -d
To update server on running container:
docker-compose up --no-deps --force-recreate -d --build server