Controtto

by contre95
Verified

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Supports configuration through environment variables stored in .env files for simplified setup and configuration.

  • Fetches cryptocurrency price data from Binance's public API to calculate asset values and profit/loss metrics.

  • Provides a container image available on Docker's public registry for easy deployment and management.

📊 제어

Go, HTMX, JavaScript 없이 자체 호스팅되는 손익 추적 프로그램입니다. Controto는 거래를 추적하여 SQLite 파일에 저장하고, 다음을 포함한 다양한 계산 결과를 반환합니다.

  • 평균 구매 가격
  • 현재 자산 가치
  • 거래 내역
  • 수입/수출 거래( 샘플 참조)
  • 손익

자산 가격을 가져오기 위해 Controtto는 주로 4가지 API를 사용합니다( 코드 참조 ).

  • 바이낸스 - 공개 API, 토큰이 필요하지 않습니다.
  • BingX - 공개 API, 토큰이 필요하지 않습니다.
  • Alpha Vantage - 주식, 무료이지만 가격 제한이 짧습니다. (토큰을 받고 CONTROTTO_AVANTAGE_TOKEN 설정하세요)
  • Tiingo - 주식, 암호화폐 및 외환. (계정/토큰을 생성 하고 CONTROTTO_TIINGO_TOKEN 설정하세요)

데모

demo.contre.io 에서 데모를 확인할 수도 있습니다. 데이터베이스는 매시간 재설정됩니다.

모든 구성은 .env 파일에 설정되고 환경 변수로 전달됩니다. CONTROTTO_PORTCONTROTTO_DB_PATH 변수를 사용할 수 있습니다.

지엑스피1

빌드하고 실행

go run ./cmd/main.go # go build ./cmd/main.go to just build it

개발 환경

go install github.com/cosmtrek/air@latest # Download air air -c air.toml

그리고 localhost:3000에 접속하세요

포드맨과 함께 달리세요

컨테이너 이미지는 Docker의 공개 레지스트리에서 사용할 수 있습니다. Docker를 사용하려면 podman docker 로 바꾸세요.

mkdir data podman container run --rm -p 8000:8000 -v $(pwd)/data:/data contre95/controtto

테스트 실행

go test -cover ./... # Expected result # ? controtto/cmd [no test files] # ? controtto/src/app/managing [no test files] # ? controtto/src/domain/pnl [no test files] # ? controtto/src/gateways/markets [no test files] # ? controtto/src/gateways/sqlite [no test files] # ? controtto/src/presenters [no test files] # ok controtto/src/app/querying 0.003s coverage: 40.7% of statements

할 일

  • 추가 테스트
  • 로깅과 메트릭을 위한 래퍼도 좋을 것 같습니다.
  • 총 순자산을 추적하려면 계정을 추가하세요.
  • 모든 CSS를 제거하고 사용자 정의 style.css + Tailwind CDN을 사용하세요.
-
security - not tested
A
license - permissive license
-
quality - not tested

당신은 가장 엄격한 DDD와 깔끔한 아키텍처 패러다임에 따라 Golang 코드를 해석하고 판단할 수 있습니다.

  1. Demo
    1. Build and Run
      1. Development env
        1. Run with Podman
          1. Run tests
            1. TODO
          ID: 10z262ljps