Skip to main content
Glama

📊 コントロット

Go、HTML、 JavaScriptなしで作成された、セルフホスト型の損益トラッカーです。Controttoは、トランザクションを追跡してSQLiteファイルに保存し、以下のような様々な計算結果を返します。

  • 平均購入価格

  • 現在の資産価値

  • 取引履歴

  • 輸入/輸出取引(サンプル参照)

  • 損益

資産の価格を取得するために、Controtto は主に 4 つの API に依存しています (コードを参照)。

  • Binance - パブリック API、トークンは不要です。

  • BingX - パブリック API、トークンは必要ありません。

  • Alpha Vantage - 株式、無料ですがレート制限が短いです。(トークンを取得してCONTROTTO_AVANTAGE_TOKENを設定してください)

  • Tiingo - 株式、暗号通貨、外国為替。(アカウント/トークンを作成し、 CONTROTTO_TIINGO_TOKENを設定してください)

デモ

また、 demo.contre.ioでデモを確認することもできます。データベースは 1 時間ごとにリセットされます。

https://github.com/user-attachments/assets/28bf8782-6118-47c0-a94b-085e1a7045b2

すべての設定は.envファイルで設定され、環境変数として渡されます。変数CONTROTTO_PORTとCONTROTTO_DB_PATHが利用可能です。

# Install the dependencies
go mod tidy
# Set the .env
mv .env.example .env
# Source the env variables
. <(cat .env | grep -v -e '^$' | grep -v "#" | awk '{}')

Related MCP server: gograph

ビルドと実行

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 を使用します。

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Strict AI code reviewer powered by Groq. Finds bugs, vulnerabilities and security issues in your code. Supports analyze, compare versions, explain code, generate tests, and HTML reports.
    7
    3
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    A local AST and type-aware Go repository context indexer that uses CHA to map symbols, call graphs, dependencies, and architecture patterns. Built for AI coding agents that need to navigate and reason about large Go codebases without reading raw files.
    68
    230
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Real-time architecture governance tool that enforces Clean Architecture, DDD, SOLID, TDD, and Security rules across 8 languages using 11 specialized agents.
    1 npm
    MIT