Categorygithub.com/SerjLeo/mlf_backend
repository
0.0.0-20230129224608-7069c3fc22f9
Repository: https://github.com/serjleo/mlf_backend.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

My Local Financier Backend

Technology stack

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