Skip to content

Backend API using Go for users to overview and manage brokers, transactions and overall financial operations.

License

Notifications You must be signed in to change notification settings

Zapharaos/fihub-backend

Repository files navigation

GitHub Release Build Status codecov

GitHub License Go Report Card

fihub-backend

The backend handles users' requests to list their financial transactions and provide analysis. It connects to brokers selected by the users to retrieve their assets and transactions.

Development

Docker

This project is using Docker. Get started here.

Start

docker-compose up

Includes Air for hot-reloading.

Debug

docker-compose -f docker-compose.yml -f docker-compose.debug.yml up

Includes Delve for debugging on top of Air.

When using JetBrains Goland, learn how to attach the debugger to a Go process that is running in a Docker container here.

Production

Work in progress.

Dependencies

Install goose

go install github.com/pressly/goose/v3/cmd/goose@latest

Install swag

go install github.com/swaggo/swag/cmd/swag@latest

Goose

To create a new migration file

goose create file_name sql

To apply the migrations

goose -dir migrations postgres "host=localhost port=5432 user=postgres password=postgres dbname=fihub sslmode=disable" up

Swagger

Generate the swagger file.

swag init -ot yaml

Display swagger-ui with the generated swagger file at this local url

# Bash
docker run --rm -d -p 80:8080 -e SWAGGER_JSON=/tmp/swagger.yaml -v `pwd`/docs:/tmp swaggerapi/swagger-ui
# Powershell
docker run --rm -d -p 80:8080 -e SWAGGER_JSON=/tmp/swagger.yaml -v "$(pwd)/docs:/tmp" swaggerapi/swagger-ui

Generate the angular typescript client.

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/docs/swagger.yaml -g typescript-angular -o /local/docs/angular

# Powershell
docker run --rm -v ${PWD}:/local -v ${PWD}\..\fihub-ui\src\app\core\api:/local2 openapitools/openapi-generator-cli generate -i /local/docs/swagger.yaml -g typescript-angular -o /local2 
# Bash
docker run --rm -v ${PWD}/GolandProjects/caisse-back:/local -v ${PWD}/PhpstormProjects/caisse-front/src/app/core/api:/local2 openapitools/openapi-generator-cli generate -i /local/docs/swagger.yaml -g typescript-angular -o /local2

About

Backend API using Go for users to overview and manage brokers, transactions and overall financial operations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published